DIY PC Ambient Lighting Using Arduino and WS2812b LEDs




Introduction: DIY PC Ambient Lighting Using Arduino and WS2812b LEDs

About: I'm an engineer.

Wanted some more depth for my gaming/movie viewing experience so here's how I installed my ambient lighting.

Before we begin, this project requires you to know how to use a soldering iron and some other basic tools. If you're not comfortable soldering, you can get somebody to do it for you... or learn how :)

Note: I'm making this after I finished the project so the pictures shown will be from the finished product.

Note2: Since this seems to be a point of confusion. This project works on computers that can run the Ambibox software. The LEDs are controlled using this software, so using this setup for regular TV viewing won't work.

Note3 (thanks to RostislavK): If you're having trouble with the arduino code, you can use the following instead:

Now that that's out of the way, let's begin with the parts list:

1. WS2812b LED strip (5m, 300 LEDs, waterproof (not necessary but I like the sleeve).


2. Arduino board. I used an Arduino Leonardo 16MHz


3. An old computer power supply. (Got from the office, if you can't find just ask around somebody's bound to have an extra one somewhere)

4. Double sided tape. I use the Wurth automotive tape since it doesn't leave any residue.

5. Soldering iron, solder, some scrap bits of wire, basic tools

Step 1: Measuring and Cutting the LED Strip

So first things first, measure the size of your monitor from behind, just to see how many LEDs from the strip you need to cut. When measuring leave about 1cm from each edge, just to make sure the strip won't show when attached to the monitor.

Once you're satisfied with your measurement, cut the LED strip to length. Each of these LEDs is individually addressable so you can cut after each LED at the marked cutting point (shown in the picture).

Go ahead and cut all 4 strips. Once done move to the next step.

Step 2: Soldering the Strip

Once you've cut all your strips to size, it's time to re-connect them to act as a single 'flexible' strip.

I used some stranded wire from a piece of Cat6 network cable. Simply solder the +5v to the next +5v rail, the DIN to the next DIN and the GND to the next GND.

Once you've done that the strip should all be connected together in 4 parts.

TIP: Unsleeve some of the rubber cover to expose the solder joints.

Important TIP: Ensure that the led strip direction arrows are pointing in the correct orientation, otherwise nothing will work.

Step 3: Connecting the Ends of the Strip

Once you're done soldering the strip together it's time to connect the ends, this part needs a bit more patience.

Solder some black wire to the GND pins at the beginning and end of the strip.

Solder some red wire to the +5v pins at the beginning and the end of the strip.

Hint: Soldering the power connection in this way allows for better power distribution in the LED strip giving more even brightness.

Solder a green/white cable to the Din at the BEGINNING of the strip (otherwise nothing will work).

Once this is done you can connect the black and red power wires to a molex connector, then to the PSU.

Caution: Make sure your connections are correct before you go to the next step as you might fry something if they're not.

Finally you can turn the PSU on by placing a jumper (I use a bit of solder) between the green and black pins of the ATX connector. This 'fools' the PSU into thinking that the computer is asking for power and thus switches it on.

Once this is done the LED strip should flash momentarily and then go off. This is normal as the LEDs have no input to tell them what to do. That's where the arduino comes in.

Step 4: Connecting the Arduino

Connect the DIN pin to pin number 3 on the arduino board. Mine came with some headers which I soldered on.

In the image I accidentally used a white wire for the ground and a black for data. Don't get confused, the data wire from the strip needs to connect to the 3rd pin on the board.

Optional: You can connect the GND pin from the arduino to the PSU GND, this is useful if you're using a separate power source from your PCs PSU.

Next connect the arduino to your PC and install the necessary drivers (if any).

Assumption: You know how to compile the code to your arduino. If not search the countless tutorials online :)

Use the arduino programmer to compile and program the arduino board with the following code:

Step 5: Setting Up the Software

Download and install ambibox

Start the software and configure your board as an 'Adalight' board using the appropriate COM port (find from device manager).

Set the Device Type to Adalight.

