Introduction: Build Your Own Ambient Lighting With the Raspberry Pi

I wanted to build an Ambient Lighting System for my TV ever since i bought the Raspberry Pi one year ago. After I finally managed to order the necessary special WS2801 LED strip, I started the build and everything went better than expected.

This is a tutorial which I splitted in 3 parts for endurable video length and clearer structure.

In the first part I talk about the led strip, how to position it and how to solder it. Also I install the Raspbmc on the SD Card and get everything ready for the Boblight plugin.

The second part is the most complicated one. It is all about configuring the Boblight plugin and connecting the GPIO headers to the strip. After this part you will be able to recreate the project.

The third and final part is all about optimizing. I modify the case and made everything much compacter and user friendly.

Step 1: Watch Part 1!

I think part 1 is very simple and there is not much explaining to do. Just be sure to get the right parts and you can download Raspbmc with this link:

http://www.raspbmc.com/download/

Step 2: Order Your Parts!

Here is a small list of things you will need.

Amazon.de:

Raspberry Pi: http://amzn.to/18tArgk

Raspberry Pi Kit: http://amzn.to/1g238SU

WS 2801 LED strip: http://amzn.to/18tAcSn

or

WS2801 LED strip: http://amzn.to/ZB9ark

Solder: http://amzn.to/NJ63Hk

Wire: http://amzn.to/1sWaqiy

Female headers: http://amzn.to/1sWaGxW

Male headers: http://amzn.to/1sWaUFi

Shrinking tube: http://amzn.to/1sWb2Vx

5V 3A Power supply: http://amzn.to/Q3HvtL


Amazon.com:

WS2801 LED strip:http://amzn.to/1CmmJsI

or

WS 2801 LED strip:http://amzn.to/10p2Enm
Raspberry Pi: http://amzn.to/1vloS5l

Solder: http://amzn.to/10pkxm0

Wire: http://amzn.to/1CIQzHI

Female headers: http://amzn.to/1xLzDjR

Shrinking tube: http://amzn.to/1xLzJb5

5V 3A Power supply:http://amzn.to/1r9O5JO

Amazon.co.uk:
WS2801 LED Strip: http://amzn.to/1GN4Naa

or

WS2801 LED Strip:http://amzn.to/1DQY8tx

Raspberry Pi: http://amzn.to/1DQY8tx

Solder: http://amzn.to/1DQYGj2

Wire: http://amzn.to/1DQYIrh

Female headers: http://amzn.to/1GN5xMt

Male headers: http://amzn.to/1GN5xMt

Shrinking tube: http://amzn.to/1GN5znO

5V 3A Power supply: http://amzn.to/1RaueuQ


Ebay:

WS 2801 LED strip:http://rover.ebay.com/rover/1/711-53200-19255-0/1?...

Step 3: Watch Part 2!

This time it is more about the software aspect. Get the necessary software in the next step and configure your Ambient Lighting.

Step 4: Download the Software!

Download the BoblightConfigTool right here. And you can also download my boblight.conf file to use it as a reference. You can download PuTTY and WinSCP with the links:

PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty...

WinSCP: http://winscp.net/eng/download.php

After this part 2 your project is done. But be sure to check out part 3 to optimize the Ambient Lighting.

Step 5: Watch Part 3!

Take a look at the next step to find more information about the "wire" part.

Step 6: Get the Connections Right!

I did not create a schematic for this. But I took a lot of picture so look carefully to get all the connections right.

Step 7: Success!

You did it ! Your very own Ambient Lighting. I hope you liked this project.

Feel free to check out my Youtube channel for more awesome projects:
http://www.youtube.com/user/greatscottlab

You can also follow me on Facebook, Twitter and Google+ for news about upcoming projects and behind the scenes information.

https://twitter.com/GreatScottLab

https://www.facebook.com/greatscottlab

Comments

author
Tom De prins (author)2017-05-01

IMPORTANT MESSAGE TO OSMC USERS:

Username and password are different in OSMC. So if you use putty use this information.

Username: osmc

Password: osmc

GreatScott, maybe you can edit your instructable and mention this?

Knipsel.PNG
author
i-blaze (author)2017-01-16

Hey guys i wanting to make this for my PC dual monitor setup.

