This is a very easy project.

Here is the result

I won't go into too much detail how each part works, because I have written some information on my blog.

But you should be able to make it work with the information given on this instructable.


Step 1: Prepare RGB LED strip

The RGB LEDs came as a strip, but I want them to be separated further, so I soldered wires in between. I also use hot glue to strengthen the soldering points.

you could buy led strips that have long cables, or you can just use this out of the box, it's up to you.

I am using 25 LEDs.
<p>I know this post is a bit old but I'm trying to follow this and having some issues compiling the provided processing code.</p><p>When I try and compile the code (even bone stock) I get an error &quot;Found one too many { characters without a } to match it.&quot;<br><br>I've been looking through the code and trying to figure out where the missing bracket goes but I'm not having any luck. Is anyone / everyone else having that same problem with the source code provided?<br><br>Can anyone help debug this and shed some light on where the elusive bracket needs to go?<br><br>I tried the code provided in the comments below and it seems to work until I activate the serial port to try it with my arduino. Then the window that should show the border color launches but ends up not responding.</p>
<p>The graphical representation works fine but the Neopixel stay off. Datapin is the right one. Seems like there is something wrong with the communication :(</p>
<p>I feel as though the program processing is not working properly. Does anyone have a matter that work? I would ask that we send this file. thank you</p>
<p>I use a macbook air. I have a problem that processing does not want to run a single LEDs. I always change the port between 0 and 3, and after 10 attempts, the LED lights light up but not always. What would cause this?</p>
<p>Hello!</p><p>I have one problem. The red color is green and purple is light blue. how to fix this?</p>
<p>Just change this line:</p><p>Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_GRB + NEO_KHZ800);</p><p>for:</p><p>Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LED, PIN, NEO_RGB + NEO_KHZ800);</p>
<p>Hi everybody,<br> <br>thanks for good idea how to improve home entertainment. Everything works <br> well (for now only with 8pcs of 2812 for testing) I already ordered <br>strip with 150 pcs of these LEDs. As I know that to drive every LED <br>separatelly would take amount of PC capacity, I tried to change Arduino <br>code to send every incoming byte to 3 neighbouring LEDs. (in the <br>processing I would use just 50 rectangles) Is anybody able to check what <br> I have done wrong? I copied here only the part which I changed against original code. (With this program I can not light up more than 50 <br>LEDs. Is the limit the line with &ldquo;#define NUM_LED 50&Prime; ? When I change it <br> to 150, Arduino expect bytes for 150 LEDs and receive only 50. Thanks.</p><p>------------------------------------------------------------------------------------------------</p><p>for (int i = 0; i &lt; (3 * NUM_LED); i++) {<br> int led_index = i * 3 + 2;<br> strip.setPixelColor(i, strip.Color(led_color[led_index], led_color[led_index + 1], led_color[led_index + 2]));<br> i++;<br> strip.setPixelColor(i, strip.Color(led_color[led_index], led_color[led_index + 1], led_color[led_index + 2]));<br> i++;<br> strip.setPixelColor(i, strip.Color(led_color[led_index], led_color[led_index + 1], led_color[led_index + 2]));<br><br> } </p>
<p>I made it and it works perfectly, thanks you. But i'm thinking about using c# instead of processing for better performances. If someone already test this ..?</p>
<p>i can not figure out what i am doing wrong. i get the processing code to run and it changes colors as needed in the java window. i can also get the arduino code loaded and the ozy reply but i do not get any lights changing. all the leds just turn blue and thats it. i am running the apa104 60 led strip. if anyone can help that would be great.</p>
<p>when i look at the serial monitor it just says ozy and keeps repeating 'y'.</p>
Did you make it using the exact code here, or did you have to rewrite it?
<p>I used the code here, I just change values and 1 or 2 lines</p>
<p>Seb, Do you want to post both bits of code that you used?</p><p>I get intermittent results, some times, but have never gotten it to work properly.</p>
<p>Hi i am struggling a little with processing.</p><p>how do specify which monitor to measure ?</p><p>and how to specify what com port to use?</p><p>thanks.</p>
<p>Hi i am struggling a little with processing.</p><p>how do specify which monitor to measure ?</p><p>and how to specify what com port to use?</p><p>thanks.</p>
<p>I made this using WS2801 LEDs (pictured below) because they were much cheaper than WS2811/ WS2812, they came pre-wired (but this limits the size of your TV to around 32&quot;) and the performance is exactly the same.</p><p>The only thing that I would change in your build is the processing software. I used ambibox 2.1.4 instead of processing because it allows greater customisation and has a lot of extra features. It allows multiple profiles for different aspect ratios which is important when watching movies, it can react to sound instead of screen captures for when you're browsing the web (rather that projecting boring website colours onto your wall) plus you can change saturation and brightness which allows you to fine tune it to suit your rooms wall colour and it's much easier to use than processing!</p><p>Thanks for posting this, you inspired me to build my amblight build a few moths ago and I absolutely love it.</p>
<p>I didn't know you can get this type of LED, well done on your build! :-D</p>
<p>You can get 'xmas lights' of 50 WS2811 LEDs for about $12. Saves a lot of soldering!</p><p>I am trying to get your apps working without much luck. I'm not much of a programmer, but I can fumble through. I mapped out the LED layout in Excel but am confused about x and y numbers and 0,0.</p><p>In your code, you say you have (for 25 LEDs) 10 x 6. but for me, that makes 32 LEDs - 10 across the top, 6 on the sides x 2.</p><p>So top left is 0,0, left side is 0 column, is the top left LED counted in both top and left column?</p><p>Regardless - I can't get the two halves to fire. I am confident they are exactly as you had in your example, with the port setup for my comm port setup - I can see the oxy in the Arduino serial monitor if I use that, but the LEDs just all stay lit white. It's like it never gets past the basic initialisation.</p>
Tanks for your helpful project i realised ambilight whit 120 led and some modifications and is work perfectly tnx again
I think I understand what you are doing. You hook up your TV as a computer monitor and you execute a PROCESSING script running on the computer which monitors the edges of the video image and sends the color data to the Arduino over the serial port. The Arduino receives the color data from your computer and clocks them out to a Neopixel RBG LED strip which you have modified to fit your TV. Cool.
That's right, you are not bad! :-D
<p>Hi</p><p>GREAT JOB i like it very much, but i have a litle problem with arduino code. </p><p>When i copy/paste arduino code to arduino software, he give me this errors: </p><p>strip_1m:15: error: Adafruit_NeoPixel does not name a type</p><p>strip_1m.ino: In function void setup():</p><p>strip_1m:23: error: strip was not declared in this scope</p><p>I real like to do this project for myself, i have allready all done , only this probem is left.</p><p>Maybe please someone send me Adruino code to mai email please : tomza.kotnik@gmail.com</p><p>Thanks</p>
<p>Hi tkotnik / lacglzh,</p><p>I have the same issue with the Arduino Code. How did you solve this?</p><p>email me at kanda.az@gmail.com</p><p>Thanks in advance</p>
Hey, its a very good tutorial but I didn't understand few things <br>which type of LEDs is it? I have a RGB led strip and it looks very different, I have 4 connections, 3 for red,green,blue and one for GND, and you have only 3 <br>Please explain your self better I want to make this. <br>and How you wire this up? the picture isn't understandable. <br>Thank you, <br>Jacob.
<p>HI,</p><p>he use ws2811 chip led,</p><p>it have only 3 connections...</p>
<p>NOW ,APA102 come out ,it is new build in ,but have data ,clock ,GND 5V ,4 connection</p>
<p>it is very great ,i will build my own project ,but use apa102 apa104 led strip to replace the led pixel</p>
Ma cosa fa variare il colore e la luminosit&agrave; del led rgb? <br>Un sensore luminosit&agrave;?
<p>i have a question and someone please help me this project is what made me want an arduino but i have everything i need but what is the aux adapter that goes to the ardiuno can someone please help me </p>
<p>yes i would really like some help yes i am a noob to the arduino but what is the aux cable with the adapter for i would love to do this project but i need some help please</p>
<p>This is super cool! You should enter it in the Home Technology Contest....!!!!</p>
<p>thank you, I just did! :-D</p>
<p>no, i can't, because they said it's too old...</p>
i think this would make my head hurt!!!
<p>Hi, first thank you for sharing your project, I've made all the passage and uploaded the fix code without errors, processing works good and a appear the window with the edge color of the monitor, but the led strip do not turn on...I've checked it with some library examples ant it works good, is there any test that I can do to learn how to fix the problem? I have an arduino Mega board and a ws2811 chip led strip, really thanks! Riccardo</p>
<p>All work fine bud LED not turn ON,</p><p>I have this LED WS2812B 5050 RGB Stripe weiss mit WS2811 Chip (link: http://www.ebay.co.uk/itm/281268099789?ssPageName...</p><p>And adapter output 5V 2A...</p><p>Is this ok</p>
<p>Hello! Nice instruction! Please give link to your LED strip (your blog not opening for me :/)</p><p>ps. is it her <a href="http://www.aliexpress.com/item/11-Hot-sale-WS2801-DC5V-32LEDS-per-meter-full-color-led-strip-lighting-11/572167729.html" rel="nofollow">http://www.aliexpress.com/item/11-Hot-sale-WS2801-...</a> ?</p>
Hi! <br>First of all nicely done! <br>I'm trying to do the same thing here for a few days know. I got the arduino one and a dreamcolor led strip (with 3 wires). Tried your sources for arduino and processing. <br>No problems at the arduino source. But from the processing source, I get ArrayIndexOutOfBoundsException: 77, at this part: <br> serialData[data_index++] = (byte)ledColor[i][0];. <br>I'm new with this kind of software and have no idea how to solve this. If you could help me that would be great! <br>
<p>Here is the fix :</p><p>import java.awt.*;</p><p>import java.awt.image.*;</p><p>import processing.serial.*;</p><p>/*</p><p>// using 12 RGB LEDs</p><p> static final int led_num_x = 4;</p><p> static final int led_num_y = 4;</p><p> static final int leds[][] = new int[][] {</p><p> {1,3}, {0,3}, // Bottom edge, left half</p><p> {0,2}, {0,1}, // Left edge</p><p> {0,0}, {1,0}, {2,0}, {3,0}, // Top edge</p><p> {3,1}, {3,2}, // Right edge</p><p> {3,3}, {2,3}, // Bottom edge, right half</p><p> };</p><p> */</p><p>// using 25 RGB LEDs</p><p>static final int led_num_x = 10;</p><p>static final int led_num_y = 6;</p><p>static final int leds[][] = new int[][] {</p><p> {2,5}, {1,5}, {0,5}, // Bottom edge, left half</p><p> {0,4}, {0,3}, {0,2}, {0,1}, // Left edge</p><p> {0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0}, {8,0}, {9,0}, // Top edge</p><p> {9,1}, {9,2}, {9,3}, {9,4}, // Right edge</p><p> {9,5}, {8,5}, {7,5}, {6,5} // Bottom edge, right half</p><p>};</p><p>static final short fade = 70;</p><p>static final int minBrightness = 120;</p><p>// Preview windows</p><p>int window_width;</p><p>int window_height;</p><p>int preview_pixel_width;</p><p>int preview_pixel_height;</p><p>int[][] pixelOffset = new int[leds.length][256];</p><p>// RGB values for each LED</p><p>short[][] ledColor = new short[leds.length][3], </p><p>prevColor = new short[leds.length][3]; </p><p>byte[][] gamma = new byte[256][3];</p><p>byte[] serialData = new byte[ leds.length * 3 + 2];</p><p>int data_index = 0;</p><p>//creates object from java library that lets us take screenshots</p><p>Robot bot;</p><p>// bounds area for screen capture </p><p>Rectangle dispBounds;</p><p>// Monitor Screen information </p><p>GraphicsEnvironment ge;</p><p>GraphicsConfiguration[] gc;</p><p>GraphicsDevice[] gd;</p><p>Serial port;</p><p>void setup() {</p><p> int[] x = new int[16];</p><p> int[] y = new int[16];</p><p> // ge - Grasphics Environment</p><p> ge = GraphicsEnvironment.getLocalGraphicsEnvironment();</p><p> // gd - Grasphics Device</p><p> gd = ge.getScreenDevices();</p><p> DisplayMode mode = gd[0].getDisplayMode();</p><p> dispBounds = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());</p><p> // Preview windows</p><p> window_width = mode.getWidth()/5;</p><p> window_height = mode.getHeight()/5;</p><p> preview_pixel_width = window_width/led_num_x;</p><p> preview_pixel_height = window_height/led_num_y;</p><p> // Preview window size</p><p> size(window_width, window_height);</p><p> //standard Robot class error check</p><p> try {</p><p> bot = new Robot(gd[0]);</p><p> }</p><p> catch (AWTException e) {</p><p> println(&quot;Robot class not supported by your system!&quot;);</p><p> exit();</p><p> }</p><p> float range, step, start;</p><p> for (int i=0; i&lt;leds.length; i++) { // For each LED...</p><p> // Precompute columns, rows of each sampled point for this LED</p><p> // --- for columns -----</p><p> range = (float)dispBounds.width / led_num_x;</p><p> // we only want 256 samples, and 16*16 = 256</p><p> step = range / 16.0; </p><p> start = range * (float)leds[i][0] + step * 0.5;</p><p> for (int col=0; col&lt;16; col++) {</p><p> x[col] = (int)(start + step * (float)col);</p><p> }</p><p> // ----- for rows -----</p><p> range = (float)dispBounds.height / led_num_y;</p><p> step = range / 16.0;</p><p> start = range * (float)leds[i][1] + step * 0.5;</p><p> for (int row=0; row&lt;16; row++) {</p><p> y[row] = (int)(start + step * (float)row);</p><p> }</p><p> // ---- Store sample locations -----</p><p> // Get offset to each pixel within full screen capture</p><p> for (int row=0; row&lt;16; row++) {</p><p> for (int col=0; col&lt;16; col++) {</p><p> pixelOffset[i][row * 16 + col] = y[row] * dispBounds.width + x[col];</p><p> }</p><p> }</p><p> }</p><p> // Open serial port. this assumes the Arduino is the</p><p> // first/only serial device on the system. If that's not the case,</p><p> // change &quot;Serial.list()[0]&quot; to the name of the port to be used:</p><p> // you can comment it out if you only want to test it without the Arduino</p><p> //port = new Serial(this, Serial.list()[0], 115200);</p><p> // A special header expected by the Arduino, to identify the beginning of a new bunch data. </p><p> serialData[0] = 'o';</p><p> serialData[1] = 'z';</p><p>}</p><p>void draw() {</p><p> //get screenshot into object &quot;screenshot&quot; of class BufferedImage</p><p> BufferedImage screenshot = bot.createScreenCapture(dispBounds);</p><p> // Pass all the ARGB values of every pixel into an array</p><p> int[] screenData = ((DataBufferInt)screenshot.getRaster().getDataBuffer()).getData();</p><p> data_index = 2; // 0, 1 are predefined header</p><p> for (int i=0; i&lt;leds.length; i++) { // For each LED...</p><p> int r = 0;</p><p> int g = 0;</p><p> int b = 0;</p><p> for (int o=0; o&lt;256; o++) { //ARGB variable with 32 int bytes where</p><p> int pixel = screenData[ pixelOffset[i][o] ];</p><p> r += pixel &amp; 0x00ff0000;</p><p> g += pixel &amp; 0x0000ff00; </p><p> b += pixel &amp; 0x000000ff; } </p><p> // Blend new pixel value with the value from the prior frame </p><p> ledColor[i][0] = (short)(((( r &gt;&gt; 24) &amp; 0xff) * (255 - fade) + prevColor[i][0] * fade) &gt;&gt; 8);</p><p> ledColor[i][1] = (short)(((( g &gt;&gt; 16) &amp; 0xff) * (255 - fade) + prevColor[i][1] * fade) &gt;&gt; 8);</p><p> ledColor[i][2] = (short)(((( b &gt;&gt; 8) &amp; 0xff) * (255 - fade) + prevColor[i][2] * fade) &gt;&gt; 8);</p><p> serialData[data_index++] = (byte)ledColor[i][0];</p><p> serialData[data_index++] = (byte)ledColor[i][1];</p><p> serialData[data_index++] = (byte)ledColor[i][2];</p><p> float preview_pixel_left = (float)dispBounds.width /5 / led_num_x * leds[i][0] ;</p><p> float preview_pixel_top = (float)dispBounds.height /5 / led_num_y * leds[i][1] ;</p><p> color rgb = color(ledColor[i][0], ledColor[i][1], ledColor[i][2]);</p><p> fill(rgb); </p><p> rect(preview_pixel_left, preview_pixel_top, preview_pixel_width, preview_pixel_height);</p><p> }</p><p> if (port != null) {</p><p> // wait for Arduino to send data</p><p> for (;;) {</p><p> if (port.available() &gt; 0) {</p><p> int inByte = port.read();</p><p> if (inByte == 'y')</p><p> break;</p><p> }</p><p> }</p><p> port.write(serialData); // Issue data to Arduino</p><p> }</p><p> // Benchmark, how are we doing?</p><p> println(frameRate);</p><p> arraycopy(ledColor, 0, prevColor, 0, ledColor.length);</p><p> }</p>

About This Instructable


528 favorites


More by lacglzh: Build a Robotic Remote Controller DIY Camera Gimbal Make your own TV ambilight using Arduino
Add instructable to: