Let's Make Robots!

Android phone as a controller

Hello there :)

I'm on the edge of purchasing an android phone. Looking at specifications around i thought: "Hey but this is the perfect controller for a robot!!" It has an incredible inventory of useful stuff: gps, compass for navigation, wifi, bluetooth and cellular for communication, huge screens for UI, speaker for talking, plenty of cpu, camera, easily programmable, and so on, all packed in a small package, all low power! And all for as less as $200! What do you want more ??

There's only a drawback: there's no simple way to phisically connect a device to peripherals :(

Practically all android phones lack any kind of serial, spi or i2c connection. They have USB but client only.

Anyone know of some hack to resolve the issue ? I tought of opening the phone and try to identify an i2c bus, but it's a little too invasive :) some hack on the USB? Some SPI ?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

delete this one (double post it)

im interested in this one too .

i was thinking of buying one  because of its specifications...

Correct me here folks, the Android will run Java-written programs, correct? And these apps can access the hardware features of the phone, right?

--BTW an answer to the original question, I have has AWESOME results using Bluetooth to relay data, is it as simple as just sending info that way?

 

correct, you can program them in Java and access all the feature via code (bluetooth, wifi, camera, sensors, etc).

Just an fyi, there has been a project going on called amarino that allows you to collect data from the arduino but I belive you could have 2 way com. CTC, they even use our beloved firefly bt device, which I have tried already and played around iwth this app. The nice thing is that it's fairly feature rich andi f you are familiar with java, the source code is available to you as well.

The FTDI chip in an Arduino connects the USB to a serial interface.  My Maemo OS2008 Nokia N800 has a driver for communicating through the USB (it's requires a bit of work to get it running each time).

Perhaps the Android phone has drivers somewhere for FTDI/USB-to-serial communications?  A google search of "android arduino" or "android ftdi arduino" might help you there.

-John

(edit: oh yeah, the point:  If you buy an "FTDI cable" (5V or 3.3V) it'll work just fine with the driver, and you can plug it in to your serial device.)

(pps -- After a quick search it looks like you might end up using a similar "usbserial.ko" and "ftdi_sio.ko" kernel module on your phone to what I use on my Nokia OS2008, probably along with the pyserial-2.5 library.)

as far as i know, usb in cell phones is only client, not host. And you need an host becouse the FTDI is client.

correct me if i'm wrong :)

I currently have an Ardupilot Mega talking to my Nokia N800 terminal program.  The USB port on the N800 is normally for accessing the memory or re-flashing the device, but software is available for "USB Host Mode".  Serial access in Linux is via "root" privileges only, so I had to install root access.  The kernel modules usbserial.ko and ftdi_sio.ko have to be installed by a root user ("insmod usbserial.ko") each time the device is restarted, and USB Host Mode must be enabled.  Once these things are installed, the FTDI device shows up as "/dev/ttyUSB0".  The way I chose to access the port is through python, a language in which, like German or Italian, I learned just enough to scrape by. 

Hopefully you can find the kernel modules in Android OS, along with the "USB Host Mode", root access, and pyserial.  If you find those, I'll be happy to post the reference I used for getting serial output working on OS2008, since it might be similar across Linux-like distributions.

Look at the cellbots homepage. They have build a lot of robots controlled by Android phones. The easiest way is , to use Bluetooth as connection between robot and phone. So you will need a Bluetooth UART adapter for your robot, but you don't need to root your phone. A cellbot script for Arduino exists, which needs to be adapted for your robot. On the Android side. python scripts were used for the control programs, no Java programming needed. All necessary code can be found at Google code. For running Python an Android the android-scripting Environment (ASE) is needed.

I have tested it with my Ardubot controlled by a HTC Nexus One and it is working (most of the time). Sometimes the Bluetooth will not connect, but that is a minor issue. Until now I have not found the time to make a video, a tip & walkthrough, or writing my own scripts. Maybe this weekend I will have find the time for this.

I though to use my Nokia phone for visison. With Symbian and Python everything seems possible (although, slow). I think the easyest way to connect other thingies to phone is with headphone jack. You can output different frequencies, through optoisolator(for safety) it's possible to decode it in your atmega/pic. Probably the best way if you don't have massive data amounts. Motor and light control should be possible. You can use microphone jack for feedback. Second way is that android should be able to be USB master, if that is true then USB to serial converter or VUSB or whatever. Worth research if you want to be awesome. Even allows two way data transfer. Third and the easiest way is screen light.. Screen light on - drive, screen light off - stop. Or even different colors and color sensor. With big enough screen you should get many sensors.. And mobiles second camera or light sensor for feedback.