Cheap DIY Ambientlight Using Arduino




Picture of the product - my 40" 4K Desktop with DIY Ambilight

The Ambilight in this picture is completely DIY and uses some cheap RGB LEDs with integrated controllers and an Arduino. On the Software side, there is Ambibox running on the PC (Windows only) and the FastLED library on the Arduino!

The Ambilight is totally DIY and easily bright enough so that no other light is needed. The screen is mounted to the wall and flushes with the table. (So no Ambilight at the bottom.)

Ambilight uses the following:

  • Ambibox Software on PC (free, but only Windows)
  • Arduino with a simple script which uses the FastLed library (further down) (~3$)
  • 50 RGB WS2811 LEDs (~13$)- optional power brick

Step 1: Some Precautions!

This setup is very cheap but only works on a PC. You cannot use this for your Blu-ray player or standalone TV. You need a software running in the background on your PC.

Linux or MAC is not supported. The Ambibox software I am using is only available on Windows.(For standalone applications there is an RPI variant, quite expensive)

The LEDs work quite good and without noticeable lag on the Desktop and while watching movies! Games are a different story. If the game runs in Fullscreen mode, the software will most of the time not be able to capture the image. But Borderless mode works! (keep in mind the added CPU power needed ~5%)

Step 2: The LEDs Needed for This Project

The most important part of this project are the RGB LEDs with individual controllers.

It doesn't really matter which RGB LED Controller you get, as long these are supported by the FastLed library. Here is a link to the supported LED Chips:

The most common are the WS2811 or WS2812 LEDs since there are cheap and easy to use. These are also used in this project. They are sold in at least two different types: - as single bulbs (12mm) with a variable spacing of around 10cm at max. You mostly get pairs of 50, but you can add or extract LEDs as you wish. -as LED strips (with adhesive on the back). These you buy per meter with a fixed spacing. (30/60/or more LEDs per meter).

With single bulb LEDs, you get the advantage of completely free positioning and spacing. But on the other hand, you have to find a way to add them to your monitor.

How many do I need?

I would base this decision on the size of the monitor you are using. I was using 50 LEDs on a 27" with a 4 sided setup. Now I am using the same LEDs on a 40" with a 3 sided setup. My LED spacing is around 3cm, and I am quite happy with it! So if you know you need around 1 LED per 3 cm you can easily calculate how many LEDs you need for your whole setup.

LED strips
LED Strips have a big advantage over the single bulb version since you can easily stick them to the back of your monitor and be done with it. The problem with this is, that you can not variate the spacing or position of the LEDs. Also, the brightness of the single bulb version in some cases seems higher.

If you choose the strip you do not build a frame like I did in the next picture.

Step 3: The Frame (for Bulb LEDs)

Since I chose the bulb version of the LEDs, I had to build some kind of frame.

You can do this like me with aluminum sheets, a drill, and some cable ties. I cut 3 strips from the sheet, which were a little smaller than the dimensions of the monitor. Then I divided the whole length by 50 to get the spacing right and started drilling holes for the cable ties. Then I only had to zip the LEDs tight. Since my monitor is flush with the desk, I didn't need any LEDs at the bottom of the screen. If your screen has considerable space at the bottom I would consider going all the way around.

Another more easy way to add these LEDs to the monitor is by simply using some adhesive clips in the right size. But I can not say how long they will last. (with heat and all)

Step 4: The Arduino (nano)

To control the LEDs you need a central controller! For this, I am using a cheap Arduino clone from china. It doesn't need a whole lot of features, so I guess every Arduino will do. I am using a nano since they are very cheap and very small. On this, you just need the USB connector, a single digital pin, and the ground pin.

Step 5: The Power!

For the LEDs to work they need some form of power. Most LED chips are using 5V.

It is very important that you know the exact power specs needed for your LEDs. The WS28XX LEDs used in this project need 0,3W/piece. So at 5V the need a current of 60mA. If you have 50 LEDs that sums up to 3 Amps!!!

There are two ways to get this power: 1. You can buy an external power brick which is rated at the needed wattage. This you simply solder to your LEDs and plug it into the wall.

2. (I will NOT recommend this) You can get the power of your PSU on your computer. Most PSUs have a rating of around 20A on the 5V line, which is seldom used. So you can easily cut one of these Y-Adapters and solders them to your LEDs. The positive effect is, that the LEDs are automatically cut off with the PC Power and you don't need to buy another brick.

Step 6: The Connections

If you are using the WS2811/12 LEDs there are only 3 connections you have to make.

  1. You have to connect the 5V Power with the corresponding 5V line on the LEDs.
  2. You have to connect the ground of the PSU with the ground on the Arduino and the ground on the LEDs
  3. You have to connect the data line of the LEDs with one digital port of the Arduino. Which one doesn't really matter, but you have to remember the number. (I did not use the pictured Resistor!)

