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.
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.
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.
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!