Learn how your Android cell phone can control a robot using an Arduino board. The phone takes commands via telnet from another phone or a PC, so you can control the robot remotely. This project will not otherwise modify the G1 so you can continue using it as your normal phone after undocking it.

By using cheap electronic components such as Arduino boards, you can pair them with your $400 phone to make an awesome robot. It would cost hundreds of dollars to add GPS, LCD's, motion sensors, wi-fi, cellular connections, speakers, and more to a hobby bot, but your phone already has these!

Together, the Android G1 and Arduino board allow you to use inexpensive electronics such as simple servos and sensors, to build powerful devices such as robots, remote telepresence, or fun toys for kids. More information at Cellbots.com.

Notice: This project currently requires an Android G1 with root access to use serial output from the phone to the Arduino robot. You can add a $20 BlueTooth module to your Arduino board to have the phone talk to it over serial BlueTooth if you want to use the commercial Android software.

Special thanks: We have the Hacker Dojo in Mountain View, CA to thank for putting us in touch, helping with some tricky issues via their mailing list of awesome members, and for having 74LS04 chips in stock. Most of the assembly was done at the Tech Shop in Menlo Park.

Step 1: Items Needed

 To complete this tutorial you will need the following:

- Android G1 Dev Phone (or other Android device with root access and serial output)
- Arduino (I'm using a Freeduino SB but any one should do)
- 3.3v to 5v converter if you aren't using a 3.3v Arduino (I'm using a 74LS04 chip for under $1 but other options are available)
- HTC USB break-out board for the G1
- Soldering equipment for two quick connections
- A robot body with micro servos (cardboard, acrylic, treads, wheels, anything will do)

