A couple of years ago I attended Google I/O where they unveiled the Accessory Development Kit (ADK), which enabled Android developers to start interacting with hardware devices such as the Arudiuno. It had been a while since I felt excited about something, and this really got my attention. Having been primarily a front-end software developer, I had never heard of the Arduino or microcontrollers before, but Christmas was about to come early. The generous people at Google gave us all Arduino ADK boards, and I couldn’t wait to get home and start learning this new world that I had never experienced before.

I started with the “Hello World” equivalent for electronics by making an LED blink. I learned how to turn a servo, made noise using a piezo, and so on. It was then time to visit Radio Shack and start experimenting with more advanced sensors like a rangefinder and infrared sensors. Arduino made these experiments easy as the sketches were readily available, and it was just a matter of plug and play.

Ultimately, my goal was to be device and platform agnostic. I didn’t want to be constrained to just Android devices, and I desperately wanted to expand my efforts to the iPhone or any other device of my choosing. Unfortunately, Apple turned down my application for the MFi licensing program, and my hopes to connect the Arduino to my iPhone via the 30 pin dock connector or Bluetooth quickly evaporated. I turned my efforts to using the ethernet and the wifi shields, but found communication via HTTP to be too limiting and underperforming. Feeling restricted, I quickly grew disenchanted and lost interest.

A lot has happened in the last couple of years, however, that has re-sparked my interest and enthusiasm. Small, faster, affordable microcomputers running embedded Linux have emerged like the BeagleBone Black (BBB). Server-side Javascript using Node.js has taken web technologies by storm, enabling devices like the BBB to seamlessly run a web server out of the box in a non-blocking I/O fashion. Open Web Standards continue to push the capabilities of HTML 5 devices, allowing mobile phones and tabletsto communicate with external accessories like the BBB without the need for proprietary technologies or licenses.

In this series of posts we are going to configure the BeagleBone Black (BBB) for Pulse Width Modulation (PWM) in order to operate a micro servo. We’ll then control the servo using an HTML5/JavaScript web client that will communicate with a Node.js WebSocket server running on the BBB. Here it is in action:

Update to the Latest Angstrom Distribution

First, make sure your BBB has the latest Angstrom distribution installed. You can find the distribution information using the following command once you ssh into the board:

1

2

root@beaglebone:~# cat /media/BEAGLEBONE/ID.txt

Cloud9 GNOME Image2013.06.20

The latest distribution at the time of this post was Cloud9 GNOME Image 2013.06.20. Here are some really excellent tutorials on updating to the latest image: