Introduction: Extreme Ambilight System Using [ws2801 + Arduino Uno]

the colors in reality are 99% true , the whites in this video were more purple since im recording using my iphone :D

so, here it's guys, the ultimate ambilight clone you can make.

what are we trying to accomplish is scanning the edges of a screen and determining the average color of those spots, then apply those colors to the leds, in a fast way that we shouldn't notice any delay while watching a videos

to make this possible we need:

*addressable leds, to be exact we need the ws2801, they come in many shapes, i got the 5m strip from:

http://www.aliexpress.com/item/5M-ws2801-LED-strip...

*arduino uno microcontroller with usb cable, u can find it easily, no need to buy it online..:)

*a windows pc, i have tested this only on windows 8.1 pro x64, and lately with windows 10 pro x64

*a power supply to power the leds, in this case im using the pc power supply to get the 5 volts, DON'T use the power from the arduino or usb, it wouldn't work.

the whole project normally costs around 70$, if you are getting the whole 5m of the led strip.

let's connect those wires .. :)

Step 1: Wires Connections Diagram

connect everything from the IN side on led strip and not the out side, since this strip is not analog, it's digital, direction of data is important

the ws2801 has 4 wires to be connected, let's start with the ground, ground the led strip GND to the arduino and the powers supply ground, very important to prevent flickering.

next thing is connecting the arduino to pc, easy, using a usb cable.

to power the led strip we need 5v, tab into any not used molex connecter in your spower supply, usually 5v is the red wire, check it with a volt meter, if it's, connect it to the 5v in the led strip

two wires are lift, the SD is the data, connect it pin 11 on the arduino

last wire is the ck wire, which is the clock wire, connect it to pin 13 on arduino.

thats about all about the connections

some note:

setup your led strip around the screen, u can either have it go all around the screen, or just the main 2 sides and the top as i did, since usually the bottom of the screen isn't far from a table, it would look much better if your screen is on a wall, the closer to the wall the better.

Step 2: Code,software and Downloads

first, download arduino IDE, install it.

download this library:

fastled library downlaod

import the zip library to arduino IDE.

you need to know what com port your arduino is connected to, you can find that using the device manager.

download the sketch and upload it.

on pc, we need the capturing program, i've tested 3 programs, ambibox is the best so far, specially if you are on windows 10, it has the ability to capture your desktop and full screen apps and games, so no worries :)

Ambibox Downlaod

last thing is to install ambibox, select adalight as a device, select your com port.

count how many leds you have used around your screen, setup your scanning box, and you are good to go.

note that some strips have different color orders, the one i got is BGR so you can select that also.. :)

also note that the arduino sketch isn't the same as the one on adalight site, i found this modified faster version that works with me flawlessly

for capturing method select windows 8, even if you are on windows 10.

you can modify you color settings such as gamma and saturation to make the colors match the screen.

ambibox has many other features such as constant color and mobile control along with creating profiles for certain moods such as letterbox movies and full screen videos.

thats about all, don't forget to comment and give feed back.

Comments

author
h0uri (author)2016-05-16

if you're interested in using a custom pc client for this project please visit my new post for the new and super fast ambilight software

https://www.instructables.com/id/Ambilight-DFMirage-super-Fast-Screen-Capture-and-P/

author
shion093 made it! (author)2017-04-10

I made it, but I used ws2812 leds instead. Thanks for this awesome project.

IMG_4207.JPG
author
rrickets (author)shion0932017-08-07

hello! i am using Nano and WS2812. can i ask what exactly you did/modified from his code/setup? basically i want to use bambibox (better) or prismatik but I can't get it to work. thanks in advance!

author
shion093 (author)2017-04-07

I'm the only one that the arduino stops working after 10 seconds? just freeze the leds

author
stuwa200 (author)2016-12-15

Hi. I done step by step from yourstutorial but. when i instaled ambibox run adruino nothing happend should i do something in arduino program ? i instaled 2812b tape 180 leds.

author
jveldman (author)2016-10-03

Os there a difference between the IP30 and the IP67 on this link? Its a bit cheaper. https://m.aliexpress.com/item/32679373493.html#autostay

author
sivovic made it! (author)2016-08-11

