I’ve came across this interesting thread on Arduino forum about using IKEA DIODER and other RGB LED strips to build mood/ambient light. This allows you to create the same effect that you can now find on some TVs. I thought it would be a fun little project to do, and here is a short clip to show you the result:
In case you would like to build it yourself here is how I did it.
The Hardware
To get multicolor LEDs some people are hacking IKEA DIODERs but it’s quite expensive, so I followed the advice found here and ordered two RGB Multicolored 1-Meter LED strips from DealExtreme. Those are flexible plastics strips with 30 multicolor LEDs on each (you can also get it as a bar). It has 4 wires with +12V common anode and separate cathodes for RGB channels.
To control the lights I adopted the circuit shown in Markus post. I put it together on Adafruit’s Proto Shield for Arduino (which is nice because it had the IC pattern for the chip).
Instead of multiple transistors this circuit uses the ULN2003 chip, so that each PWM pin from Arduino is connected to one side of the chip and the RGB channels from LEDs are connected to the other side. Because LEDs require 12V voltage there is a separate power connector (Arduino is still powered from USB). Since I had only a 16V power supply I’m also using a 12V voltage regulator. Next to it I have a push switch to turn the LEDs on/off quickly. The 10K potentiometer on the other side is used to select color hue for one of the manual modes. One push button is wired to Arduino reset pin, and the other is used to switch modes.
I know it could be made prettier but I yet have to learn how to design and produce a custom PCB (please contact me if you’d like to help). If you don’t want to solder this yourself here are some other alternatives that you might consider:
For initial testing I used the Arduino sketch written by Markus. It has three modes: specific color selected by a potentiometer, pulsate the specified color, and smooth transition between random colors. You can find more details in his post.
The Software
Of course it would be hard to get ambient light working for every video source you feed to your TV, but its lot easier to do it when signal is going through a PC. This summer I build a new HTPC based on a Zotac ION-ITX board (cause its super small and quiet). Recently I ditched Windows 7 Media Center in favor of open source XBMC, mostly to get hardware accelerated VDAUP playback. Here are the steps to run it on a minimal Ubuntu install (but I admit I took me three days to figure out how to do it properly).
Apart from the video player we also need additional piece of software that will constantly sample the image visible on screen and produce average color for each LED strip. Thankfully there are existing programs that can do this for us. One of them is called Boblight and turns out to work quite well both in Windows and Linux (but again you get a little speed boost on the later).
In essence Boblight runs in backgrounds, accepts color input from clients and converts them to commands that it sends to the devices. I have to say I was pleasantly surprised to see how flexible it is, and how easy it was to configure it for my setup. You can find more details on the configuration on this page, and my config file is included in the download below.
The final piece is the code running on the Arduino that will translate these commands to corresponding light levels for each channel. Boblight uses a simple serial protocol called LTBL (Let There Be Light) that is described here. In the download you will find my sketch that handles this communication.
Currently I have Boblight setup to automatically start before XBMC loads so it will turn on the lights on startup (some advice can be found here). This setup serves me well, but as I said Boblight runs Windows too. And you can also try other software like Momolight, AtmoLight, VLC Media Player, and other projects found at Ambilight4PC.