Introduction: TV Dynamic Ambient Lighting
Thanks for visiting!! This instructable will show you how to add dynamic ambient lighting to your TV. Hope you enjoy and learn something!
**The pictures i posted of the TV seem to make the LED strips not look very bright but if you watch the video http://www.youtube.com/watch?v=-g7enrY7irI you can see that the lights are actually brighter.
Step 1: List of Materials
List Of Materials:
RGB LED Strips 30 LED/meter (I used 2 meters for my 32'' TV)
TLC5940 (Provides 16 PWM Signals we will use 12)
12 volt power supply
Some wire depending on your tv size :).
Step 2: Design Layout
To start out lets see how this project will come together. The LED strips behind the tv will display the overall RGB color for a specific section of the screen designated for that LED strip. There are four LED strips in my instrutable (left, top left, top right, right). Each of the LED strips is connected to the TLC4950 and a +12v supply. The TLC4950 provides the LED strips with the PWM signal allowing us to control the brightness of the red, green, and blue. The arduino will feed data to the TLC4950 allowing for control over the LED's. The arduino is connected to a computer which will have a processing program running. The program will be processing the RGB values for each screen shot. Below is a picture of how everything is connected.
Step 3: Soldering LED Strips
I have a 32' TV each of the strips I order I cut down the middle leaving me with four strips with 15 LED's each. The strips have areas where you can see solder connections this allows you to create different sized LED strips.
We need to make solder 4 wires to each LED strip we have. The LED strips I ordered from sparkfun have a protective clear covering that allows them to be used under water. Simply use a knife and make rubber (I found it was easy to peal off once i made a small slice). I found it easiest to place a little bit of your own solder onto the stirps first before even messing with the wires, the amount of solder on the connections will not be enough. With more solder on each connection I then soldered the wires to my clumps of solder.
Here is a good tutorial that I found on soldering to these types of wires: http://www.ladyada.net/products/rgbledstrip/
Step 4: Bench Testing
The Pin connections from the arduino to the TLC5940:
Pin 2 ======= Pin 27 (VPRG)
Pin 3 ======= Pin 26 (SIN)
Pin 7 ======= Pin 25 (SCLK)
Pin 4 ======= Pin 24 (XLAT)
Pin 5 ======= Pin 23 (BLANK)
Pin 6 ======= Pin 19 (DCPRG)
Pin 8 ======= Pin 18 (GSCLK)
Other TLC5940 connections:
Pin 22 (GND) === Arduino Ground
Pin 21 (VCC) === Arduino +5 v
Pin 20 (IREF) === Arduino Ground via 2k ohm resistor
Pin 1-15,28 === PWM Output
As you can see below i have the +12 v from the power supply going to the + 12 v of the LED strips and the ground of the power supply going to the ground of the arduino. I also have the RGB of two LED strips connected to a few of the outputs of the TLC5940. Sorry about all of the red/green wires I was running low on colors :(.
Here is the data sheet for the TLC5940 http://www.ti.com/lit/ds/slvs515c/slvs515c.pdf
Thanks goes out to Peter M and his post http://pixelriot.com/pmatp/node/15. As you can see I connected to the TLC5940 the same way he did and used portions of his code.
Step 5: Physical Set Up
Here are a few examples of my temporary set up (I will return with final photos later). I just used some electrical tape for now until i get some extra time. I figure everybody's TV is a little different and there is no definite way on how to do this so do some measuring and slap those LED strips to your TV the best you can :). If you use electrical tape just be sure not to tape over an LED :).
Step 6: Processing Code
The processing code will take screen shots continuously. The program will then compute the average red, green and blue value for the left, top left, top right and right portions of the screen (0 = Min, 255 = Max). When the program calculated the values it will write the data to the correct serial connection that the arduino is connected to (May have to change the serial port the code is looking at). I added a threshold of 10% so if the value of the redTopLeft is less than 25 then I set that to zero and no red is displayed. I thought this would help display the more dominant color easily and if no colors are above the 25 then the LED strip will be turned off (it can be easily removed if you do not like it).
Step 7: Adruino Code
Here is the code that will be uploaded to the arduino. You can look at the code for the specifics (it is well commented) but basically it reads the serial data coming from the processing code and updates the TLC5940 with how bright we want the red, green or blue value to be. The TLC5940 then adjusts the PWM signal accordingly.
Step 8: Final Product!
Alas we have everything ready to go. With the Computer connected to the TV the first thing we need to do is plug the arduino into the computer and plug the power supply into the wall. Next, we can start the processing program to start taking screen shots.Then its time to kick back, relax and enjoy!
Here is a link to a video i posted of my first successful run. http://www.youtube.com/watch?v=-g7enrY7irI
Thanks for reading!