
microbridge
Note: Microbridge is provided as-is. I do not have the time to provide personal support. Please do not contact me with questions unless you are absolutely certain that a) you know what you are doing and b) your problem is related to Microbridge directly. Thank you for your understanding.
What's this?
MicroBridge is an Android Debug Bridge (ADB) implementation for microcontrollers. MicroBridge allows stock, unrooted Android devices to talk directly to USB host enabled MCUs, thereby enabling phones to actuate servos, drive DC motors, talk to I2C and SPI devices, read ADCs, and so forth. MicroBridge works on Android 1.5 and upwards.
http://www.youtube.com/watch?feature=player_embedded&v=QW41rj0OQT0' target='_blank'>http://img.youtube.com/vi/QW41rj0OQT0/0.jpg' width='425' height=344 />
How does it work?
The ADB protocol supports opening a shell on the phone or issuing shell commands directly, pushing files to the phone, reading debugging logs (logcat), and forwarding TCP ports and Unix sockets. Using TCP sockets it's possible to establish bidirectional pipes between an Arduino and an Android device. The Android application listens on a port, and the Arduino connects to that port over ADB.
When the connection is lost because the application crashed or because the USB device was unplugged, MicroBridge periodically tries to reconnect. When the device is plugged back in, the link is automatically reestablished.
Software
MicroBridge is fully functional and able to do pretty much anything you can do with the command line ADB tool. Two versions exist, one written in C, and a C++/Wiring port for Arduino.
The Arduino library can be used with the Arduino IDE, and includes a couple of examples, including forwarding a unix shell, rebooting your phone, logcat output, and a small demo application showcasing bidirection communication between Arduino and Android.
Hardware
The current supported hardware is Arduino (Uno, Deicimila, Mega, or compatible) and Oleg Mazurov's USB host shield. Sparkfun carries a slightly cheaper version of the same shield, although this requires VIN on the Arduino.
Since Google's ADK was announced, other stores have started selling (Arduino Mega compatible) USB host shields for Arduino, such as Emartee, and DFRobot. Single-board solutions are also available, such as this Arduino Mega ADK from DFRobot or Arduino directly. Seeed studios sells their Seeeduino ADK.
Finally, Oleg also sells a smaller max3421e breakout board for use with the Arduino Pro Mini.
Compatibility
MicroBridge has been confirmed to work with several phones, including the ZTE Blade, Nexus S, Samsung Galaxy S, and HTC Desire HD. We have not yet encountered a device that it did not work with, so it is likely that it will work with yours as well.
I'm interested to hear from you if you've used MicroBridge to talk to a device that's not on the list.
Alternatives
Since the initial release of MicroBridge several alternatives have emerged. First of all, PropBridge is based on MicroBridge but instead uses a propeller chip and very little external hardware. A PIC24 port of Microbridge that uses the PIC24FJ64GB002 can be found here. Sparkfun is selling a device called IOIO, an open source PIC24-based device which does not require any firmware programming but instead lets the Android device control its IO pins directly. Finally, Google announced ADK, the open accessory development kit. The ADK reference design is based on Arduino and Oleg's USB host shield.