Step 7: The Arduino Sofware

After connecting everything. You need to setup your Arduino IDE and install the corresponding driver.

If you don't have any experience with using an Arduino you need to start here:

After setting everything up you need to add the Library. Here is the script I am using on the Arduino:

Some of the things you should change:

  • NUM_LEDS, set this to your LED count
  • DATA_PIN, set this to your used Arduino PIN
  • SerialRate, defines the speed of the LEDs, (500000 is maxed)

In the "FastLED.addLeds" you should change the controller to the one you are using. Soe controllers need another CLOCK_PIN to be defined! Check the fastLED Documentation for your chipset.

Step 8: The Ambibox Software on Windows!

Get the newest Version of Ambibox from the developer homepage: http://www .ambibox .ru/en/index/php/Main_Page

While installing you asked to choose which components you wish to install. I choose none of them. If you need one, you can easily install them later.

After installing Ambibox you need to go into the install directory and change a line in the following File: C:\Program Files (x86)\AmbiBox\SerialPortConfig.ini You need to change the Baud rate of the Adalight to 50000, the same number you used in your Arduino script. Save the File and restart Ambibox.

[Adalight] BaudRate = 500000

Step 9: Main Settings Panel

So these are the main settings I use in my Setup:

First, you need to clock the "More Settings" button on the lower right!

The most important settings are at the bottom. The Device for this setup needs to be "Adalight". You can try to find the right COM port by going through them and looking at the device status or you just fire up the device manager and look it up. The standard order of colors is RGB. If you have problems with shifted colors you can change this here. At the last field, you can select the number of LEDs. This should match your NUM_LEDs in the script.

  • Other Settings: -
  • F7 is my Hotkey for turning the LEDs on and off
  • I do not use different profiles, so it is just Default.
  • With "Mode" you can choose what your LEDs should be doing. I recomment starting with static color to verify all of them are working correct and show the right colors. After that, you can set it to screen capture and choose "Windows 8" as a capture method. This works quite well on Windows 7 to 10.
  • Set the delay to min. and the FPS to max, to minimize the delay.

Step 10: Areas of Capture

If you click the "Show areas of capture" button you will get a lot of boxes with numbers in them.

They will probably be all over the screen and not as ordered mine.

To get these areas of capture to their correct position you should use the "Wizard capture zones" Button! In this menu, you can set a lot of different parameters. Try around a little to get them right! Most of the times you need more than one try. But after that, you should get something that looks like mine (or all the way around if you are using 4 sides) After that, save settings and hide areas of capture!

Step 11: Color Correction

These are my settings for color correction, brightness, etc.

Just copy them or try your own. Simply watch a movie and try what the sliders do!

Step 12: That's It!

Congrats now you can watch movies and play games with class!

Arduino Contest 2016

Runner Up in the
Arduino Contest 2016

10 People Made This Project!


  • 1 Hour Challenge

    1 Hour Challenge
  • Classroom Science Contest

    Classroom Science Contest
  • Sensors Contest

    Sensors Contest

69 Discussions


Question 22 days ago on Step 7

Hi, I just copied your script into the IDE, but I get an error message..... Can you help?