i did it and its awesome , super cheep and reliable. I really like how simple it is, u only need arduino and led strip. I saw few tutorials and they are using to much stuff like a/v and hdmi spliters, arduinos, raspbery pis and a lot more stuff, its too complicated but not this one. Well done tutorial

youtube like for my ambilight : https://www.youtube.com/watch?v=UpL09ZJwKso

IMG_2878.JPG
author
TalT4 (author)2016-07-12

I think this project causing shorts to my pc PSU. Can anyone familiar with this phenomena? One of the symptoms is a PC restart loop.
I have 5v/10A PS connection to one LEDS end and to the other LEDS (2812b) end, I connected the data and GND to the Arduino, which is connected via usb to the pc.
Hope someone can help on this.
Thanks

author
h0uri (author)TalT42016-07-12

also connect the external gnd to the arduino gnd .. might help ..

author
HoldenP (author)2016-06-19

OMG thank you for this. i was having trouble with every other code i tried with led flickering with my 61 ws2801 strip when changing colors. switched to this and typed in my led number that was it and it works flawlessly now no flickering or wrong colors.

author
khapianocovers (author)2016-06-10

I used an Arduino Nano powering the led strip using usb power and it seems to be working fine. Is that all right?

author
JohnF291 (author)2016-05-24

hi there,

I love the idea of this project. But unfortunally I run into a problem when I try to upload it. It gives me this error. I have the same Arduino and the ws2801 leds. Does anyone know what I am doing wrong?

Thanks in advance!

image.jpeg
author
h0uri (author)JohnF2912016-05-24

thats not the code i've posted.. also you should download fastled.io from there site which is fastled.io, go to sketch -> include library -> add a .zip file. then try to upload.

also this post is old and this is the better solution

https://www.instructables.com/id/Ambilight-DFMirage-super-Fast-Screen-Capture-and-P/

author
ChrisH418 made it! (author)2016-05-09

Hey h0uri,

thank you for this awesome tutorial. I built a 42" Ambilight for my TV (96 LEDs) with your help. But I'm encountering following problem.

If I activate the screen capturing mode (Windows 8 mode), music mode or dynamic backlight the LEDs flicker sometimes (maybe 3 to 6 times per minute; not sure, no specific pattern). If I move the cursor in screen capture mode the LEDs flicker also. Static background, screen capture mode with GDI FS Aero no flicker.

I'm using an Arduino Mega Board. LED GND and Arduino GND are connected both to V-. Following alternatives cause more problems (PS short for power supply, A for Arduino):

LED GND -> PS GND, A GND -> PS GND: LEDs do not light up

LED GND -> PS V-, A GND -> PS GND: first LED is not addressed right and flickers extreme in white color, rest of LED Stripes light up in the correct color, but flicker constantly.

Baud rate in the Arduino sketch, device manager and Ambibox is set to 115200.

The power output is constant 5V, but maybe my Voltmeter is to slow to detect a short Volt drop.

Could it be, that the magic word in the sketch is the root of the problem?

I hope for your help and already thank you! :D

IMG_20160509_205452.jpg
author
ChrisH418 (author)ChrisH4182016-05-12

I could finally fix the problem. You need to use the pins 51 and 52 for my board. I used the PWM pins at first an not the digital pins.

author
h0uri (author)ChrisH4182016-05-12

Glad to hear that .. :)

author
ChrisH418 (author)ChrisH4182016-05-09

correction: I use an similar board to the original Arduino MEGA 2560. It's named Funduino, but has the same specifications as far as I know.

author
h0uri (author)ChrisH4182016-05-10

if it's possible to get an uno or a similar build to an uno, i've uploaded the sketch to a mega, it worked with my custom software but not with ambibox.

so im gonna start working on releasing my custom software by the end of tomorrow.

author
h0uri (author)ChrisH4182016-05-09

since the first led flickers extremely it's possible that it's a faulty chip on the first led or a weak soldering point, fix it by cutting off the first led << read allot about that first faulty IC when searching for the project.

also what version of windows are you using ? asking since win8 method should work fine on win8 to win10

u may wanna try the color swirl from:

https://learn.adafruit.com/adalight-diy-ambient-tv...

if it doesn't flicker for a couple of minutes then it's possible that your hardware has nothing wrong and the problem is something with the software.

about the magic word, it's not something variable to be changed, if it doesn't match the magic word that ambibox is sending then no colors will show up on the strip, the serial packet will be dropped.

