Tag Archives: USB Host Shield

Using standard Arduino board as Google’s ADK kit

When Google announced about the Open Accessory Development kit (ADK) in the last Google IO conference, I was really excited since it was based on Arduino boards.

But after the initial bliss went off, I was disappointed for two reasons. First you need an Android phone running Android version 2.3.4 or above. The second reason is that the original ADK kit is not compatible with the plain Arduino board. The downside of this is that all your existing Arduino Shields will not work with that board and not to mention you have to buy a rather expensive ADK kit. Now there is also an Arduino compatible ADK kit, but it is again expensive and it didn’t made sense for me to buy another Arduino board when I already had a bunch of them lying around.

Since it is based on Oleg’s USB Host Shield, I was trying to see if I can build a board with just plain Arduino board and Oleg’s USB Host Shield. It turns out it is possible and with the release of Oleg’s second version of the USB Host Library, it is much simpler.

Things you need

Any Arduino board.

You can use either UNO or Duemilanove. You can also use Arduino Mega, if you have one lying around. The advantage of using Mega is that you will have additional I/O pins.

USB Host Shield

You need a USB Host shield for Arduino. You can use the original shield by Oleg for $40, or you can buy a cheaper clone from sparkfun for $25. I recommend the original one by Oleg, since it doesn’t need an external power supply. If you are going to use Sparkfun’s version you need an external power supply. Also make sure you don’t buy the older version of Sparkfun shield. It has pins marked wrongly and you need to make changes to the library to make it work.

ADK compatible Android phone

You need an Android Phone which is ADK compatible, which means you need a phone which is running 2.3.4 or above. I tested this setup in Nexus S and it is working properly.

Sensors, LED’s, buttons

You would need additional sensors, LEDs or buttons to test the flow. To start with, you can just use some LED’s

Connections

Stack the USB Host shield on top of the Arduino board. Connect an LED on pin number 3. Connect your phone’s cable to the USB port of the shield.

Arduino Firmware

Download v2 of the USB Host Shield Library and place it in the library folder of your Arduino setup. Open the demokit_20 example sketch from the /examples folder and upload it to your Arduino board.

Android App

The Android demo app for ADK, can be found under the /app folder of the ADK package. Upload the app to your Android phone.

Testing it

Power on Arduino and connect your Android phone to the other side of the cable. You should see a dialog box, which asks you whether you want to launch the app. Click yes. Once the app is launched you can control the LED connected on pin 3, by moving the slider in the Android app.

Now enjoy your new cheaper ADK kit 😉

Posted in Android/Java, Arduino | Tagged , , , | 22 Comments