Android Phone and Arduino

Hi all,

First of all, I am a complete novice in electronics, so I am sorry if my questions are silly. I am a student and as part of my final project I need to interface arduino (nano) with a G1 Android based phone. The little that I know about USB and Android is that Android is not (yet) implemented with host capabilities. My question is this - is there any way to connect the two even though the phone cannot host?

Any idea, comment, or referral would be more than welcome, since I am completely in the dark here.

Thank you very much!

There is a way, described in detail here: http://www.instructables.com/id/Android_G1_Serial_Cable/

Hi florinc, thanks for the reply.

I’ve seen this article, the problem is that it describes how to serial to USB cable, and as I have mentioned, it won’t help since the Android platform does not support USB host…

The info you want to extract from the instructables article is on page 2, where the HTC's pins are shown: pin 8 is Tx, pin 9 is Rx. These will be connected to Arduino's Tx/Rx. No messing with USB. (Remember that the USB connection on the Arduino gets mapped to a serial port.)

Thanks man! Another (probably) newbie question - from the instructables site I gathered that the G1 works on 2.8v while the Arduino Nano (which I want it to be connected to the phone) needs either 5V or 6-20V (from its specs). How can I do the conversion?

And again to be honest I don't know what it means that the USB connection on the Arduino gets mapped to a serial port...

Again, I am a complete newbie when it comes to electronics, I mostly did software development up until now. My new project requires the hardware interface so I am learning on the go.

Thanks again for all the help!

Arduino talks with the PC through a serial port. The FT232 chip on the Arduino board takes care of creating a virtual serial port, "virtual" because it is actually going through USB rather than through one of the physical COMs (check the list of virtual COM ports in the list of USB devices, in Device Manager; I am talking about Windows environment here).

I am not too familiar with Arduino Nano, but there are Arduino boards powered by 3.3V: http://www.sparkfun.com/commerce/product_info.php?products_id=8824 For these, 2.8V should be OK as TTL signal 1.

If not, then you would need to use some sort of voltage divider or some chip like 74AHC125.

Ok, I think I'm starting to get the picture.

Now, the operating system I intend to use the Arduino with is not Windows but the Android G1 phone - do you know if the communications with that system will be the same as you described?

Sorry for another newb question - what is TTL signal 1?

TTL is “Transistor-to-Transistor Logic” and 1 is… Well, not 0. “High”, “up”, “voltage there”.

Cantor, I invoked Windows to offer an explanation of how USB gets involved with Arduino. On Android, and I am talking in principle here (I have no experience with it), you should have access to (and be able to use) a library for serial communication. The code you write on Android for serial communication will look similar to the one running on Arduino (e.g. using "Serial" class: Serial.print, Serial.read etc). Take a look at the reference for Serial here: http://arduino.cc/en/Reference/Serial

Also, I suggest you study and get familiar with the Android serial libraries as well. In the meantime (if you don't have Android on hand), you can speed up your development using Windows for simulation (your windows code will be ported afterwards to Android).

Ok, I think I got it, thanks!

Of course things cannot be simple and after reviewing the Android platform I have discovered the most annoying thing - it does not have a serial communication API implemented yet!

Don't know if you're still working on this.. but there is a serial api for android:

http://code.google.com/p/android-serialport-api/