at last i've built my custom software to control the leds and stopped using ambibox, my software is much faster with better features, thinking about uploading a version in a matter of days so stay tuned.

author
ChrisH418 (author)h0uri2016-05-09

Well, I exchanged the first LED-Unit. If I upload the Arduino sketch (LEDstream) all LEDs light up red, green and blue for a second as wanted, but the Colorswirl won't work (with the correct COM-Port of course). The problem with Ambibox still persists

author
ChrisH418 (author)ChrisH4182016-05-09

Just noticed. The flickering starts after the 19 th LED

author
ChrisH418 (author)h0uri2016-05-09

I'm using Win10.

If I execute the colorswirl software only the first LED lights up.

author
bumhee34 made it! (author)2016-04-01

Very thx, I made 130" ambilight! Many thx.

https://www.instructables.com/id/DIY-130-Inch-Edgeless-Screen-With-Ambilight-by-Tee/

FUBMZD7IMCFBS8X.jpeg81.jpg78.jpg
author
bumhee34 (author)2016-02-10

Dear,

This is a great tutorial and easy to read.

I will challenge with 130 inch diagonal screen with this method.

In my case, it will take around 10 meter of LED.. So, huge power is needed aroun 100 watt.

By the way, it looks like the power source should be distributed in a parallel(?) way to LEDs following to the adalight site (https://learn.adafruit.com/adalight-diy-ambient-tv...

Do you have any advice for this? I have no idea what would be the best wiring in this case such as "how many parallel lines?", "what would be the ideal distance between powers?"

One more question, do you think it will be better to have two power supplies instead of having a one big power supply?

Any advice would be very helpful. Thx in advance!

author
h0uri (author)bumhee342016-02-11

first .. u should consider the software limits before the hardware limits ..

if u r goin 10 meters .. with 32 led/m wire, u r talking about 320 leds ,the maximum of ambibox is 300 boxes (not sure though), i guess .. next thing u should consider .. is ur pc gonna be able to handle the processing 300 spots on ambibox..besides the pc, u got the arduino, which isn't fast at all for such a thing, and will cause a noticeable delay in writing the data to the led wire, so using something faster than the arduino ,i recommend the "teensy 3.2" , that mp is allot faster than the arduino, it's 72mhz..

after all this .. powering the wire, i don't have much knowledge in this area, but with trail and error u can make it, from the page i bought my leds it says 7-9W / meter, 7 is when running a single color (ie.Red) and full brightness, 9w is with all colors on (white) , so u need at least 90 watts power supply .. u can buy a 90w ps, or better u can use an old pc psu and hook it up with a jumper on the atx to keep it on and use dat psu for as many leds as u want, in both cases u get to use only one psu from any end u want, no need for the adafruit hassle (wiring leds and daisy chain the power), thats all i can help u with .. :) hope it works well for u, don't forget to show me what goes on with u .. :)

author
bumhee34 (author)h0uri2016-02-11

Thx very much.
Yes, teensy 3.2 I've already ordered.
As you mentioned, teensy 3.2 with OctoWS2811 Adaptor will be perfect for my project.
I will upload when it's done. Thx again:)

author
ElvinFox made it! (author)2016-01-23

Hello, h0uri

Works great, but there is the problem with the flickering... I thought that everithing was connected right(gnd and pin 13 ,11), but sometimes leds flicker (e.g. when i move coursor)

Please look at the photo, did i connect it right?

Thank you in advance!

IMG_20160123_185413.jpg
author
h0uri (author)ElvinFox2016-01-23

usually that type of power supply has an adjustable potentiometer to increase and decrease the voltage 5v output, u may wanna use a volt meter to check that out.

2nd thing i noticed in u have your ground connected to a v- pin, try connecting then to the ground pin, something to consider is connecting both grounds together (arduino gnd and led gnd), to the same gnd pin, try them together on the v- pin, if that won't work, try on the gnd pin.

author
ElvinFox (author)h0uri2016-01-28

I checked Vout it's 5V -ok

Where ca i check baud rate in Ambibox? Didn't find it....


I just tried capture method of GDI FS Aero and it worked just fine =) Now i need to make it work with PlayClaw

Thank you again for great manual and help!

author
h0uri (author)ElvinFox2016-01-28