just wanted to know that do i need exactly this same components sine it will be connected to my PC not TV?

author
Ardutronico (author)2017-01-15

I'll make this project when I have individually addressable LEDs and my Orange Pi (I will hopefully receive it next week). BTW, you should have soldered the strips before pasting them on your TV.

author
JohnM801 (author)2016-05-23

Nice project. But how do get the video into the raspberry pi? or are you using the raspberry pi to play the video?

author
SimoneU2 (author)2016-05-21

Hello, I want to do this project, but I do not understand some things, okay the raspberry pi 3 model b? LEDs are fine WS2812B? Best 60 LED / m or 144 LED / m? the system is the same for TV 4k? The system is independent and works with both tv that with the PC?

author
MichaelG75 (author)2016-04-02

Does anyone know if this is the same led strips just updated? 1m WS2812B RGB LED Strip, 60 Addressable Pixels, 60 per metre, DC 5V https://www.amazon.co.uk/dp/B00WONANSA/ref=cm_sw_r_cp_awd_ejcaxbZT57ZZS

author
CasperJ7 (author)MichaelG752016-04-16

read this http://www.tweaking4all.com/hardware/arduino/ardui...

for Raspberry pi ws2801 is the best :)

author
KeithC57 (author)2016-04-13

Will this work with a Raspberry Pi 3 (RPi3) Model B?

author
Humveeforce (author)2015-03-26

I have followed your instructions. Great tut. However, I am using Kodi now and a 50" TV with all 4 sides with LEDs. I am also using PiB+. So, almost everything is slightly different, but theoretically should work. Problem is, I only get the first LED to light. Sometimes red, green or white. I have tested that 5V is going all the way to the last LED so I know it has power. Any ideas?????

author
keshav2 (author)Humveeforce2016-01-21

hello,did you sort it out? I am having same problem here! I am kind of desperate please help me

author

Do you have a 5V buffer driving the I/O? If not, I would reckon that the 3.3V RPi I/O is just is not enough for the first WS2801 chip. If you have a buffer, check that your refresh rate (clock frequency) does not exceed WS2801 specs.

Anyway, an oscilloscope is always useful in debugging off-chip signals.

author

I followed the instructions in this video and the refresh rate is what is stated there and in the boblight wiki.

author

OK. I fast-forwarded through the videos, but did not see any mention of an output buffer. Thus, the system described here will work only by accident, i.e., depending on the length and thickness of the wires from RPi to the 1st WS2801, process variations, Vcc levels etc.

The WS2801 specs state that Vih=0.8*Vcc...Vcc, i.e., the lowest input voltage that is recognized as a logical one is exactly 4V with a 5-volt operating voltage. As your RPi has (apparently, I have only RPi2) an I/O voltage of 3.3V, the first WS2801 will correctly recognize '1' only by sheer chance. Getting erratic lighting functionality and the inability of the 1st IC to regenerate the input would very much fit an I/O voltage problem.

You can try reducing the Vcc for the LED strip until 0.8*Vcc is somewhere near 3.3V, but this would be rather stupid. I recommend using any 5V buffer IC that has a 3.3V-compatible input (or a lower 'high' threshold). A logic level converter would obviously also work, but I reckon a single 74-series IC harvested from an old junk PCB would be the best DYI solution.

author

Could you provide the easiest way to install Or set up a 5v buffer. Thanks

author

single transistor should do the trick

author

Unfortunately, that won't work. You need a path to drain the charge too. I reckon the absolute minimum would be 4 transistors (two inverters in series). Then again, constructing CMOS pairs with discrete components is risky at best.

author

See, now i'm a little bit smarter. Thx

author

Do you have 'eco parts' lying around? I used a 74ACT240PC as it was the first suitable IC i picked up from my stash. Obviously, I had to connect two of the eight buffers in the IC in series, as the function is inverting. Anyway, as I wrote earlier, the only relevant criteria here is the minimum high level input voltage, which is listed in the component's datasheet. The IC does not have to be a buffer, you can e.g. connect two NAND gates in series and get a non-inverting function.

If you have no used components to work with (or interest for a DYI build), I recommend buying a logic level converter, a.k.a., a level shifter. These run at about a dollar a piece shipped. See e.g.

http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&...

author

