Ambilight Clone

Ambilight “ generates light effects around the TV that correspond to the video content”. It was developed by Phillips around 2002. Simply put, the system takes the colours at the edge of the TV screen, and re-projects the colours on the wall behind.

Ambilight-3

 (not my TV/picture)

Previously I had found that watching television in a dark room could cause some eye strain due to the contrast between the bright television and the almost black wall behind it. My first solution to this was to place a desk lamp behind the TV, pointing at the wall behind it. This improved the eye strain, but wasn’t always best suited to the content being displayed on the TV. First, it was at a constant brightness. While the TV may have been displaying a very dark scene the back lighting would drown out the image. Secondly, it was a fixed warm-white colour, which didn’t really match what was playing unless the program was set outside in the daytime with good weather .

As a solution to this, I decided to build an Ambilight clone. This allows the back-lighting to match the content displayed on the TV in both colour and brightness, reducing eye strain and improving immersion (at least, that is what I hoped). As the majority of the content I play on the TV comes from my MythTV frontend and intercepting and decoding a HDMI signal is non-trivial, I decided to look for a method that would allow me to grab the framebuffer from the frontend and send data from that to the LED lights.

 

Hardware

The hardware requirements for the system I built are relatively modest. Due to the ease of setup/lack of wiring required, I decided to use a WS2801-based LED strip, which allows the colour of each RGB LED in the strip to be independently set using only two wires from an arduino. The strips I went with were these:

 

(available from here in the US)

I ordered two strips (2m, 64 RGB LED clusters), which came with enough connectors to join them together and to wire up to the Arduino / power without any soldering required. 2m is about the perfect length to cover the sides and top of  a 42″ TV, and 64 RGB LEDs is starting to approach the limit for how quickly you can pipe data to the Arduino @ 60 fps. These strips can be cut every 10cm or so to allow for smaller dimensions, although this requires some soldering ability, a sharp knife and some extra wiring and/or connectors.

I used an Arduino I had lying around to drive the LEDs. It was an ATmega328p-based  Duemilanove . An Arduino like this would be the ‘modern’ equivalent.

The LED strips I used required about 1.8A/m @ 5V (so 3.6A total). I ordered this power supply to power the LED strips (the Arduino pulls power from the USB connection).

 

Putting it together

  1. Attaching the strips to the TV. I found that for my size of TV (42″), 2m of LED strips almost exactly fills 3 sides of the screen (I didn’t place any LEDs along the bottom because they would be hidden by the stand). Luckily, the strips are flexible enough that I could bend them through 90° so that each strip covers one side and half of the top of the screen. Make note of the direction of the arrows on the strip, and place the start of the arrow closest to where the Arduino will be placed. The strips do have a sticky backing, but I decided not to use this and use sellotape instead, to allow for easier repositioning of the strips if required.

  2. Connecting the strips to the Arduino. As the power for the strips is coming from a different source than the power to the Arduino, I connected the ground (black) wire from the 4-pin connector on the strip to the ground on the Arduino to tie the two together. I attached the red lead from the cable to pin 2 of the Arduino, and the green lead to pin 4. I did not connect the +5v (blue) wire to anything.

  3. Power to the strip. This is done via the 2-pin connector. You can safely power 2m of strips without having to re-inject power at the start of the second strip, but it may be necessary to investigate more power wiring for longer strips.

  4. Connect the Arduino to the MythTV frontend via USB.

The total cost of these components was somewhere in the region of £120 (not including delivery). I did by some crimps/longer wiring in anticipation of having to splice strips together and make my own cables, but a couple of spare connectors were provided in the box which were all I needed to connect everything together.

A word of warningthe PSU I chose doesn’t guard the live mains power connections particularly well. While it shouldn’t be possible to give yourself an electric shock without a small amount of fiddling/poking (there is a plastic cover over the mains wire connection), it would be advisable to find an alternative housing for the project if there is any chance of pets/children getting anywhere near it. Any suggestions for a project housing which would require minimal/no cutting or drilling would be appreciated.

Software

Written up here

The finished product

I have an early video of my Ambilight clone, just after it was initially set up. At this stage there was a bug in the setup which meant there was a lag in updating the RGB lights. I also hadn’t finished implementing all of the modes in my boblight client, and the saturation / brightness were set higher than I have them today. Another thing to note is that cameras do not cope well with the dynamic range required of them to take video of bright LEDs in a dark room; the lighting is more subtle in-person.

9 Responses to “Ambilight Clone”


Leave a Reply