How Android communicates with external hardware — Beginning Android ADK with Arduino

Scout24
Scout24 Engineering
4 min readAug 20, 2012

written by Sascha Boerger

Developing for the Android operating system isn’t always restricted to developing software which runs on the device itself. Android apps are great when it comes to providing certain functionality for the user by utilizing the device’s hardware features, like for example the built-in camera for photo applications, the GPS sensor for map applications or the accelerometer sensor for gaming.
However there is only so much a device can do and not all devices are packed with a broad array of sensors or actuators.

In May 2011 Google held its annual developer conference, the Google IO. Google presented a framework and communication protocol to simplify the communication between Android devices and external hardware. To kickstart the development of external accessories, Google decided to build a reference hardware board which should be easily programmable and extendable. They open sourced not only the software libraries of the framework but also their reference designs of a hardware development board. They chose to build their reference design upon the Arduino board which was well known in the hobby electronics and interactive design scene. The decision to build upon the Arduino community guaranteed for an audience of everyday programmers, hobbyists and makers instead of traditionally large hardware manufacturers with closed development processes.

The Android Open Accessory Standard and the Android Accessory Development Kit (ADK) were born. The Android and Arduino communities themselves were relatively large but there weren’t many tutorials yet, other than the Google documentation, on how to combine both technologies. To further fuel the interest in the ADK, Google started the ADK challenge to showcase selected Android hardware projects. The selected projects used the ADK to create a broad range of hardware devices from soda can dispensers to robots to musical instruments. The showcasing of the projects took place at the Google Developer Days (GDD) conference which was held in 8 major cities around the world.

I also registered a project for the challenge and qualified to showcase it at the GDD in Berlin. The project was called ADK Paper Piano. It was a 64 key piano with its keys being made out of paper and aluminum foil. The principle of operation was capacitive touch and an ADK board connected to the keys communicated with an Android device which played back the sound of a touched key. So with a very low budget I created a low tech capacitive touch keyboard as an Android accessory.
For more information about the ADK Paper Piano you can visit my Blog.

While I experimented with and blogged about my projects and the ADK, I got the opportunity to publish a whole lot more than only some blog posts. The US tech-book publisher Apress contacted me and asked if I would be willing to write a book about the Android ADK. After some great support from fellow colleagues and ImmobilienScout24 allowing me to reduce my work hours, I took the opportunity and wrote the book “Beginning Android ADK with Arduino”.

The book was released in march 2012 and it will give you a great start so that you can experiment with Android and Arduino on your own electronics projects.

Table of Contents

  1. Introduction
  2. Android and Arduino: Getting to Know Each Other
  3. Outputs
  4. Inputs
  5. Sounds
  6. Light Intensity Sensing
  7. Temperature Sensing
  8. A Sense of Touch
  9. Making Things Move
  10. Alarm System

You will learn how to connect different kind of sensors and actuators to your projects and how you can communicate with them using your Android device.

All in all the ADK is a way to let your Android device communicate with external Hardware by following a predefined communication initiation protocol and by sending data in a self defined byte data message.

You can buy the book at any book store or in online stores such as Amazon.

Though Google didn’t provide much new information about the ADK throughout the year, they still worked on the ADK in secret and surprised attendees and followers of this years Google IO with a ground up new ADK, the ADK 2012.

The ADK 2012 was presented as an actual finished product instead of just a development board like the first version was. It was developed as a fully functional alarm clock with a whole lot of integrated sensors.

Nevertheless it was designed to be hacked and now it is the community’s turn to show what’s possible.

I hope I could excite some of you readers enough to explore the maker within themselves and give the ADK a try as well. I promise you, once you see your project working it feels truly awesome.

-Mario Böhmer

--

--

Scout24
Scout24 Engineering

With our digital marketplace @ImmobilienScout, we inspire people's best decisions in housing. We make hard decisions easy. https://www.scout24.com