it's a .txt or .ini file at the ambibox installation folder..

from my experience over the last couple of years with ambibox the "Windows 8" capture mode is faster than the others ..

author
h0uri (author)ElvinFox2016-01-23

also, make sure that you have the baud rate matching on both the ambibox config file and the arduino, setup your arduino code properly with the exact amount of led count matching on both the arduino and the ambibox, let me know how it goes .. if it works, tell us what made it work .. :)

author
MichaelR243 made it! (author)2016-01-11

Thanks for the tutorial!!!

20160110_220701.jpg20160110_223016.jpg20160110_230828.jpg20160110_231214.mp4
author
h0uri (author)MichaelR2432016-01-12

nice job bruh .. looks amazing .. :D

author
askfriends (author)2016-01-12

i have already bought ws2812b led strip, can i use them for this project? what changes would i need to made?

author
h0uri (author)askfriends2016-01-12

Basicly, what you need to change is in the arduino code, see the first line the void setup function "FastLED.addLeds<WS2801,....".

try to replace it with "WS2812B" and see how it reacts to it, if that didn't work see how to declare your type of strip in the fastled.io library ..

i don't think there's any changes required in the PC software ..

author
MCC5 (author)2015-11-24

Thank you. It works perfectly

author
h0uri (author)MCC52015-11-24

you should check out the youtube channel from that video and see many more ideas .. :)

author
MCC5 (author)h0uri2015-11-25

Will do :D

author
TheD3ND (author)2015-10-19

"the ws2801 has 4 wires to be connected, let's start with the ground, ground the led strip GND to the arduino and the powers supply ground, very important to prevent flickering." So tht means I have to connect GND also to the ground of my power supply? What do you mean by that; for PC or DC xxA 12V power supply for LED strips .. because how much I know they are both 12v DC ...

author
h0uri (author)TheD3ND2015-11-17

yes, what we are doin here is making sure that we have a common ground.

arduino ground+psu ground both are connected to the led strip ground

that's about it..

note:u said it's 12v, nothing is 12v in this instructable, the led strip i'm using is powered by 5v..!!

more explanation about common ground

we are supplying the strip from the pc psu, and giving data to ic's via the arduino, both the 5v and the data need to be grounded, but only one ground pin out of the strip is available, so we need to hook the two ground to the strip..

author
DavideP6 (author)2015-09-08

Wow,this is with only 32 LED/meter.

I'm thinking to do the same thing with the 144 led/meter WS2812B or APA104.

3m on all sides would be 432 leds total. What do you think?

author
h0uri (author)DavideP62015-09-09

with the ws2812b, i believe it doesn't have a clock, so it would be slower, with that many led count, you might see a noticeable delay after the first 100 leds, not sure though, since i havn't tried them, i choose the ws2801 cause it has a faster transfare rate, also note that with this many leds it will consume much power than a small led count, if you did yours, please share a picture of it .. :)

author
DavideP6 (author)h0uri2015-09-09

Hi, for now I'm looking information for the best solution. For example, if the clock is so important, I can use only the ws2801. I see only 32led/m strip. I know about the power, it would consume ~130W.

author
h0uri (author)DavideP62015-09-10

https://learn.adafruit.com/adafruit-dotstar-leds/o...

here's a comparison between with and without tyhe clovk.

author
DavideP6 (author)h0uri2015-09-11

I see. The only way to make something more "high definition" would be something like this: https://www.instructables.com/id/Ambilight-for-your-TV/step2/Connect-the-Pi-to-the-LEDs/

Calculating 15mm for led = 66 led/meter

~200led in 3 meters and about 100€.

author
Nightshade (author)2015-08-28

Will this also work on a mac?

Thanks

author
h0uri (author)Nightshade2015-08-29

i don't think this exact method would, since ambibox is for windows, but you can some searching for "ambilight" on mac, there must be some alternative,

i've also seen the same effect on a pass through device that doesn't require a pcor a compute to process the data, using rasperry pi as a microcontroller, the software is called Hyperion, if i remember well.. :)

About This Instructable

40,086views

117favorites

License:

Bio: Computer Engineering @ASU in JO.
More by h0uri:Remote Hardware MonitorAmbilight DFMirage [super fast screen capture and processing]Audio Spectrum Software [C#]
Add instructable to: