Project: LightPanel
Introduction
The availability of low-cost microcontrollers capable of easily generating several pulse-width modulated signals and RGB LEDs have spawned all kinds of commercial products and hobby projects that glow in different colors. The lighting section at IKEA features several LED-based color-changing lights. You can even find air fresheners that contain basic color-changing LED circuits now.
Despite the fact that the idea is pretty common, it's still neat to have several RGB lights under computer control, and there's a lot of room for creativity in the implementation. My friend, Andrew Karpenko, requested my help designing and building individual 1x1-foot pixels that could be networked together on a bus and controlled from a computer. This project is the result.
Specifications
- Enclosures: 12"x12"x2", sides and back constructed from foamcore with white acrylic fronts
- Microcontroller: ATtiny25 on individual panels, ATmega168 on the master controller
- LEDs: T1-3/4 RGB superbright common anode LEDs, sourced from eBay
- Communication interface: I2C (using the Universal Serial Interface on the ATtiny25)
Hardware
The hardware inside of each panel is designed to be low-cost and easy to assemble in order to facilitate building them in quantity. The board is a custom design. It includes an ATtiny25 microcontroller (SOIC-8) which provides the I2C communications interface and generates the PWM signals to drive the LEDs. Bipolar NPN transistors in SOT-23 packages switch the LEDs on and off, and each channel on each LED has its own 0603 current-limiting resistor.

LightPanel boards, sans LEDs.
Each board has connectors on all four edges that carry power and I2C, allowing the panels to be daisy-chained together. The practical limits to the number of panels that can be strung together are the power cable resistance (each board draws about a quarter of an amp at full brightness) and the capacitance of the I2C bus.
Control Interface
The array of panels is currently controlled from a breadboard with a USB-to-serial interface and an ATmega168 microcontroller. Eventually, the controller will be replaced by dedicated hardware with an 802.15.4 radio for wireless control. This will allow the panels to be placed away from a computer. It will also be possible to split a large array of panels across multiple controllers, reducing the length of the I2C busses for more reliability and higher speed.
A custom, portable C library is used to communicate with the controller, providing high-level control of individual nodes or the bus as a whole. The controller hardware also contains a "screensaver" mode that generates various effects while not under computer control.
Videos
This first video shows a simple test program driving the panels. It turns them all on, then all off, in sequence. Each panel is configured to change colors somewhat gradually so that they are not just blinking on and off.
The power wiring in this setup is a little bit inadequate; you can see the panels flickering just a little bit due to the high resistance of the power cables and not enough capacitance on the boards to deal with the variable PWM load.
Test program running on the panels.
The next two videos show a VU-meter program running on the panels. It's implemented as an iTunes visualization plugin that doesn't display anything on the computer screen, but instead communicates with the panel controller over USB to switch the panels on and off. Remember that the panels are 1 foot square, so this VU meter is over 10 feet long!
VU meter running on the panels.
Since the panels are RGB, the meter can use any arbitrary color set. It could even change depending on the music. Here's an example of it running with blue, cyan, and white instead of red, yellow and green. This video also shows what the panels look like in daylight.
VU meter running on the panels.
Conclusion
While not groundbreaking, this has been a fun project. I've more or less wrapped up my end of the development and have turned things over to Andrew, who now has the panels installed in his living room. We're still working on debugging a few remaining issues and making the power wiring more robust, but for the most part, the panel hardware is complete. The next step will be to implement the wireless control functionality.