Im new to this. So i shift the di and ci to the strip up to 5v correct? Then i should be able to lengthen the wires to the strip with no issues? Thanks guys

author

Exactly. Each IC (on the LED strip) will regenerate the signal for the next LED, so if you get the signal correctly to the first LED, the rest will work as well.

If the first signal (RPi output) is no good, well, then the 'garbage in, garbage out' principle will take effect, and the LEDs _might_ start lighting up consecutively, but all data (colors) and timing will be completely random. Logical zero (0V) will obviously always be recognized, but the 3.3V RPi logical one will register correctly only by sheer luck as the minimum Vhi on WS2801 (with 5Vcc) is 4V.

author
GianS1 (author)2015-11-16

Dear Scott,

I've got a few questions.

1. Do you use RPi A or B? Yours looks more like A but you recommend B.

2. For the SD card, must it be SDHC? I don't really know what the difference is between that and a normal card.

3. What do you use the male/female headers for? How many do I need of those.

author
Kimberly2000 (author)2015-08-11

Okay, first let me say, "Awesome!" Without these videos and your video on Hyperion, I wouldn't have a working ambilight.

My only problem is that my RPi2 keeps flashing the color square on the screen while playing videos, and after a little reading I found out it is telling me that it is underpowered. This usually only happens during a bright scene in the movie, and last no longer than 2 seconds. However, it can happen any number of times during a single movie or TV show.

I've noticed that this has started to cause playback issues, with video freezing and once paused, I can't resume play.

Here is a list of things I did differently. I'm hoping someone will be able to tell me what corrections I can make to have my project be more successful.

Also, I'm not an electronics person, so dumb it down for me. Thanks!

Instead of cutting the end of the power cord and soldering directly to the RPi2 I used a barrel plug Y adapter. I used two barrel cables with on off switches between the Y adapter and the Pi an and the plug for the light strip. Last I put a barrel to micro USB connector inline with the Pi.

Instead of a 5V 3A power supply I went with a 5V 8A brick we had.

Other than that, everything is the same. I figured the 8A although split would be enough to power both the Pi and the strip.

Is there a simple way to keep the stuff I have and make it work properly, so that it will keep a steady flow of 5V going to the Pi?

author
ProxyProdigy (author)2015-06-17

In your video you show that you solder your power leads to the solder pads next to the cap. However, your pictures above show that you have 1 lead soldered to the outer solder pad and the other is soldered to TP1. Does it matter which you solder to?

author

To answer my own question, it appears that it does matter. When I soldered directly to the solder pads, the Pi wasn't getting enough power to turn on. When I moved the lead to TP1, the Pi was able to start.

author
Ruurdv (author)2015-06-12

Great tutorial. I just received all the needed parts in my mail and can't wait to get up and running.

I noticed that your version of Rasbbmc is not available anymore, they switched to OSMC. I've put OSMC on my SC-card and got it installed succesfully on my Pi, but.. i can't control it. The mouse isnt working at all. The cursor is all wierd, looks like it's stretched? Am i the only one having this problem? Anyone knows how to fix this? I've used multiple mouses!

author
Code_Runner (author)2015-05-25

Hi there. Can we do this with arduino instead of Raspberry Pi ?

author
e.ma.niak (author)2015-04-20

Hi, can i connect a WS2812 led strip like this? I mean, without Arduino.

author
e.ma.niak (author)e.ma.niak2015-04-25

i've built it with arduino uno and rpi b+, but it's slow and delays. compiling and instaling boblightd on osmc was pain in the butt. going to try Hyperion now, since
it supports ws2812. if it works, i'll make na instructable for dummies (as myself)

author

Only with Raspberry Pi 1 (A and B models). RPi2 support has been under development for a long time now, so I wouldn't hold my breath for that...

author
takeabigbyte (author)2015-04-16

Video 3 scares me off a bit, but I am so tempted to try this! I have a computer engineering background but it has been 6 years since I graduated, and I have only done light soldering work since then. I've decided. I AM GOING TO TRY IT!

author

Can I get a 5V 3A micro USB power supply and just plug it in directly to the Pi if I don't use a dedicated switch?

author

Why not. Then again, I would not recommend driving much more than 1A through RPi (from the micro USB to the GPIO 5V pin, that is). Besides, RPi has a fuse in the power input (1A in models A and B, and 2A in B+, if I remember right). Don't know about the fuse in RPi2, probably 2A as well.

