Project 7: Dynamic Ambient Lighting for TV/Monitor

Lightpack lead

This idea has been floating around for a while. It’s a very cool way to increase the immersive experience of playing games or watching movies. It’s based on using RGB LEDs on the back of the monitor to light up the wall behind it with colors similar to the content of the screen. Since you’re eyes are focused on the screen, areas beyond the edges are seen with your peripheral vision. Using dynamic lighting behind the screen, the effective area of the screen is expanded.

When I first saw this the method of achieving it was rather resource heavy. The RGB LEDs and the controller were expensive and there was no simple software to run it. To grab color data from the screen some people were even using VGA/DVI adapters to backward process what was being displayed. Additionally strips came in two kinds: addressable and non-addressable, meaning each LED could be addressed for RGB value or the whole strip would be the same color. Controlling this meant that either I would need to figure out the modulation pattern of whatever addressable strip I buy (at the time I wasn’t very experienced with this and didn’t understand the datasheets) or I would need a controller with multiple PWM I/Os to send to multiple short segments of non-addressable strips.

Recently however, I was hired to work on building RGB LED matrix displays. From that project I was able to salvage some leftover WS2811 strips. These strips are rather special since each LED pad contains an R, G, and B diode, plus a WS2811 chip. The chip is designed for controlling a lot of RGB LEDs (up to 4000) with a single microcontroller. This is achieved by sending a high frequency PWM modulated data stream down a single data line along an entire strip. The data stream addresses each LED pad and provides 4 bytes of data, 3 for each value of r, g and b and one for brightness. This makes the strip very versatile and easy to manipulate since the libraries already exist and all I need to do is program an array of data that gets sent to the strip.

To understand this I have been playing with the strip for a while using my MSP430 Launchpad to control it. The 43oh forums have been very helpful to get the appropriate libraries and code to start working with it. Example code can be found here: http://forum.43oh.com/topic/2852-ws2811-led-controller-driver/

Once I understood how to send data to the strip, the project turned toward grabbing data from the source and transmitting it to the microcontroller

On the software side I did a lot of research to find a simple way to achieve this. I ended up finding this project which was doing something very similar with a non-addressable RGB strip. http://siliconrepublic.blogspot.ca/2011/02/arduino-based-pc-ambient-lighting.html

Here they’re using Processing, a Java based IDE to take screenshots and analyze the average color of the screen. I took this and modified it to produce multiple regions to analyze instead of just one. To optimize the usage of the strip I needed to assign  a certain number of LEDs per region that was proportional to the area it was reading. Ideally I wanted to minimize the number of cuts I would need to make in the strip.

ADLDistributionWith my 1920*1200 resolution screen and a 60 LED strip I divided it accordingly. Alternatively I could have made it 6 regions of 6 at the top and each side would have 2 regions of 6, but the dimensions of the monitor only allows less than 34 LEDs in the horizontal axis without cutting it. Similarly in the vertical axis I can only put around 20 LEDs without cutting the strip.

Next post: Transmitting Data Serially and Putting It All Together (coming soon)

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>