Set the number of zones according the quantity of LEDs you have

Finally use the wizard (click show zones first) to configure the capture zones. These zones will be what determine the colour of the light.

Once this is done you should be good to go, turn the 'use backlight' switch on and enjoy the colours :)

Step 6: Stick the Strip to the Monitor and You're Good to Go

Finally, use some double sided tape to attach the strip to the monitor. I used the Wurth stuff because it's strong.

Simply place some tape along the strip then line it up and stick it on.

Voila you've got yourself some ambient lighting for games.

Hopefully this tutorial helped you ascend.




    • Creative Misuse Contest

      Creative Misuse Contest
    • Fix It! Contest

      Fix It! Contest
    • Water Contest

      Water Contest

    20 Discussions


    Question 2 months ago

    So how do I use the .rar file for the ardunio?

    Hello there, I have followed your tutorial and everything works. But sometimes leds starts flashing, changing colors quickly while I am using AmbiLight software. Any idea how to fix it?

    3 replies

    can't say i've had this issue. could be you have too many LEDs in the strip? Does it happen if you set the software to display a single colour or mood light? Maybe it's related to the capture, i set it to win8 mode.

    Thanks for reply. I tried official arduino ambilight code from dmadison's github ( and now its working flawlessly. Would you mind adding that link to your post for people with the same problem?

    Ok I am kind of lost do I instal this software and the code in my nano or just AMBIBOX. Please explain this is all new to me? Thank you in advance for any help you may lend with this issue. Also can I use NANO or do I need UNO?

    3 replies

    you can use either the nano or the uno, you just need to know which pins to use as output. regarding flashing the software, there are plenty of tutorials on how to do that :)

    but in a nutshell you need to load up the arduino ide (dev environment), connect ot the board via the correct COM port and compile the software

    this guide should give you all the necessary instructions:

    I think I was misunderstood??? What software do I install into my ARDUINO the code from or this I am unsure what to program my arduino with. Then I see other links like this one in the other messages so please what code links do I follow that need to be programmed into the microcontroller?

    This project uses the code from the pastebin link ;) im sure you can make it work with others if you're up to the challenge.

    Again, the color changes are controlled by software reading the PC screen pixels. Try this,, for a more general solution that works on any input. The more general solution requires more hardware, An HDMI splitter, HDMI-to-analog box , analog video capture to USB box and finally a Raspberry Pi which controls the LED strips. You'd think the hardware wonks in Shenzhen would be selling an HDMI pass-through with a USB breakout for this purpose by now.

    Can you please explain, how the arduino gets the right colors ?

    Does 'ambilight' - software gets the information somehow ( from internet ?? ) and send it to the arduino ?

    That would mean, I need to connect a PC always to the arduino.

    I hope, I'm wrong with this ( but maybe think of a raspberry ... )

    1 reply

    This project only works on a PC, or a TV being used as a PC monitor.

    Maybe I missed it, but does this project automatically change colors to match the dominate color on the television?

    3 replies

    indeed it does :) depending on how you configure the software that is.

    Thanks for the reply tintii. I think I have a new project to tackle! I currently run LED strips behind my television. I can change the color, but it's static, until I change it again. I usually keep it red, but it would be nice to have auto-changing colors. I also run a 16' strip over an arch between rooms. Could I set this up to affect that source as well?

    I think the software allows you to control multiple input sources if you like, or have a static/dynamic colour on a primary/secondary strip. Just make sure that the type of LEDs you're using are fit for the job :)

    This is really something interesting, I would ask can we power it with an other 5v (like a smartphone usb cable)

    I don't really want to put this inside my pc ^^

    2 replies

    Well it's unlikely. Each LED uses about 50mA at full load, so for every 20 LEDs you need 1A of power from your outlet.

    What I did is connect it to the PSU inside my computer using an elongated Molex connector, that was the easiest way to avoid having an extra PSU. Just make sure your power calculations are done correctly before connecting stuff, you dont want to damage your PSU accidentally ;)

    That looks really pretty! Great lighting feature :)