Using Bluetooth On Android & Nokia

The Nrover Cellbot running on Nokia phones has always been using Bluetooth, and now we’re using it for the Android Truckbot and Tankbot too. This is thanks to an upgrade to the Android Scripting Environment, which now allows for Python code to call the Bluetooth API’s on any Android 2.0 and up device.

Here is a video of a Nexus One phone driving the Tankbot via Bluetooth (do not adjust your set, it came out very dark):

The Tankbot is using this $20 Bluetooth module from Seeedstudio, and a $19 Arduino Pro Mini that runs at 3.3v. We’re also using a $12 3.7v Lithium Polymer battery, but you could get away with 3x 1.5v AAA batteries just as easily. The LED’s for watching the Bluetooth module status are handy for debugging but optional for normal operation.

Here is a picture of early testing where we used a $22 USB to serial adapter from Sparkfun. If you get the master/slave combo Bluetooth unit from Seeedstudio, this will be required for programming the device to be a slave (it isn’t either out of the box). If you go with their slave-only unit then this won’t be needed and it should be ready to go upon arrival.

A $20 Bluetooth module wired up to our Tankbot

This is the final configuration where the Bluetooth module is wired into the Arduino via a small breakout board. Not pictured here is the $14 FTDI board that we use to program the 3.3v Arduino. You only need this for programming so only buy one no matter how many 3.3v Arduino’s you buy.

Bluetooth on the Tankbot robot

The Bluetooth is being used to get command signals out of the phone and into the microcontroller or servo motor driver board via serial. The software on the robot doesn’t change at all since it just receives text strings over serial and doesn’t care if there is a phone hardwired on the other end or a Bluetooth module. The phone software needs to call the right API’s though.

Tiny Bluetooth module

We’ve updated the Python code for Android here, and the Nokia code has always had that capability. The code for talking to the hardware is different where the Nrover Cellbot on Nokia uses btsocket to establish a connection via btsocket.set_default_access_point(btsocket.access_point(btsocket.select_access_point())), while on Android it is abstracted a bit more with droid.bluetoothConnect(“00001101-0000-1000-8000-00805F9B34FB”). Both get the job done and make a nice alternative to serial, which meant using a modded version of Android, and wasn’t possible on Nokia.

We have a few more pictures in the gallery to help you get started. Try using Bluetooth for your cellphone controlled robot today!

This entry was posted in How-To. Bookmark the permalink.

7 Responses to Using Bluetooth On Android & Nokia

  1. Alban says:

    I just received the bluetooth dongle and I hope I didn’t burn it already….. Should I see the dongle when I just power it through my bluetooth manager with my laptop or my phone ?? Else, do you know which is the best way to test it ? (send some data and see what there is on the uart ?)

    i really don’t know if my soldering (welding) is good

    Thanks a lot

  2. This is a great blog. Thanks for the informative post!

  3. Logan says:

    Why does it look like to the logic converter is still in use. Wouldn’t you not need to use that since it has bluetooth now.

  4. thanks, interesting article

  5. Best Robot Vacuum says:

    Wow! This can be one particular of the most beneficial blogs We have ever arrive across on this subject. Basically Wonderful. I am also a specialist in this topic so I can understand your effort.

  6. Leo says:

    Hi, very nice job!
    I enjoyed the humour in the videos too.

  7. Doudoune Moncler Pas Cher en ligne,Doudoune Moncler Femme Vente – Groupe SCE

Leave a Reply

Your email address will not be published. Required fields are marked *