author
iceidea (author)2015-04-23

Hi Scott,

Thx for this great Tutorial...

I started this project following every steps, and buying the same stuff except the Led Strip I've got already bought few months ago for experiments.

The Led is a 5050 GRB as shown in the pic of this link

http://www.enerled.co.uk/media/catalog/product/cac...

How can I use it in the project? How can I wire the RPI to this led strip with 12v, R, G, B pins?

Thanks in advance,

Ciro

author

Iceidea. You need an individually addressable led strip. Meaning one IC per led. For less headaches i would buy the ws2801 strip and be done with it.

author
javuvy (author)2015-03-27

Great tut! Thanks for sharing

Only one question. What's the final cost of the full installation? I think your system is cheaper than lightberry package, isn't it?

author
Humveeforce (author)2015-03-26

author
MarcoH1 (author)2015-03-26

this is really awesome. But after I watched the 3rd part, I think I'll just let it go...

author
mariosmax (author)2015-03-21

Hello GreatScott,
i want to make a similar prokect but i want to use a raspberry bi 2 and the WS2012b LEDs but i am not sure if thats possible because these kind of stripes do not have clock port. Any ideas ?

author
DavidL29 (author)2015-02-13

Hi there :-)

Do you thing this tutorial will work with the new Raspberry 2?

author
GreatScottLab (author)DavidL292015-03-13

I never tried it. But it should be possible with a couple of changes in the software.

author
MarkusS4 (author)2015-03-10

Hi Scott!

Thanks, this tutorial is great! I also want to build one ambilight.

I have one question regaring the lower side of the TV. You mounted the leds on 3 sides, Does the the boblight config support 4 sides to have full ambilight experience?

author
PeterF5 (author)MarkusS42015-03-12

In the config-tool you can pic LED's on the buttom as weel, so i think it's pussible :)

author
GreatScottLab (author)PeterF52015-03-13

Correct!

author
housepainter (author)2015-02-13

Thanks for this excellent tutorial!!! Very easy to follow.

As a result of my eagerness I did by mistake buy a led strip of the APA102 model instead of the ws2801.

Is there any chans that I can make it work with the APA102 strip or do I have to buy the ws2801 one?

This is the ebay site of the one that i bought: http://www.ebay.com/itm/351191941509

author
real_Napster1 (author)2015-01-07

for any reason my mod isn't working.... :(

Only the frist LED on the ws2801 lights up (white)

Nothing more.. Has anyone an Idea what could be wrong?

author

I bought this led strip:

http://www.aliexpress.com/snapshot/6403895430.html...

Can anyone help me?

I use a 5v 4A power supply for my raspberry Pi B (rev2, Same as in the Video), and atm a led strip of 24Led's for testing.

author
Wedgec (author)2015-01-03

Hi Scott, really looking forward to starting this tutorial. I'm a newbie with this sort of thing but believe how you've explained it will really help :) I just have a quick question about the LED's. I'm in the UK so was wondering if the below will be OK? I have a 50" TV if that makes any difference.

Thanks :)

http://www.amazon.co.uk/ws2801-digital-strings-Add...

author
GreatScottLab (author)Wedgec2015-01-08

They should work fine!

author
payamentezami (author)2014-12-02

Hey Scott!

My easy cap that I ordered using your link doesn't seem to be STK1160.. or maybe the firmware just needs to be installed? Can you point me in the right direction?

lsusb
Bus 001 Device 004: ID 1c88:0007 Somagic, Inc. SMI Grabber (EasyCAP DC60+ clone) (no firmware) [SMI-2021CBE]

author

I got the same one mate. Its apparently a lottery. There are four models which are impossible to tell apart from the outside. Here is a guide which might help you install the firmware: http://linuxtv.org/wiki/index.php/Easycap

Let me know how you go. Im new to linux and havnt managed to get it working yet.

About This Instructable

285,974views

356favorites

License:

Bio: Awesome Electronics Tutorials, Projects and How To´s
More by GreatScottLab:Make Your Own ESCDIY Short Circuit (Overcurrent) ProtectionMake Your Own Photovoltaic Off-Grid System
Add instructable to: