Latest Upload :

Beginning Android ADK with Arduino

Beginning Android ADK with Arduino


 

Introduction

In May 2011, Google held its annual developer conference, the Google IO, to present its newest
technologies to approximately 5,000 attendees. In addition to improvements in its already well-known
technologies such as the Google APIs or the core  search technology, Google placed the focus on two
major themes: Chrome and Android. As always, the newest advances in the Android Platform were
presented and discussed, but what Google announced  a bit later in the Android keynote was a bit of a
surprise: Google’s first standard for Android devi ces to communicate with external hardware. The
Android Open Accessory Standard and the Accessory Development Kit (ADK) will be the key for
communicating with hardware and building external  accessories for Android devices. To encourage
development, Google handed out ADK hardware packages to interested attendees and showed some
examples of ADK projects, such as a treadmill which  transmitted data to a connected Android device and
a huge tilt labyrinth, which could be controlled with an Android device. Shortly after the event, the first
DIY projects surfaced which already showed the great potential of the ADK.
Since I couldn’t attend the event, I had no chance to get my hands on one of those kits; at the time,
there was only one distributor for the Google ADK boar ds and this distributor wasn’t prepared for such a
big demand. That didn’t stop me from building an alternative myself and from experiencing the joy of
this new field in Android development. Over time, many more distributors have produced derivatives of
the original Google ADK boards, which are, for the mo st part, cheaper and only provide the basics to get
you started hacking your project together.
You probably just want to dive right in, but first you should learn about the specifics of the ADK and
set up your development environment. You wouldn’t build a house before you knew how to do it or
without having the proper tools, would you?
What Is the ADK?
The Accessory Development Kit (ADK) is basically a micro-controller development board that adheres to
the simple Open Accessory Standard Protocol created by Google as a reference implementation.
Although that could be any board fulfilling the specification to be ADK compatible, most boards are
based on the Arduino design, which is an open hardware platform created in 2005. Those boards are
USB-enabled micro-controller boards based on the Arduino Mega2560 and the implementation of the
Circuits@Home USB Host Shield. However, there are other board designs known to be ADK compatible,
such as PIC-based boards or even plain USB host chip boards such as the VNCII by FTDI. Google
decided to build its reference kit upon the Arduino Mega2560 design and provided the software and
hardware resources as open source. This was a cl ever move because the Arduino community has grown
tremendously over the last years, enabling designers, hobbyists, and average  Joes to easily make their
ideas come to life. With the ever-growing communities of both factions of Android and Arduino
enthusiasts, the ADK had a pretty good start.
To communicate with the hardware boards, an An droid-enabled device needs to fulfill certain
criteria. With Android Hone ycomb version 3.1 and backported version 2.3.4, the necessary software APIs
were introduced. However, the devices also have to ship with a suitable USB driver. This driver enables
general USB functionality but, in particular, it  enables the so-called accessory mode. The accessory
mode allows an Android device that has no USB host capabilities to communicate with external
hardware, which in turn acts as the USB host part.
The specification of the Open Acce ssory Standard stipulates that the USB host has to provide power
for the USB bus and can enumerate connected devices. The external device has to provide 500mA at 5V
for charging purposes of the Android device  according to the USB 2.0 specification.
The ADK also provides firmware for the development board which comes in the form of a set of
source code files, libraries, and a  demokit sketch , which is the Arduino term fo r a project or source code
file. The firmware cares about the enumeration of th e USB bus and finding a connected device that is
accessory mode–compatible.
Google also provides an example app for the Android device that easily accesses and demonstrates
the capabilities of the reference board and its sensors and actuators. If you are working with a derivative
board that doesn’t have the same variety of sensors, you still can work with the example app, but you
might want to strip the code down to only the basic part of the communication.
When you set up an ADK hardware pr oject you are building a so-called Android accessory . Your
hardware project is an accessory fo r the Android device such as, for example, a keyboard would be for a
PC, with the difference being that your accessory provides the power for the whole system. Accessories
need to support the already mentioned power supply for the device and they must adhere to the Android
accessory protocol. The protocol dictates that the accessory follows four basic steps to establish a
communication to the Android device:
1.   The accessory is in wait state and tries to detect any connected devices.
2.   The accessory checks for accessory mode support of the device.
3.   The accessory tries to set the device in accessory mode if it is necessary.
4.   If the device supports the Android accessory protocol, the accessory
establishes the communication.
If you want to learn more about the ADK and the Open Accessory Standard have a look at the
Android developer pages at http://developer.android.com/guide/topics/usb/adk.html.
Hardware Development Boards
This section will give you an overview of the variety of ADK-compatible development boards that are
currently on the market. Note that I can’t guarantee the completeness of this list because the community
advances at such a pace that new boards could pop up at any time. I will concentrate on the most
popular boards out there as of this writing.

DOWNLOAD

Share this article :

Enregistrer un commentaire

 
Support :