#include <bitswap.h>
#include <chipsets.h>
#include <color.h>
#include <colorpalettes.h>
#include <colorutils.h>
#include <controller.h>
#include <cpp_compat.h>
#include <dmx.h>
#include <FastLED.h>
#include <fastled_config.h>
#include <fastled_delay.h>
#include <fastled_progmem.h>
#include <fastpin.h>
#include <fastspi.h>
#include <fastspi_bitbang.h>
#include <fastspi_dma.h>
#include <fastspi_nop.h>
#include <fastspi_ref.h>
#include <fastspi_types.h>
#include <hsv2rgb.h>
#include <led_sysdefs.h>
#include <lib8tion.h>
#include <noise.h>
#include <pixelset.h>
#include <pixeltypes.h>
#include <platforms.h>
#include <power_mgt.h>
void setup() {
// put your setup code here, to run once:
#include "FastLED.h"
#define NUM_LEDS 50
#define DATA_PIN 6
#define serialRate 500000
static const uint8_t prefix[] = {'A', 'd', 'a'};
// Define the array of leds
void setup() {
FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
void loop() {
for (int i = 0; i < sizeof(prefix); ++i) {
while (!Serial.available());
if (prefix[i] !=
while (Serial.available() < 3);
int highByte =;
int lowByte =;
int checksum =;
if (checksum != (highByte ^ lowByte ^ 0x55)) {
uint16_t ledCount = ((highByte & 0x00FF) << 8 | (lowByte & 0x00FF) ) + 1;
if (ledCount > NUM_LEDS) {
ledCount = NUM_LEDS;
for (int i = 0; i < ledCount; i++) {
while (Serial.available() < 3);
leds[i].r =;
leds[i].g =;
leds[i].b =;
void loop() {
// put your main code here, to run repeatedly:


Question 4 months ago on Step 6

How did you connect ground to your power supply? All of the ones I've seen don't have a ground. just plastic that goes into the ground in the wall. I'm from ireland.


9 months ago

i am going to build this. just ordered the parts from aliex... will post here when i'm finished. or maybe i will request help..


1 year ago

If you look into the led on the small pcb inside they have what wire is gnd data and 5V and a arrow for what direction the data flows. in most cases you want the female end to input data into power can go from both ends and I recomend doing that to compensate for the power lose accross the leds with the voltage drop that accures in the WS28xx sweries.


2 years ago

I had fun building this project, however, after about a week of use, the LEDs have started flickering randomly. It worked fine for a couple of days but the flickering has become more and more frequent. It flickers once about every 5-10 minutes! PLEASE ADVISE!! DOES ANYONE ELSE HAVE THIS PROBLEM?Thanks

Jesper MartinS

2 years ago

I just changed one line to make 2812B work


But i also have problems with Ambibox WINDOWS8 mode, no FPS showing

1 reply

2 years ago

Hello !

Could you help me for connecting the LED bulbs to my arduino ? I've searched a lot of informations for how to connect them but nothing works :/

Which connector of the LED I need to use ? See the 2 pictures below

The red wire is +, the white is -, the green is data. I've also connected the ground of the power brick of these LEDS on the ground of my arduino and the data pin is connected to pin 6.

The LEDS are using a WS2811S controller

When I connect the power of the LEDS, they are "white" a little bit before they are "black" so they are ok. But why they wouldn't light up with a program on the arduino ?

PS : Sorry for my english i'm french :D

3 replies

Reply 2 years ago

then you cant use this CODE.

download the ADAFRUITNEOPIXEL. librairy. to test them.

this code here works ONLY with the software, NOT in my case but oke.

DL the librairy and open then an example sketch called stringtest or so. set your pin6 as data pin and the number of LEDS. and of you go.upload.

if need help go to my youtube and Google+ account ( WannaDuino )

then you wil find me, i can make a short video if needed how to use it.

Simon logo.png

Reply 2 years ago

I know that this code work only with the software. I tried them with the software, I tried also the programm FirstLight from the FastLed library but that didn't work for me. So I have a question : How I need to connect the Leds with my Arduino ? Which side of the strip I need to use ?


Reply 2 years ago

picture please, so i can see what you have.

lay both sides next to eachother with the connectors or wires on it. and take a picture. to your arduino, you only need the Grnd and the Digital pin to cionnect on the UNO. on pin 6 and Grnd on Grnd. then the 5V on the external powersupply with ALSO the Grnd split to it. so the GROUND IS COMMON.


2 years ago

Very nice work, thank you.

A couple of things to check if not working the first time.

Check if connection is good with a FastLED sketch test. (following instructions from adafruit website, everytime uploading a Sketch to Arduino:

Unplug LEDStrip power, Upload sketch, unplug Arduino, power LEDstrip, replug Arduino.

check also how your LEDstrip is setup with the FASTLED sketch "RBGCalibrate", this will help for that line:

FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);

it will tell if your strip use RBG or GBR or BGR etc. Replace the line with the right setup. I found out that mine is

FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);

Also I had to change the baud rate from 50000 to 115200 in arduino file and and Ambibox SerialPortConfig.ini (step 8).

On Ambibox Windows 8 doesn't work at all for me, but DirectDraw SRAM seems to be good, really smooth.


2 years ago


2 replies
Jesper MartinSWannaDuino

Reply 2 years ago

what are the issue, you need to tell clearly what you have done, whats working etc.

WannaDuinoJesper MartinS

Reply 2 years ago

READ ALLLL my messages below friend, my collors stay WHITE

and i got WS2812B how to put that correctly in the code. see al my pictures below

thanx for reply, can`t say that the maker helps. what a thurd is that. bah


2 years ago

Hi, i've made it like in the instructable with 3 sides (left->top->right) but my colours are twisted around 90 degree. what could be the problem?

1 reply
Jesper MartinS

2 years ago

hi i build this, it dosn´t work in WINDOWS 8 MODE it shows 0 FPS, the other modes work fine but are too slow

on my laptop it works but it isn¨t powerfull enough to run it smoothly,

Any hints?


2 years ago

could you hook this up to a TV?