Wiring and Android using ADB (Android Debug Bridge)

From Wiring

Jump to: navigation, search

by Carlos Mario Rodríguez

This tutorial is based on this Arduino ADB tutorial by the Media Lab Helsinki and the library is a modification of the MicroBridge Arduino library.

This tutorial introduces the basic interfacing between the Wiring hardware and an Android Device using the ADB (Android Debug Bridge). The brief for the tutorial will be to send data from the Wiring board to the Android device and to read data from the Android device to the Wiring board. The Wiring board will read analog data from a photoresistor sensor and send it to the Android device, this value will be visualized on the screen device. Additionally, the Android device will sense the X axis position of the pointer and send this value to the Wiring board to control a LED brightness. It assumes the Wiring software and Processing 2.0 pre-release are installed and the proper Wiring setup has been previously completed. For more Information on Wiring install check out the tutorials about Wiring installation and software setup.


Hardware requirements

Software requirements

Install Android SDK
  • Download Android SDK. It is recommended to save it to Documents folder.
  • Open “android” file under “tools” folder. It lauches Terminal and Android SDK Manager.
  • Underneath “Tools”, check the box for “Android SDK Platform-tools”.
  • Select Android 2.2 (API 8) and install. This takes some minutes.
  • For Windows, you need also install the Google USB Driver Package under “Extras”.
Setup on Android device
  • Turn “USB Debugging” on your Android device. Settings application > Applications > Development
  • Connect the Android device to your PC using a USB cable. You don’t need to turn on USB storage.
Install Processing 2.0
  • Download the latest 2.0 alpha release of Processing from the following URL. Processing Download
  • Open of the Processing application
  • Switch from Standard mode to Android mode by clicking on the upper right corner.
  • Processing ask you to locate the Android-sdk-macosx folder.
  • UI theme should change from blue to green.
  • Type the following example Processing code
void setup () {
void draw () {
   line(0,0, 100, 200);
  • Run on device. Go to Sketch > Run on device
  • The device shows the Processing application that shows a line from the top left corner on a white background.
Install ADB library to Arduino IDE software
  • Download the library here. Place the folder in the Libraries folder inside the Wiring folder.

Assemble electronic to The Wiring board

  • Assemble ambient light sensor and LED. Schematics plans are here and here.
  • Please remember Sparkfun USB Host shield takes digital pin from D7 to D13 on the standard Arduino board. You can connect sensors and actuators only from all analog pins (A0 to A5) and digital pins from 2 to 6.
  • Make sure the dip switch on the USB hostshield is on. It is by the USB plug.

NOTE: To complete the needed charge for the USB host Shield you need to connect the VIN pin to the 5V pin.

Processing Code

  • Download the Android Processing project files. here
  • Go to Menu > Sketch Permission
  • Check Internet in the Android Permission Selector

Wiring Code

  • Download the Wiring project files. here
  • Remember to select Tool>Boards> Wiring S with Play Shield @ 16 MHz before upload the sketch to the board
  • Connect the device to the USB host Shield
Personal tools