topamax once a day

Android + Arduino + USB Host + Temperature + Light

Sensing temperature and light with Android and Arduino.  This article will demonstrate a basic thermometer / ambient light level detection input accessory.

For additional background information on interfacing Android with the real world, check out my other introductory tutorials:

Simple Digital Input
Simple Digital Output
Simple Analog Input
Simple Analog Output

 

Hardware

Parts needed:

  • Android Device (1.6+)
  • Photocell
  • 10K ohm resistor
  • TMP36 temperature sensor
  • Hook-up wire
  • Android ADK Board*
  • – OR –
  • Arduino compatible and USB Host shield

*Supported boards include:

Google ADK boardFreeduino ADK board Seeed Studio ADK board, and DIY Drones ADK board

 

Assembly

Connect one of the photocell leads to 5v and the other to analog input pin A0. Also connect the same lead through a 10K resistor to ground.  In hardware, this concept is known as a voltage divider.  Then connect the ground and power leads of the TMP36 to, you guessed it, ground and 5V.  Finally, connect the signal lead of the TMP36 to analog input pin A1. 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_temp_light.git

Finally upload the app to the device (or browse to this page on the device and download the apk above).  Connect the Android device to the USB Host board/shield, and start up the app.

 

Android + Arduino + USB Host + Pan Tilt LEDs

Combining analog and digital outputs with Android and Arduino.  This tutorial will demonstrate the basics for using two servos to achieve basic basic pan and tilt functionality. In addition, digital control is demonstrated using two LEDs.

For additional background information on interfacing Android with the real world, check out my other introductory tutorials:

Simple Digital Input
Simple Digital Output
Simple Analog Input
Simple Analog Output

 

Hardware

Parts needed:

  • Android Device (1.6+)
  • 2x Hobby servos
  • Pan / tilt bracket assembly
  • 2x LEDs
  • 2x 330 ohm resistors
  • Breadboard
  • Power supply
  • Hook-up wire
  • Android ADK Board*
  • – OR –
  • Arduino compatible and USB Host shield

*Supported boards include:

Google ADK boardFreeduino ADK board Seeed Studio ADK board, and DIY Drones ADK board

 

Assembly

Connect the red, power lines of the servos to +5v, the black ground lines to GND, and the yellow signal lines to the desired output pins, 5 and 6 in the example (others can be used, but must be PWM capable).  Also, connect the 330 ohm resistors in series with the anodes of the LEDs to the desired digital output pins, and the cathodes of the LEDs to ground.  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 official 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

Finally, install the Android Demo application onto the device. You can either download the pre-built .apkor checkout the source from Github:

git clone git://github.com/mitchtech/android_adb_pan_tilt_leds.git

Finally upload the app to the device (or browse to this page on the device and download the apk above). Connect the Android device to the USB Host board/shield, and start up the app.

 

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:

Simple Digital Input
Simple Digital Output
Simple Analog Input
Simple Analog Output

 

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 boardFreeduino 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.

Android + Arduino + USB Host + Swivel Head Android with LEDs

Combining analog and digital outputs with Android and Arduino.  This tutorial will demonstrate the basic use of combined digital and analog outputs.  The basic hardware is a hobby servo and two LEDs inside of an Android figure.  The servo allows Andy Android to rotate 180 degrees.

For additional background information on interfacing Android with the real world, check out my other introductory tutorials:

Simple Digital Input
Simple Digital Output
Simple Analog Input
Simple Analog Output

 

Hardware

Parts needed:

  • Android Device (1.6+)
  • Hobby servo
  • 2x LEDs
  • 2x 330 ohm resistors
  • Breadboard
  • Power supply
  • Hook-up wire
  • Android ADK Board*
  • – OR –
  • Arduino compatible and USB Host shield

*Supported boards include:

Google ADK boardFreeduino ADK board Seeed Studio ADK board, and DIY Drones ADK board

 

Assembly

Connect the two LEDs to digital output pins 3 and 4, using a 330 ohm resistor for each in series to limit current. Connect the signal line of the servo to pin 5.  Other pins can be used, as long as the servo signal line is capable of PWM (usually has a ~ symbol next to it on the Arduino board) and none interfere with the SPI lines connecting to the USB Host (10 -14 on most).  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 official 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

Finally, install the Android Demo application onto the device. You can either download the pre-built .apkor checkout the source from Github:

git clone git://github.com/mitchtech/android_adb_andy_android.git

Finally upload the app to the device (or browse to this page on the device and download the apk above). Connect the Android device to the USB Host board/shield, and start up the app.

 

Android + Arduino + USB Host + Combination Lock

A simple combination lock with Android and Arduino.  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:

Simple Digital Input
Simple Digital Output
Simple Analog Input
Simple Analog Output

 

Hardware

Parts needed:

  • Android Device (1.6+)
  • Hobby servo
  • Breadboard
  • Power supply
  • Hook-up wire
  • Android ADK Board*
  • – OR –
  • Arduino compatible and USB Host shield

*Supported boards include:

Google ADK boardFreeduino ADK board Seeed Studio ADK board, and DIY Drones ADK board

 

Assembly

Simply connect the black line to ground, the red line to +5v, and the yellow signal line to Arduino pin 5 (or other PWM capable pin, usually marked with a ~ symbol). 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 official 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

Finally, install the Android Demo application onto the device. You can either download the pre-built .apkor checkout the source from Github:

git clone git://github.com/mitchtech/android_adb_combination_lock.git

Finally upload the app to the device (or browse to this page on the device and download the apk above). Connect the Android device to the USB Host board/shield, and start up the app.

 

Android + Arduino + USB Host + D-Pad

A simple controller for use as an Android directional pad input accessory.  The Arduino based device uses four momentary push buttons to sense digital inputs for up, down, left, and right.

For additional background information on interfacing Android with the real world, check out my other introductory tutorials:

Simple Digital Input
Simple Digital Output
Simple Analog Input
Simple Analog Output

 

Hardware

Parts needed:

  • Android Device (1.6+)
  • 4x Push buttons
  • Breadboard
  • Power supply
  • Hook-up wire
  • Android ADK Board*
  • – OR –
  • Arduino compatible and USB Host shield

*Supported boards include:

Google ADK boardFreeduino ADK board Seeed Studio ADK board, and DIY Drones ADK board

 

Assembly

Connect one side of each button to ground and the other side to the desired digital input pins. 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 official 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

Finally, 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_d_pad.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.