Let's Make Robots!

Android Open Accessory DIY DemoKit

At the Google I/O 2011 the new Android Open Accessory Development Kit (ADK) has been published. This allows to connect Accessorys to your Android phone and communicate between the Accessory and the Android via USB. The Accessory has to implement an USB Host, while the Android acts as a USB client.

Unfortunatey, the Accessory Mode is only supported by the newest Android Software which is v2.3.4 for mobile phones and v3.1 for tablets. So only a few existing Android mobile phones can use this new USB modes. The Nexus One and the Nexus S for example.

Lucky me, I own a Nexus One, but this had a branded Firmware from Vodafone with v2.1. So I decided to void the warranty and root the device, to get away from the branded firmware and swap to the actual Google firmware. 

The ADK page describes, what is needed, to get started with Accessory mode. The DemoKit App has been used without any modification. Instead of the Demo Kit I have build my own DIY DemoKit with an Arduino Uno, a Sparkfun USB Host shield and a selfmade IO shield.

The Sparkfun Host shield will not work with an Ardunio Mega or Mega2560 because of the different SPI pins. You can use the USB host shield from Circuits@home  instead. This will work with all Arduinos buit is more expensive (40$).

The Arduino Firmware has been ported to Arduino Uno / Mega by Romfont alias Inopia, the guy who developed the MicroBridge (Android to Arduino Bridge via ADB). Because he didn't own a Android phone with v2.3.4 he asks for help to test his firmware. The firmware works with some minor modifications and is attached to this blog entry.

 

Stackable Headerws has been used on the USB Host shield, so the IO shield can be attached above. At the moment a micro servo, a RGB LED, a Red LED (instead of a Relais) and a Sharp GP2D12  distance sensor has been succesfully tested with this DemoKit.  An external power supply is needed to power the

 

AttachmentSize
DIY-demokit.zip36.03 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Is it possible to use Android emulator and use USB + serial + serial + USB to Arduino USB host shield ? Demokit does not recognize the device connected. Any workaround? thanks

That will not work.

1. The Android emulator will not be able to emulate Accessory mode.

2. Android Accessory mode is not USB serial

 

strange but the setup works fine my android tablet pc . Don't know the force behind your confident words.

Hi, just to confirm, I have my setup with a Nexus One working fine. 

But also, I have found that I can avoid having to use large batteries to provide the 500mA charging current to the phone. 

Basically if you put a 1k resistor in series with the USB 5V supply it seems happy enough to lauch the Android app and recognise the accessory. Full details here:

http://srmonk.blogspot.com/2011/06/android-open-accessory-without-charging.html

Thats really good. I've rooted my htc evo to Android 2.3.4 but I'm still missing libraries - I get 

Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY.

Anyone had any luck? Author, any tips on updating the phone? I may have to buy a new one. Anyone recommend a cheap Android 2.3.4 phone?

I have the same problem, I'm running Samsung i9000 (Galaxy S) with android 2.3.4 official version and gave me the same error.

In the LogCat found:

 Package com.google.android.DemoKit requires unavailable shared library com.android.future.usb.accessory; failing! 

Also I verified I'm ussing Google APIs (Platform 2.3.3, API Level 10), instead of Android API.

What else could it be? what can i do?

 

I have it running on an HTC G1, the changes listed in this thread:
http://bit.ly/qwysxW (GitHub)

You must register the library at:
/etc/permissions

through XML:
android.hardware.usb.accessory.xml
http://pastebin.com/6Wr4eHds

A video demonstration:
http://bit.ly/qi32Tj

Sorry, this may be a stupid question, but can you tell me where is /etc/permissions ?

Thanks in advance!

I found that directory, but it says I need root access to put there the file. Can you guys recommend me a good way of rooting my device?

Good to know. Thank you for sharing the solution.

I found this article at Make:Online, about using ADK without a Nexus phone. Maybe this is helpful for you.

Here is a patch for enabling ADK on a HTC Wildfire. Only recommended if you are familiar with patching a linux kernel.

Do you build the example App by yourself, or did you installed a compiled .apk file?