Control BlinkM RGB LED's from a web application

Would you like to create your own little LED light show? This post describes the materials and software required to control the color of multiple RGB LED's from a web application. A video demonstration is also included, showing the use of an Apple iPod Touch to control the LED's.

Video demonstration with iPod Touch

Below is a short video demonstrating the features of the project. The RGB color picker web application is running on an iPod Touch.

Here is a view of the web application's user interface:

web application

Below are some required materials to set up this project, along with a description of some of the challenges encountered:

Microcontroller: Arduino Diecimila

The Arduino Diecimila is an open-source hardware prototyping tool based on the ATmega168 processor. It contains a built-in USB port for connection to a computer. Read more about the Arduino Diecimila at Arduino.cc.

arduino microcontroller

I bought my Arduino Diecimila at Sparkfun Electronics. Arduino now has a new microcontroller available called the Duemilanove, which means 2009 in Italian, the release year for the microcontroller.

Microcontroller software: Arduino Alpha

For this project, I used Arduino version 0011 Alpha running on Windows Vista to program the microcontroller. Check out Arduino Alpha at Arduino.cc. Arduino also has versions of the software available for Linux.

arduino alpha software

RGB LED's: i2C BlinkM's by ThingM

Check out BlinkM's at ThingM.com. I used two BlinkM's for this project. The BlinkM's communicate on an i2C bus, which means you can assign each BlinkM LED a unique address and control each LED individually. There is also a global i2C address to command all BlinkM's at once. Check out the video for a demonstration. Because these LED's run on an i2C bus you can connect up to 112 BlinkM's together, resulting in a much larger light show. I bought my BlinkM's from Sparkfun Electronics.

BlinkM

Web server: Wampserver 2.0c

I use WAMPServer 2.0c to serve the web application for this project and many other projects. It is a very simple installer which adds Apache Web Server, php and MySQL to a Windows box.

Color picker control: Yahoo! YUI Library Color Picker

Good developers know that code re-use saves time, so rather than writing my own color picker, I used the Yahoo! YUI Library Color Picker control. I only had to make a few slight modifications to make the color picker work for this project, which is much better than having to write all of the code myself.

Wi-Fi connection

If you want to control your LED colors from a wirelessly connected device, run your web server on a Wi-Fi connection. With the Wi-Fi connection, you can even control the LED's from an iPod Touch or iPhone.

iPod Touch

Challenges

The most challenging aspect of this project was figuring out how to wire two BlinkM RGB LED's. To connect the two BlinkM's, I decided to use two 9-pin D-Sub connectors from Radio Shack and some spare CAT-5 cable. I had to solder the wires to the 9-pin connectors, which was challenging since I used a soldering iron only once before this project. With wiring accomplished, the rest of the project went smoothly. Once I had all materials and required software, it took about 4 hours to complete the project.

The photo below shows the two BlinkM LEDs connected with 9-pin D-sub connectors and CAT-5 cable:

BlinkM LED wiring detail

Future Microcontroller Projects

In an upcoming post, I will show you how to scroll text on an LED matrix using the Arduino microcontroller.

comments Comments
Post a comment Post a comment

securitycode