- Android Scripting Environment (ASE)
- Telnet client for your PC (I'm using PuTTY on Windows)
- Arduino development environment
- (optional) Serial client for your PC (I'm also using PuTTY on Windows for this)
- (optional) Android SDK

If you can follow instructions you can complete this tutorial with little knowledge of Python, Arduino, Android, or electronics. You'll want to know those things if you want to go beyond a blinking LED but this will get you started.
<p>hi great work , i need to controll my Microconroller Atmega8 with Serial communication in android any API or Links please ?</p>
<p>i am using cyanogenmod11 ported to chinese phone. i only see ttyMSM0 when i grep /dev/. will ttyMSM0 works too?</p>
Can't seem to get &quot;chmod 777 /dev/ttyMSM2&quot; to work. <br>Keep getting &quot;Operation not permitted&quot;. <br> <br>I am rooted and running Cyanogenmod 6.1.0 on my G1. <br> <br>Would love to get this working for a personal project.
<p>I know this is way old, but in case people follow the same steps and end up with what vince086 had, simply enter super user by typing </p><p>&quot;su&quot;</p><p>This will allow access to enter the command &quot;chmod 777 /dev/ttyMSM2&quot;</p>
Hey, so I'll be trying this out soon, but wanted to let you and others know about other, cheaper and possibly useful options for the extUSB breakout board. I picked up three of these headphone charger combos hoping they'd be all pinned out, and they certainly are! (http://www.amazon.com/HTC-Multifunction-Adapter-T-Mobile-Shadow/dp/B001QD3MQE) I do enjoy sparkfun's products but it seemed the breakout board just had a bit of too much breakability for my clumsy fingers. a simple squeeze with some channel locks opened up the top and gave access to the inner workings.
Sorry, forgot pic
can i do this with another android phone running cygenmod 10 and i a micro usb slot
I want to try this but don't have much ideas on coding for this kind. anybody can help me out? I am new so just little help would be great.
Ok.. Cellbot.py is running on HTC Thunderbolt.. BUT it freezes phone when telnet connection made from computer. Any ideas?
Awesome ! :D <br>I'll try it with my Samsung Galaxy Mini. Many thanks !
Hello, <br> I am trying to use an HTC Thunderbolt with my Arduino project. I have rooted the phone, I have cellbot.py running on the phone. But when I try to send a command to the Arduino, the phone freezes up. The command is never relayed to the Arduino. Any suggestions on how to cure this. I read in another blog that multithreading the python program will help. Not sure if that is true. I am not that familiar with Python. I am trying to learn multithreading on python now. Am I wasting my time? <br>Much thanks in advanced.
Hi??? this project can use android experia 10 mini pro???
it looks nice sir,,we would like to implement this project...from wher we can get the components for this project?
Do you have to have the arduino at all? <br>Could you not just have the phone do all the processing (after all, they do have pretty good processors) and have the micro-controller just relay the commands to the motors etc,
my android phone doesn't have serial port. Can i use a usb to srial converter to <br>connect it to the arduino... please reply
No android phone has a direct serial port, heck, I don't think you can buy a proper computer with a serial port anymore.<br>What some android phones do have is the usb port used for connection to a computer, can be used the other way by the phone. This means that you take a special plug (the HTC usb break-out board) that lets your phone talk to a micro-controller.<br><br>So google your phone and see it if has a &quot;proper&quot; usb port. Mine doesn't, and I think they are quite rare, but you may be lucky.<br><br>(I think, someone correct me if I'm wrong)
i have a samsung galaxy y s5360. how to connect this phone serially to robot. is it hrough usb data cable.. i desprately want to this project.. please provide with a solution.<br>
This is brilliant, I plan to do a similar thing though have it controlled via the left and right channels of the headphone jack. It's not an original idea, though it's certainly an easy way out.
I have HTC Wildfire Android mobile.<br><br>Is it possible to built with this phone?<br><br>A. S. Bhasker Raj<br>Secunderabad<br>India<br>Mobile: +919247332574
i don't see /dev/ttyMSM2 on my phone. It is rooted though. what can I do?
how did you connect android to arduino ? using serial ttl ?<br>does android has a serial ttl port ?<br><br>sorry, because i only have symbian s60 5th
great work!
Nice Project! i think i will build this!<br><br>But just got a question before i build that<br><br>1) i just have a look on the datasheet of 74ls74, isnt that the 74ls04 have a output level of 3.3v but not 5v???So are we converting 3.3v(from phone) to 3.3v(to aridno) agian using the 74ls04?<br><br>2) And will G3 and upper version not works with that? since they are using the standard usb again and separate the audio(tx) + Switch(rx) pin to an 3.5mm jack ?<br><br>Thank You
Beginning of 2011 inopiaaardbei made a solution called: &quot;Microbridge&quot; using the Arduino USB host bridge and wrote the software to use the Android Debug Bridge to communicate from and to the Arduino.<br><br>See more here - http://wp.me/pCAFq-h5. Links to his google code solution are in the post.<br><br>A direct link to the google code repository is here: http://code.google.com/p/microbridge/
is it possible with HTC Wildfire. Wildfire has another USB break-out.. Can you please help me about this.,
hey, can i run my camera app that i have built using the ecclipse , the same time when this appp on python is running....illl be glad if some body helps me on this
For the newer generations of android electronics (phones and tablets) including the Droid. They come with USB host already built in&gt; Could i use the same programing cable for my arduino to connect to an android tablet? If i did, what app would i need to accomplish a serial port to the arduino? <br><br>Chow.
it not goes nothing?
One of my last projects was a 4x4 differential drone, built from scratch, remotely controlled via Bluetooth using an Android smartphone.<br>Schematics / demo video here: http://www.pocketmagic.net/?p=1398<br>Besides ultrasonic sensors, the robot is about to be equipped with a homemade geiger counter sensor to detect &quot;exotic&quot; environment parameters <br>like the dangerous ionizing radiation. There are quite a few possibilities since the robot has an ATmega microcontroller that can easily <br>support additional sensors. <br>The data is sent back to the Android device, via bluetooth.
Can I buy a kit?
You can also choose the latest<strong> Super D 1.10.2</strong> as well while older version 1.9.3 does not support the feature.<br />
COOL!I wanna try it!&nbsp;
is it necessary for the phone on the bot to have service turned on??<br /> <br /> are there ways to control the bot through satellite instead of using cellphone service. that way you wouldn't be dependent on a service.<br /> <br /> Is there any way to bypass the use of cell phone towers all together???<br />
&nbsp;We typically test with phones that have no SIM card and use wi-fi for local communications.
what if you wanted the bot to travel across several states?<br /> <br /> and i've been looking into flying bots, it's been hard to find anything here on instructables.<br /> <br /> how hard is it to send live video and sound feed from the bot to your PC??<br /> <br /> i'm trying to gather info for a different project i'm working on??<br />
&nbsp;We just added XMPP support so as long as the phone has a data connection (any kind will do), you can command it from anywhere.<br /> <br /> Feel free to start a thread here with ideas: http://groups.google.com/group/cellbots<br />
Thanks for this nice Tutorial - I can confirm that the latest kernels of Cyanogen have Serial enabled. (I'm personally using a HTC Magic - not a G1)<br /> <br /> I did a bit of research as well and found out that Arduino sees 3,3V from the Phone as valid &quot;high&quot; state, so you would not need the <a href="http://www.google.com/products?q=74ls04" rel="nofollow">74LS04</a> in between for sending the data to the arduino.<br /> This is of course different in the other direction - there you have to reduce from 5V to 3,3V :) <br /> <br /> Cheers<br />
Great find captFuture. I'll update the instructable to reflect that. Still trying to get two-way working but the issue isn't hardware so much as making an incoming serial socket using Python when pySerial isn't in ASE.<br />
&nbsp;Maybe it would be an option to do it in java - some guys are developing a serialport API for the SDK.<br /> <br /> <a href="http://code.google.com/p/android-serialport-api/" rel="nofollow">code.google.com/p/android-serialport-api/<br /> <br /> <br /> </a><br />
&nbsp;but you need the serialport dll..... can you send me?? i can't compile it!!! (rice103@gmail.com)
&nbsp;You'll have to reach out to the Android Serialport API project team for the code they are using. My work has been using Python on Android via the Android Sripting Environment.
Good to see someone else looking at this... I'm planning on interfacing to an AVR soon for a couple of projects soon (one is a universal IR remote - sending serial commands to the AVR which flashes an IR&nbsp;LED... the other involves the USB host support on the AT90USB1287.. but that ones a secret ^_^)<br />
&nbsp;That is pretty awesome.... perhaps programming on the android to the arduino is on the horizon?
&nbsp;That could certainly be possible. If not programming on the phone it would certainly be nice to send new programs remotely to it instead of plugging it in each time.<br /> <br /> Glad you like the tutorial and hope you make something cool with it.<br />

About This Instructable




Bio: Husband and father of two. Product Manager at Google.
More by mranalytical:Android G1 Serial To Arduino Robot 
Add instructable to: