This is the first post in a serie describing how to get started with the Google ADK using an Arduino UNO and the Circuits@Home USB host shield. The title of the post actually lies a bit, because we will not use niether the ADK board nor the ADK software provided by Google, since the ADK software only works on a ADK compatible board and not the UNO. I will go into more detail below.
The Google ADK
The Google ADK is a USB Accessory development kit based on the Arduino Mega2560 and the Circuits@Home USB shield. It contains the hardware designs for the board, including an optional demo shield that affixes atop the main board and implements stuff like a small joystick, different LEDs and more. It also includes firmware libraries for both the USB host logic and the Android device interaction. Finally, it includes example firmware for the main board and demo shield as well as an example application for the Android device.
Even though the price of an ADK compatible board is coming down as more manufacturers are producing them (a small list of manufactureres can be found on the Google ADK page), it is still somewhat costly and if you already own an Arduino UNO it might feel a bit unecessary to buy a completely new board. Actually, all you need to create a similiar setup is an USB Host Shield with an Android Accessory compatible library.
Replacing the ADK board with Arduino UNO and USB Shield
Since the ADK is based on the AVR ATMega2560 combined with an USB Host shield, a separate USB Host Shield for the Arduino UNO is needed. The one used in this post is created by the same developer which inspired Googles ADK design. A firmware library (Circuits@Home USB Host Shield library) with support for Android devices is provided.
Listed below is the hardware required for our little demo application:
- An Arduino UNO.
- An USB Host Shield 2.0 from Circuits@Home.
- An Android phone/tablet with minimum version 2.3.4.
- Optional: A LED to switch on and off from the Android device.
And below is the required software. We will use Eclipse for building the Android application, and make for building and uploading the Arduino firmware.
- The standard Arduino setup as described in earlier post: Arduino using make. You are, of course, free to use the IDE of your own choice, like the standard Arduino IDE or Eclipse instead. Note that Eclipse will be used for building the Android software in any case.
- The USB Host Shield 2.0 library for the USB Host Shield 2.0.
- The Google SDK (and its requirements).
- The Google APIs Add-On library for Eclipse. Use API level 10 or higher.
Jumping to the gun
To get something up and running fast, clone the git repository and setup the Android project in Eclipse. You will need the Eclipse with the Google SDK as well as the Google APIs Add-On library for the project to build. Follow the guide on http://developer.android.com/sdk/installing.html if you don’t have the Android environment setup already.
git clone git://github.com/joekickass/Arduino-Uno-Android-Accessory.git
Base the Android project on the manifest located in the
java directory. Note that the application has no launcher, i.e. it will not show up in the app tray. When the project is building without error, you’re ready to go into more detail in Step II.
Here are all posts in the series:
This Post Has 3 Comments
Pingback: itemprop="name">Arduino UNO and the Google ADK – part II | Jayway Team Blog - Sharing Experience
Thank you a million times! It’s been way to hard to find a FULL example using the Arduino Host Shield 2.0 + Android ADK.
The Host Shield 2.0 source has examples with the arduino code but completely skimp on the android app.
Should do a pull request to their source with this =)
You’re welcome. Don’t know about a pull request though, the code is quite old and in need of a cleanup. But if you improve the code you are more than welcome to do a pull request yourself.