If you watch a lot of movies on your PC or media center, I’m sure you’ve run into a lighting dilemma; Do you turn off all lights completely? Are you running them at full capacity? Or are you using a dimmer to keep a dull yellow glow somewhere? Well, don’t worry anymore.
For less than $100, you can install an amazing lighting system that reflects what’s on the screen; if the video is a blue night scene, the light will be blue; when the flame of orange fire flares up, so will your fires. Welcome to the world of RGB lighting.
- The RGB light bar is a 5m strip of RGB LEDs that can be bought on eBay and shipped from Hong Kong for less than £20 each. If you buy from electronics stores, you will be charged by the meter and the cost of a 5m coil will be three to four times more, so buy online. These types of LED strips can be changed to any color, but only all at once — they cannot be customized individually.
- 12V power supply — the required power (amps) depends on how many LED strips you will connect. Each meter draws approximately 0.6A, but this depends on the density of your LEDs, so be sure to check your specific LED strip. 3A will be enough for the 5m strip I connected above and separate power supplies can be bought for around £10 if you can’t find them elsewhere.
- 3 x MOSFETs N transistors — you can probably find cheaper, but I bought a pack of 6 (type STP16NF06FP) for about £10. They are used to isolate current from the Arduino — connecting the strips directly to the Arduino will fry it with the amount of current they draw. You need 1 MOSFET for each color LED channel, for red, green and blue.
- Arduino — I have not included the cost of this item as it is assumed you already have it and there are plenty of clones you can buy if you can’t afford the official one.
The total cost was about £40, not including Arduino.
The project consists of two parts. First, we will create a basic Arduino circuit that listens for commands from the computer and sets the RGB LEDs to the appropriate color. The second involves using a new application called Processing and Java on the computer side to find out what colors are currently displayed on the screen, average them and output to the serial communication port so that the Arduino reacts to them.
Part 1: Schematic and Arduino
The circuit we are using is very simple as you can see in the diagram below. The LED strip should come with a plug on one end that you can place directly into the breadboard.
Your LED strip may be different, but if you look closely, you will see somewhere 12v, R, G, B on rails. These strips can be cut into these copper points (every 3 LEDs on the ones I have) so if you want to cut the strips at the corners of the TV you can do it safely — you don’t have to use the whole 5 meters either so u you may have something left for a future project. Connect the positive 12V directly to an external power supply.
MOSFETs have three pins; gates , stock and source . The gate is like an electronic switch that the Arduino will control. It then determines the current flowing between source and drain. The drain of each MOSFET must be connected to Arduino ground and power supply ground while the source is connected to the LED strip channels.
When you’re done with the circuit, download and run this test code (originally by LadyAda, modified contacts). You should see swirling LED strips in different colors.