Android + Arduino + USB Host + Serial 4 digit LED
Interfacing a serial display with Android and Arduino. This article will demonstrate communication of a serial 7 segment display, specifically this one: 7-Segment Serial Display – Blue from Sparkfun electronics. The fancy wheel scroller is based on the android-wheel widget from yuri kanivets.
For additional background information on interfacing Android with the real world, check out my other introductory tutorials:
Hardware
Parts needed:
-
Android Device (1.6+)
-
7-Segment Serial Display
-
Hook-up wire
-
Android ADK Board*
-
– OR –
-
Arduino compatible and USB Host shield
*Supported boards include:
Google ADK board, Freeduino ADK board , Seeed Studio ADK board, and DIY Drones ADK board
Assembly
This display can be controlled with either SPI or serial TTL communication. However, since the SPI pins are required for communication with the USB Host, TTL serial must be used (this also requires fewer pins, one instead of three). So, connect the RX pin on the serial display to the serial TX pin on the Arduino (determined by the firmware sketch) and connect GND and VCC on the serial display to ground and+5v respectively. Here is a diagram of the completed circuit (created with Fritzing):
Software
Arduino Firmware
Next, upload the Arduino sketch to the microcontroller. The sketch uses the Microbridge implementation by Niels Brouwers. Microbridge uses Android Debug Bridge (ABD) forwarding over TCP, rather than the Google Android ADK. You can checkout the source for the Arduino sketch from Github, or just copy and paste the following into the Arduino IDE.
Android App
The next step is to install the Android Demo application onto the device. You can either download the pre-built .apk or checkout the source from Github:
git clone git://github.com/mitchtech/android_adb_serial_4_digit_led.git
Finally upload the app to the device (or browse to this page on the the device and download the apk above). Connect the Android device to the USB Host board/shield, and start up the app.