topamax once a day

Android + Arduino + USB Host + Simple Digital Input

Simplest possible digital input with the ADK.  This article will discuss the bare minimal requirements for development of a basic USB digital input accessory.  The goal is to demonstrate the easiest possible use of the technology.  For additional background information on Android development, Arduino, and MicroBridge, check out these links:

Android Developer’s Guide
Getting Started with Arduino


Getting Started

First, make sure you have setup the development environments for Arduino and Android:

Arduino IDE
Android SDK



Parts needed:

  • Android Device (1.6+)
  • 2x Push button
  • 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



Connect one side of each button to ground and the other side to digital pins 2 and 3 respectively.  Here is a diagram of the completed circuit (created with Fritzing):



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://

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.

  • Pingback: Android + Arduino + USB Host + Serial 4 digit LED | MitchTech()

  • i did like the above but i get
    Error: OSCOKIRQ failed to assert
    in the serial monitor, in some forums they say to add a suplly voltage
    so i add 7.5volt but nothing is changed
    do you know what can i do ?

    • soved the problem 🙂
      it was a bad adb library
      now it’s working even without external voltage

      • Glad to hear you figured it out!

      • nami

        how did you solved the issue? please send me the solution [email protected] I really really really need help! pleaseee

      • su

        i meet same problem,cen you tell me how to solve it

  • In file included from ADB_Simple_Digital_Input.pde:2:
    C:\Users\kaushal\Downloads\arduino-1.0.3-windows\arduino-1.0.3\libraries\Adb/Adb.h:20:20: error: wiring.h: No such file or directory

  • this is the error which i get while compiling in arduino … checked the library and code a lot of times. no luck :/