Step 6: Bluetooth Circuit

The Bluetooth module is the bridge between the Android app and the Arduino.


Before you start you need to check the voltage requirement for your module. Many of these modules require 3.3V which the Arduino can provide without problem but the digital Tx output pin on the Arduino is 5v so you will have to build a simple level shifting voltage divider. Before you build the shifter solder leads onto the Bluetooth module. You need a lead on the Rx, Tx, 3.3V, and GND pins. Now for the level shifter grab the 10 and 20 kOhm resistors. Attach one leg of the 20 kOhm resistor (or 2x 10kOhm resistors in series) to ground, and the other to one leg of the 10 kOhm resistor. Add the end of the Bluetooth modules Rx pin to the connection between the two resistors. Finally connect the the other leg of the 10kOhm resistor to the Arduino's Tx pin. The last three connections from the Bluetooth module are simply GND to Arduino GND, 3.3V to Arduino 3.3V, and Tx to Arduino Rx. Once again the Arduino's headers are covered by the motor controller on the final build. Thanks to a1r, without whose Instructable I would have probably cooked my first Bluetooth board.

In the end I got a different Bluetooth module off of ebay that had the Vcc, GND, Tx, and Rx lines boken out to header pins and included a header cable. This unit was also 5v meaning the level shifter was not necessary. If you have a 5v module simply connect Vcc to the Arduino 5v pin, GND to Arduino GND, Tx to Arduino Rx, and Rx to Arduino Tx.


This test program for the Bluetooth also doubles as the test program for the Android app. A simple test you can run before getting into the Android stuff is to simply check if your phone can pair and connect to the Bluetooth module. The actual test code below blinks the led slow for 10 seconds when up is pressed in the app, and blinks the led fast when down is pressed in the app. It also cancels the led if either button is long clicked. Remember that the Bluetooth needs to be unplugged from the Arduino while you upload the sketch.
<p>hi</p><p>You can use encoder for position</p>
<p>You sure could.</p>
<p>Is there any way that I can implement an iOS equivalent of this software?</p>
<p>I assume you mean the Android side and not the Arduino code?</p><p>Yes there is a way but I don't know the specifics and it will involve more work.</p><p>Your best bet would probably be to look up some Bluetooth-Apple projects on the site and see how they handle it or ask the creators.The more open nature of the Android environment means most people probably gravitate towards it for projects like this so you may have to look at a few to find one that uses Apple.</p><p>Alternatively try to find a generic Bluetooth serial app and use it to directly type and send the numbered codes.</p><p>If you really did mean the Arduino code then there is nothing OS specific about it. Just go to www.Arduino.cc and download the IDE for your operating system.</p>
Have you finished the gate/door
I never did get to that. In the end the fact that it was out of the way in a room that doesn't get used much meant there wasn't much incentive to roll it up and down. Now we're planning on moving soon so it's all got to come out anyways. I may do an updated version in the new house though.
Excellent instructable... I like how you used the shaft directly on to the rod...great article!
Thank you, glad you like it! It worked pretty well for the resources I had but I think access to a 3D printer could really kick it up a notch. Some day I may do a second version that's a little less, &quot;prototype-y&quot;, if you know what I mean.
Really good instructions. If you don't want to do any Android programming but still want to have all the flexibility you need to do what you want, then try my pfodApp, on the Android Market. <br> <br>See www.pfod.com.au for detailed examples of usage. <br> <br>The one pfodApp can handle multiple different devices. The (Arduino) device tells the mobile what choices and text to display to the user, via small msgs. Commands back to the Arduino are very simple, eg. {1} for command 1. See www.pfod.com.au for a very small Arduino cmd parser. <br> <br>The pfod install instructions tells you how to connect to a new bluetooth device and give is a unique meaningful name. e.g. Garage Door <br> <br>One user of pfodApp has used it to control multi-colored KnightRider lights, with multiple menus and selection screens.
Wow, this is very impressive, I noticed we have the same bluetooth dongle and it's making me wish I had a projector so I could build this myself, sadly I don't have a drop ceiling so I'd have to make it look even more pretty and bolt it directly to the ceiling, I take my hat off to you sir this is a very impressive ible.
Thanks! That Bluetooth module is pretty awesome. It was one of the easiest parts of the project to get working. I'll definitely be using it again.

About This Instructable


84 favorites


Bio: Why buy when you can DIY? Educated a Mechanical Engineer and trained as a classical cellist I consider myself a bit of a jack-of-all-trades, dabbling ... More »
More by bwrussell: Roulette Party Music Player Apple Crate Coffee Table Chandelier Barrel Shade Retrofit
Add instructable to: