Archive for April, 2010

Powering A Robot From The Phone’s Battery

Tuesday, April 27th, 2010

We’ve simplified the Tankbot so much that this has to be one of the simplest and cheapest robots around. Instead of a 5v Arduino, which needs 3.3v to 5v logic level converting, we’re using a 3.3v Arduino Mini Pro. The TX and RX pins can connect directly into the HTC breakout board on the bottom of the Android G1 for serial communication.

Powering a robot from an Android G1 phone

The only tricky part was getting a thin 30 gauge wire to run into the back of the phone and wrap around the positive battery terminal. We tried some thicker wire at first but it prevented the phone from maintaining a connection and it would shut off accidentally. The thinner wire sits there nicely and we might try making a permanent connector on the outside of the phone so it can fit back in a pocket without a wire sticking out.

Powering a robot from an Android G1 phone

The top picture is a working version with the red 30 gauge wires above is an early test with a thicker green wire that had a flaky connection. You can see that we’re still using the HTC breakout board wiring for TX, RX, and ground, and we’re not yet connecting the fourth wire that you see here. That would be used for charing the phone but doesn’t provide enough power out to run the robot.

Wiring the robot into the bottom of the phone

This video overview shows you the whole thing moving around to prove it works. No word yet on the effects of doing this on your battery so please do so at your own risk.

If you get something similar working, share it in the Cellbots support & discussion group. Bonus points if you hook your robot up to a wireless charging station!

Handling 3.3v to 5v Logic Level conversion

Monday, April 26th, 2010

Most projects using a 5v Arduino board for robots are going to run into some 3.3v circuits at some point. This might be the serial line coming from a G1 Android phone or an inexpensive Bluetooth module. To deal with this properly you’ll want to be able to convert the voltage going in and out of the Arduino to work properly with these devices.

Let’s look at two options, starting with the least expensive, but more complicate method we started with in 2009. This involves using a $0.25 hex inverter chip such as an 74LS04 chip and two resistors. We used this to send the 3.3v signal from the phone into the chip, back out at 5v but inverted (0’s were 1’s and 1’s were 0’s), and then through again to come out properly at 5v.

Handling the 5v to 3.3v side of things is even easier with two resistors. We used a 20k and a 39k resistor as described here on Make Things, but we’ve also used a 1.8k and a 3.1k as described here. Both did the job just fine and made sure we didn’t fry our phone or Bluetooth module.

Two resistors to handle 5v to 3.3v

The above method has served us well but we’re moving on to using this $2 logic level converter from Sparkfun.

Logic level converter from Sparkfun

It supports two channels of conversion and we’re only using one so far. You simply connect it to your 3.3v and 5v power sources and it handles converting the signal in and out. You can use the Arduino for both power sources since they typically provide you one of each level, even though the RX/TX pins are always 5v. All you need is a little soldering when you get the board to connect the header pins and it will plug right into your breadboard.

Soldering the logic level converter circuit board

Some of you have pointed out that the Arduino will often treat as 3.3v RX serial input just fine. We’ve tested this as well and found it usually works. You’ll still want to lower the returning TX voltage going back down to 3.3v  to not damage your phone or Bluetooth module. To be safe though we recommend using the proper conversion each way to avoid headaches by eliminating the chances that something isn’t reading right.

We’ve posted some additional pictures of what we’re doing in our gallery and embedded it below for convenience. Read the captions to see what is going on in each shot and reach out to the Cellbots discussion group if you need a hand or want to share some tips of your own.

Updated CAD Designs & Acrylic Cutting

Sunday, April 25th, 2010

We wanted to share a little more about the process behind the design of the Truckbot. The process starts by using SolidWorks to do the CAD work, and then exporting those files to PDF, and then using CorelDRAW for the laser printing.

Using SolidWorks for the design

It sounds more complicated than it is, so check out this video of us going from the CAD design PC’s to the laser cutting room at the TechShop for printing on the Epilog.

We started by making our first robot using cardboard from recycling bins to flesh out that the parts all fit as expected. Then we moved up to using some nicer cardboard from Michaels craft store for $5 a sheet. After that we upgraded to acrylic from TAP Plastics, which ran us $20 for an 18′x24′ sheet that makes four robots.

Laser cutting acrylic

We hope this helps you to create your own custom robot design and share it with us. It only took us a few weeks to feel comfortable so don’t be afraid to dive in and start making a personalized Cellbot today.

Using Plastic Heat Shrink To Protect Electronics

Saturday, April 24th, 2010

The robots we’re using for Cellbots are typically very small and use tiny wires to connect all of the circuits. We’ve had cases where two of these wires bend and start shorting, and other times where we’ve pulled too hard to remove a connection and the solder just snapped. So to be safe, we recommend using plastic heat shrink where possible on your most commonly yanked on parts.

Applying heat to the plastic tubing

It’s really easy to use and not very expensive with $8 kits from Sparkfun. Here is video of us using heat shrink to protect some parts on a Cellbot:

The most helpful place we’ve used heat shrink is on the HTC breakout board that we plug into the bottom of G1 phones. We insert and remove this dozens of times a day when testing and this has helped make sure we didn’t fry things along the way.

Heat shrink on the HTC breakout board

We have some more pictures in the gallery and you can read the captions to learn more about the process. It’s quick, easy, and fun to watch like the old Shrinky Dinks you might have had as a kid. Just don’t put your Cellbot in the oven!

Using Bluetooth On Android & Nokia

Friday, April 23rd, 2010

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!