Serial on Android using the audio port
The Android platform is extremely powerful -- we've been running robots and logging systems based on it for over a year now, so we should know!
While our software and source code is available on this very wiki, we'd like to offer to the community a code snippet and a schematic that can be used to let your Android phone control any microcontroller (and from there you can move servos, motors, or whatever else) without the need to root the phone. You get 24000BPS (that's 24 thousand, not 24 hundred), which is decent (if your microcontroller or device can only do standard baud rates, you may be limited to 19200bps or 9600BPS) and since the headphones output is stereo on most phones, you actually get two serial ports! This is only for transmission right now, however. The inspiration is of course Flake Labs ( Fun, Learning, and Killer Electronics. www.flakelabs.com ) although we've moved all the logic to software in order to make the hardware as simple as possible.
Source(s): Android solutions
The hardware to use this is very simple: you will get a nice TTL signal from this. If you invert it, you can talk to a RS232 serial port directly.... happily the LM324 has four op-amps on it, so you can use the other two as inverters if you feel like it.
The "audio in" just goes back to your phone jack, with ground in the middle.
You will want to adjust the potentiometer depending on what phone and microcontroller you're using, especially at higher baud rates: in general, it should be barely above zero volts -- some phones give a bit of a bias to their headphone outputs, so make sure to stay above that.
The software can be downloaded on the Android Market by searching for re.serialout ; email me for source code at mkb(at)libero.it or download it at http://robots-everywhere.com/re_site/audioserial/
We recommend using the Picaxe microcontroller as a slave device, as it is very cheap, easy to program (no programmer required, just two resistors and a serial cable) and very tough electrically.
Don't forget that [| I sell a kit!]