How to build your own Ambilight TV with Raspberry Pi and XBMC
I always wanted one of those colourful glowing large TV screens in my living room but I never felt like paying a fortune for it. So, why don’t do it on my own? I ordered two Raspberry Pis, which seemed like a perfect fit for a media center and a LED controller because of the built in SPI bus interface. After some research, I decided that using SMD LED strips with WS2801 chips would be the best match for a Raspberry Pi controller. Furthermore SMD strips are quite easy to mount, because of the adhesive tape on the back of the strip.
Demonstration
Hardware installation
We’ll setup the necessary hardware first.
Parts list
I’ve ordered following parts to complete the installation from boxtec.ch
1 x | 5V LED Pixel Strip 5m (WS2801) |
1 x | AC adapter 5V/10A |
4 x | RGB LED Strip – Pigtail Connector 20cm (pair) |
1 x | Heat Shrink Kit |
1 x | Breadboard Jumper Wire m-m (65-cable pack) |
1 x | 1pin dual female jumper wire (300mm) 20pcs. |
1 x | 5.5 x 2.1mm DC Power Jack Adapter (f) |
1 x | 2pin dual female jumper wire (300mm) 5pcs. |
2 x | Raspberry Pi Model B |
2 x | 8GB SD memory cards |
1 x | 1A MicroUSB AC adapter |
You’ll also need tools for soldering. Alternatively, you could use just one Raspberry Pi, which will act as the LED controller and the media center.
LED power consumption
Regarding the spec sheet, the 5 V LED strip consumes approx. 7.68 Watts per meter or 1.5 A. To calculate the total power consumption, we need to measure how many LEDs we can put on the TV’s back. I needed 3.8 m of the SMD LED strip for my 55 inch TV.
Power supply calculation
Total power consumption: 3.8 m LED strip x 1.5 A + 1.0 A Raspberry Pi Model B = 6.7 A / 33.5 W.
Fortunately, the Raspberry Pi requires also 5V, so you’ll be able to power up the strip and the Pi with the same 5V power supply. Just don’t forget to order a DC Power Jack Adapter for easy connectivity of the at least 7 A / 35 W – 5V power supply.
LED strip soldering
As a Software Developer, I’m not an expert in soldering but I tried to do my best. Cut the strip into 4 pieces that match your TV dimension. For easy replacing of a broken LED strip or moving the installation to another TV connect the stripes with pigtail connectors.
WS2801 LED strips have always four connectors. In my case with those pinouts:
- 5V
- GND
- SD
- CLK
Be careful, don’t twist those between the pigtails! There’s also an arrow on the strip, which marks input / output. Make sure you’re able to connect the strips from input to output with the pigtail connectors.
It’s easier to solder the connectors to the fine SMD if you put some soldering to each of the four joints in advance. Finish it up with a heat shrink, for more flexibility use non-adhesive heat shrink tubes.
LED mounting
Now, we’re coming to the fun part. It’s barely easy to mount the strips because we chose SMDs, just use the adhesive tape and you’ll be fine. It’s essential that you start mounting from the bottom right, seen from the back of the TV with the arrow on the strip pointing to the right. Later, you’ll connect from the GPIO from the RPI directly to this input of the strip. Then go ahead counter clockwise, connecting the output of the first strip to the input of the second strip and so on until you reach the bottom left. The output of the last strip is left empty, so the strips are not connected in a loop.
LED strip wiring
Wire the LED’s up as shown in the following diagram created by Philip Burgess. Please note, the diagram shown, is for the Rpi revision 1.0. This could slightly change with later revisions. Make sure the input +5V/GND connectors of the strip and the Raspberry Pi power connectors are directly connected to the DC Power Jack Adapter (DC Jack).
There’s no need for the Pi’s micro USB port anymore. I’d suggest using Breadboard Jumper wires for proper connections to the Pi’s breakout board. Leave the output connectors of the LED strip as they are.
Prototyping: All wires connected to the Raspberry Pi.
Final outcome: Raspberry Pi in black enclosure and power supply wired up.
Software installation
So, the hardware is prepared. In this section I’ll show you how to setup two different applications on the Raspberry Pi to control the LEDs. You have to chose one of them, I’d recommend Hyperion for various reasons.
Hyperion
Hyperion is newer, features a JSON interface and is easier to setup than Boblight. It is also less resource hungry. Therefore we can easily run XBMC and hyperion on the same Raspberry without performance issues.
- Install a media center distribution for the Pi. I recommend Raspbmc for beginners, it’s easier to install and less locked down.
- Boot up Raspbmc and remote login with your host computer. You’ll find the IP in XBMC under Settings -> System Info. If you’re on Windows, use putty for the ssh connection.
// Password is: raspberry ssh pi@raspbmc-ip
Prepare hyperion installation
// Create new folder in the pi user home mkdir hyperion && cd hyperion // Download hyperion installation script wget -N https://raw.githubusercontent.com/tvdzwan/hyperion/master/bin/install_hyperion.sh // Make the install script executable sudo chmod +x install_hyperion.sh // Make sure boblight is not running in the background sudo /sbin/initctl stop boblight
- Install hyperion, it will also be added to your autostart.
// Install all necessary packages for hyperion sudo apt-get update && sudo apt-get install libqtcore4 libqtgui4 libqt4-network libusb-1.0-0 libprotobuf7 ca-certificates // Execute the hyperion installation script sudo sh ./install_hyperion.sh // Hyperion should be running now, stop it again sudo initctl stop hyperion
- Now we create the hyperion config file which includes for example the LED position informations. It’s a very readable JSON format. The configuration can initially be generated by a Java tool called “HyperCon”. Have a look at the instructions page. Download HyperCon to your Host computer where Java must be installed. If you followed the LED installation instructions above, the following settings should give you reasonable results for a start. Please adjust the LED counts and the 1st LED offset for your setup on the “Hardware” tab. We want the LED offset to line up with the LED closest to the initial input, which is connected to the Rpi GPIO. Then click “Create Hyperion Configuration” and save the json file to your Desktop. Don’t rename the file.
- Let’s copy “hyperion.config.json” to the “pi” user home directory on the Raspbmc. You can easily copy the file by using the shared folder “raspbmc”. Make sure you put it in the folder pi/hyperion. Alternatively you could use SCP for copying the file.
- Back on the Raspbmc ssh shell, copy the configuration file to the place where it will actually be picked up by hyperion at boot.
// Hyperion will by default look for the configuration at "/etc" sudo cp hyperion.config.json /etc // Start Hyperion sudo initctl start hyperion // Test if the configuration works, all LEDs should light up red for 5 seconds hyperion-remote --priority 50 --color red --duration 5000
- We’re nearly finished. Hyperion grabs the color information directly from XBMC over an interface running on port 9090. We configured this in HyperCon, tab “External”. By default, this remote interface is disabled. In XBMC goto Settings -> Services -> Remote Control and activate both options. Reboot the system.
- We’re finished, play a movie or display some pictures and the LEDs should light up. The LED are disabled in the menu, you could easily change this setting in /etc/hyperion.config.json, look for “xbmcVideoChecker”.
- If you’d like to use the LED as mood lights simply install following excellent app and point it to the Raspberry Pi with port 19444: Hyperion for Android. For non Android users, there’s also a web app available.
Boblight
I’d recommend using ArchLinux as distribution for the Raspberry Pi, it boots in less than 10s to the command line.
- Go to http://archlinuxarm.org/platforms/armv6/raspberry-pi and follow the instructions.
- Boot up the Pi and remote login: ssh root@raspberryip password is root.
- Create a new directory and switch:
mkdir boblight && cd boblight
- We’ll install a resource optimised version of boblight for archlinux.
pacman -Sy git gcc make libx11 libxrender portaudio libxext mesa glu ffmpeg bc nano
This will install all required packages for the boblight installation.
- Let’s checkout the optimised boblight source.
git clone https://github.com/werkkrew/boblight-archarm.git
- Next commands will actually install boblight.
// Move into the cloned git repository cd boblight-archarm // Build and install boblight ./configure && make && make install
Now, configure ld.
// create and open a new file usr-local.conf nano /etc/ld.so.conf.d/usr-local.conf // in the file, type /usr/local/lib and save with ctrl + x /usr/local/lib // Make sure the file is closed and then execute ldconfig
Lets configure Boblight as a deamon so it will autostart after Archlinux was booted.
// Create a new boblight service script nano /usr/lib/systemd/system/boblight.service // Then insert following snippet into the file and save Description=Boblight Ambient Lighting Daemon DefaultDependencies=no After=network.target [Service] ExecStart=/usr/local/bin/boblightd Restart=on-abort [Install] WantedBy=multi-user.target
Register the script as a deamon.
// Register the boblight script systemctl enable boblight // Start the deamon systemctl start boblight
Boblight should now be installed and running in the background. For more details, have a look overhere: https://github.com/werkkrew/boblight-archarm#installing
- Now generate the boblight config file. Switch to the boblight checkout directory create on step 3 and make the config script executable.
chmod +x makeconfig.sh
Then execute the script
./makeconfig.sh
The script will ask you for the exact LED count mounted on each side of your TV. Use the default values for all other inputs. Wait till the script is ready, then copy everything between “——- Light section starts here ——” and “——- Light section ends here ——” into a text file on your host machine (Not on your Pi). Write down the total LED count.
- Download this preconfigured config file: SPI-WS2801-basic and open it with a texteditor on your host machine. Add your generated light section simply to the end of the file. Multiply your total LED count by 3 (RGB channels) and replace “369” with your result in the file. Then select all and copy.
- Create the actual boblight config file with
nano /etc/boblight.conf
on your Pi and paste the content of your modified config file on the host machine into it, this will take some time to complete.
- Lets test the LED config.
// Stop the deamon systemctl stop boblight // Manually start boblightd boblightd
Check the output for errors.
- We’re getting closer, try firing the LEDs up. boblight-constant BB55AA All LEDs should light purple.
boblight-dispmanx installation
So, we’ve managed getting boblight to control our LEDs. Now, we’ll see how to setup another tool for sending captured screen color information right to our boblight deamon, it’s called boblight-rpi. Perform the following steps on the Raspberry Pi, that will be running the media center. A media center for example XBMC, running on this Pi will act as the video input source. Everything played on XBMC will be captured by boblight-dispmanx and sent to boblight.
- Install the newest version of OpenELEC (XBMC distribution) on your Pi: http://wiki.openelec.tv/index.php/Installing_OpenELEC_on_Raspberry_Pi#tab=Linux
- SSH to the OpenELEC Pi:
mkdir boblight-dispmanx && cd boblight-dispmanx
Checkout the source code
wget https://github.com/brooc/boblight-rpi/raw/master/src/boblight-dispmanx
Set execution permissions to the precompiled boblight-dispmanx binary.
chmod 755 boblight-dispmanx
- We have to configure the tool to actually send the captured screenshots of the TV screen to your Pi Boblight server. Create an autostart script:
nano /storage/.config/autostart.sh
Paste following sample config into the file.
#!/bin/sh /storage/boblight-dispmanx -b on -s {archlinux-pi-ip}:19333 -o interpolation=1 -o speed=70 -o threshold=35 -o autospeed=0 -o saturation=3.0 -o value=1 -p 100 -i 0.2 -f /dev/null &
Don’t forget to replace the {placeholder} with the IP of your boblight running Pi or set it to “localhost” if you went for one Raspberry Pi. Then save the script and make it executable with
chmod +x /storage/.config/autostart.sh
- We’re done, just restart the system
sudo reboot
- Check the setup with a RGB test video. If you think the colours are to pale, try a higher value for the “-o saturation” parameter. When the lights are to slow, try setting “-o speed” to 90. If you don’t like the LED’s in the XBMC menu, just remove the “-b” parameter.
Conclusion
This is a really educational project, which will give insight into a lot of interesting technical areas reaching from compiling in the Linux shell to soldering and calculating LEDs power consumption.
For now, you’re bound to XBMC as media source for ambient light your environment. If you want to go a step further and use every HDMI input signal as media source, have a look at this how to: How to build an Ambilight for every HDMI input source
If you have any question, feel free to ask in the comments section. Enjoy your ambilight!
I think there is one small typo in the hyperion section. Rather than:
“sudo cp hyperion.configuration.json /etc” I think it should be “sudo cp hyperion.config.json /etc”
I am also running into an odd problem. My lights don’t seem to be showing the right color. They respond to the commands and the Hyperion Android App but don’t seem to be the right color. For example when I run the test hyperion-remote command, they light up but they aren’t all red. Similarly when I use the color wheel or effects on the Hyperion Android App they don’t all seem to go to the right color. I still haven’t cut any or it so I only have a couple of soldering connections to check, but any other troubleshooting ideas to make sure they all display the proper color that is being passed along ?
Hi Dave, thanks fixed the typo. That’s strange, maybe the RGB byte order is wrong? What colour is displayed if you send blue to hyperion with the app? You can adjust the RGB order in Hypercon or directly in the hyperion.config.json file.
Regards Chris
Hi all,
I live in the US and was wondering if there’s an alternate site to order the parts from.
Thanks much,
Sam
Hi Sam, the parts should be easy to find on amazon.com and their electronics resellers.
Hi Chris,
Thank you for your help, I really appreciate it.
Would have 2 more questions if I may.
As there is not much difference I assume that this guide would work with a RPi B+ model as well, right?
How about a Banana Pi? I know that they are not fully compatible but as the Banana has stronger hardware and I have not purchased my RPi yet I was thinking of buying a Banana instead.
Any chance to make a similar ambilight guide for Banana? Not sure how many people would be interested in it though.
Thanks again.
Best regards,
Peter
Hi Peter, RPi B+ should work as well. The first 26 pinouts are as the Model B. I have no experience with the Banana Pi, but since it features a SPI, it should be possible to use it as a LED controller but you have to check the pinouts they could be different than the Rpis.
Regards Chris
Finally a full tutorial on this! I can’t wait to try it
Quick Question under the LED Mounting section. You say ” It’s essential that you start mounting from the bottom right, seen from the back of the TV with the arrow on the strip pointing to the right. Later, you’ll connect from the GPIO from the RPI directly to this input of the strip. Then go ahead counter clockwise, connecting the output of the first strip to the input of the second strip and so on until you reach the bottom left.”
By this description, it sounds like the RPI would plug into the IN which would be in the lower left hand corner. When I look at the pictures, it looks like you have a connecter between the far left hand top-to-bottom strip to the bottom left-to-right strip. Did you split your bottom row into 2 sections because of the stand of the TV being in the way ? I wondered this because in the Hyperion config with the offset it looks like #0 starts midway on the bottom.
Do we want the Hyperion LED #0 to line up with the LED closest to the initial input ?
Thanks for any clarification,
Dave
Hi Dave,
You got it right, I mounted 5 parts of the LED strip (yeah I like soldering :-)) starting from the bottom-midway-right. Since I connected the GPIO of the Rpi to this input, this is where we want to set the hyperion offset start.
exactly. Will put that in the tutorial.
Regards, Chris
Hi Chris,
I recently bought my led strip to start this project myself.
However when I tried to test the strip by directly connecting it to the power supply (5V / 10A) only I led lights up (13th from the start).
I starts getting brighter and brighter (white/light blue color) then it goes out and it start all over again.
Does it mean the led strip is faulty?
Even if only one led is working, shouldn’t it stay lit while it’s plugged in?
Thank you for your advice in advance.
Best regards,
Peter
Hi Peter,
Well, since it’s an special pixel LED strip, it won’t probably behave correctly if you don’t send any signals through the SPI interface. So, the best way to test the the strip before mounting, would be installing hyperion, create a config that matches the total LED count of your strip with HyperCon and call: hyperion-remote –priority 50 –color red –duration 5000. This should light up all LED in red for a period of 5 seconds.
Hope this helps, Chris
Thanks Chris !
I imagine the outcome would involve a bright flash and then that sickening sweet smell that accompanies the failure (not that I am speaking from experience lol).
Thanks again for the guidance,
Dave
I will be attempting this project but was curious about connecting the power to the LED lights. Do you have to put anything in between the power supply and the lights such as a resistor based on the Power Supply equation ? I am going to power the Pi on Micro USB dedicated power (I have fried one before so that’s why I am double checking so I don’t fry the lights).
For example if I cut a test strip of lights that is 1 meter long, can I just plug this into the power source (5V 10A adapter), or do I have to use the equation above to make sure that I don’t overpower the lights.
Thanks for any advice.
Dave
Hi Dave, glad to hear that you’re going for the project.
Well, if your power supply delivers 5V and you take care of the polarization (+/-), you can directly connect it to your 1m 5V test LED strip. Since the power supply and the LED strip are both built for 5V, you don’t need a resistor to adjust the potential. Just really make sure, that you don’t mix up the polarization. Since you use a dedicated power source for the Rpi, you just have to connect the 5V power supply to the strip, don’t connect the power supply to the GPIO of the Rpi as shown in the guide with this approach. (I don’t know what would happen to be honest :-/)
Hope this helps, regards Chris
hello, can i use this project at xbmc which is installed on raspbian?
Hi, you should also be able to install hyperion on raspbian. I might slightly differ from the guide, though.
Hello Mr. Moser,
First of all I want to thank you for such a good tutorial for ambient lighting, very educational. I have a question, where are the jumper wires connected to from the GPIO? Does it go in the input side( from the left side/downward direction (looking from the back side) of the TV? I doubt that the LED Strip is connected in a loop all around.
Thank you for your time.
Hello, you’re welcome!
I’m not quite sure if I got your question. You connect the GPIO connectors of the Rpi to the input side of the first LED strip. Then you connect the output of the first strip to the input of the second strip and so on.. The output of the last strip is left empty, so it’s not connected in a loop. You should mount the strips counter clockwise if you look from the back of the TV.
Regards, Chris
Hi Christian,
Brilliant guide! I’ll be following it closely when my hardware arrives. One question: The guys at Hyperion have noted that they prefer to keep the power supply for the LEDs separate to the Pi. Naturally, in the example above, the supply is being shared between the LEDs and the Pi. What’s the easiest way to keep the supplied separate? Is it as simple as not connecting the GND to the GPIO?
Thanks.
Hi Josh,
Thanks, I’ll wish you good luck! 😉 Yes, I went for a powerful power supply to power the LED’s and the Rpi, which works pretty well. If you go for the separate solution, just power up the Rpi by micro USB and don’t connect anything to the Rpi’s +5V/GND connectors. Then connect the LED power supply directly to the +5V/GND connectors of the LED strip.
Regards, Christian
I forgot to mention that I’m running XBMC openelec not raspbmc, will this guide work regardless?
Thanks!
The installation process of Hyperion is slightly different, check this guide.
Hi Christian,
I’m fairly new to this and there’s something I don’t understand (it’s probably a stupid question) When you mention HDMI are you talking about the HDMI on the pi? How do you connect the pi to your TV? I connect mine via HDMI through an amp. Do I have to follow the other guide in order to make it work with my pi or is this guide enough?
Thanks!
Hi Fernando, sorry for the late reply but was in vacation overseas 🙂
If you just want the ambilight effect for content you do playback with XBMC running on your Rpi, this guide is all you need. It’s slightly different to install Hyperion on Openelec but it’s documented in the Hyperion wiki the rest of the process is identical.
If you have other HDMI (video) sources for example PS3, XBox, blueray player etc, you’ll need to follow this guide as well.
Regards, Chris
Christian,
What kind of GPIO connectors did you use? I was only able to find 6″ female jumper cables, so I’ll have to splice some additional wire to that and then splice again to the LED wires. Is that how you did it?
Hi, I’m using “1 pin dual-female jumper” and “2 pin dual-female jumper” cables for the connection to the Rpi GPIO. Then I spliced them to the LED strip pigtail connector. I had to extend the wires to the appropriate length, the jumper cables were just 300 mm.
Hope this helps, Chris
Great write-up… looking forward to building this out. One question for you… my TV and Pi are about 10 feet apart (the Pi’s sitting in a cabinet). Any suggestions on the type of wires I may need to support that length?
Thanks,
Sam
Hi Sam, well we could calculate the voltage drop but I would go for the biggest jumper cross-section cable you can find. In addition, test the setup first with shorter cables, just to make sure your setup works. Then try it with the 10 feet. If you have issues, you can still play around with bigger cross-sections for the 10 feet.
Regards, Chris
Thanks for pointing me in the right direction. The dev was the key. They were not present and I found a post that mentioned you need to comment out the spi device line in /etc/modprobe.d/raspi-blacklist.conf. Once I did that and restarted hyperion the LED stip reacted to the android tool. Although, now it looks like the last 2-3ft section does’t change. just stays orange. I hope that doesn’t mean it’s bad…..took 3 weeks to come in from china and cost $110
I took on this project and I have everything connected but the LED strip only lights the first light which reacts anytime I touch the wires. Either by flickering through the colors or going off. the wire I used was 22 AWG. I feel like that should be enough, but should I be using 20 or 18 AWG? It seems that there is a bad connection but all seem stable. I’m going to see what I can do tonight, but wasn’t sure if you experienced anything similar or know what would cause that.
Well, I have this behavior sometimes when my Rpi is powered off. I’d double check the connection to the SPI pins. Also check the hyperion config json, did you set the “output” to “/dev/spidev0.0” (device section) or maybee your SPI interface is mapped to another index?
Just so I’m understanding this correctly…. If you go with Hyperion and XMBC then you only need one Pi, if you use Boblight then you will need two?
Exactely 🙂 Maybe you’ll get satisfying results if you just use one overclocked Rpi and boblight. But I would recommend Hyperion anyway.
can i use a mac mini instead?
Hi Alex, no you can’t. You need a LED SPI interface for the LEDs. But you could use an HDMI splitter and build this setup: http://techtalk.christian-moser.ch/wordpress/?p=562 instead. So you’ll be able to use a mac mini as mediacenter.
I’m thinking Raspbmc and Hyperion is the way to go as you stated in the tutorial..how do I miss these things…
Exactly, one Pi is sufficient with hyperion, good luck! 😉
Getting ready to start building this, finally! Reading through the tutorial again, I see you built this using two Pi’s. Is there any reason you didn’t set this up on one? Is performance an issue?
Hello
I would like to build an ambilight for my 58″ TV but the problem is that I have never worked with a Raspberry Pi in my entire life. Can you please explain at a lower level so I can make one at home as well. I tried doing one with arduino but it requires a laptop plugged in constantly so I though of searching how to with a Raspberry Pi.
Thanks,
Sid
Hi Sid
I already tried to explain the setup process step by step. Perhaps you start first with some beginner guides and have a look at the documentation.
Regards Chris
I am using my computer as my media center my CPU is connected to my TV. So, is there any way i can implement it with my CPU it has arch installed with xbmc.
Hi Nitesh
You may use your current media center but then you have to go this path: http://techtalk.christian-moser.ch/wordpress/?p=562 since you’ll need a SPI controller for this purpose.
Regards Chris
Instructions were good. But my blue and red are swapped and I have no clue how to fix it Any ideas on how to do an override.
Hi, try in Hypercon to set “RGB byte order” from “RGB” to “BGR”. This should fix this behavior.
Regards Chris
I’m having problems with my setup. I bought an 5V/10A adapter. I couldn’t easily tell which side to plug the the Red or Black wires into. (Due to the jack only having plus and minus listed) I put the Red into the positive and the Black into the negative. When I plugged in the AC Adapter the pi got very hot and started smoking. Now when I plug it in I get a red light on the power LED and the central chip gets hot.
I’m unsure as to what I did wrong and I think I’ve killed my pi. How should I go about figuring out how to fix this?
Thanks!
Hi, It seems like your Rpi is broken due to overvoltage. I’m sorry about that.
Well, are you sure that you have a 5V/10A power adapter? You could verify the voltage and polarity of the adapter with a simple voltmeter. Furthermore, did you connect the positive red wire from the DC jack to the 5V pin on the Rpi and not to the 3V pin?
Regards, Chris
@Christian Moser: yes, it was activated allready cause of yatse. this should not be the problem.
I found out, that there are two players for video: OMXPlayer and DVDPlayer. Don’t know if that could be the issue but the fix is to deactivate the whole xbmcVideoChecker-section. I’ll give it a try tonight.
Source: https://github.com/tvdzwan/hyperion/issues/101
Hi,
thanks for the tutorial. Almost everything works instead the grabbing of movies. Series are working but at movies (hd, mkv) the leds are dark. In settings grabVideo is set to true.
Any hints? Thanks!
Regards
Well, this is really strange because there should be no difference between series and movies. Did you enable “allow remote control from external apps” in XBMC and performed an XBMC restart?
Hi Christian.
Thanks for the tutorial, I have a 12v rgb led strip my conectors are 12V+ – GND – R – B. I will use and external 12v adaptor buy my question is on the Diagram shows that I need to connect DI and CI to the raspberry you have any idea if DI = R on DI=B ?
Thanks
Hi Juan, I’m afraid, I’m not sure about the connectors. I’d try to find a proper spec sheet to make this clear. Otherwise, just play around but make sure you connect 12V+ and GND- correctly or you might harm your LED strip.
Regards Christian
Thank you for this great article. I followed your instructions and you can see the result here: http://youtu.be/lnx_futkSQ8 (Very very poor video quality). A lot of room for improvement, will repeat for other setups. 🙂
Yes, really nice, I like it!
Hi Christian!
Thanks for this tutorial.
I have one question regarding hyperion.
Is it also possible to connect Hyperion to an external XBMC player?
I made my own Linux XBMC player based on Openelec.
So if I change the ipaddress in Hyperion to my external Openelec XBMC player it should work too? In this setup my Raspberry is only the controller.
Regards,
Jacob
Ok, this won’t work because this connection to XBMC is only for enable/disable the framegrabber. The actual color information for the LED are grabbed directly from the device running XBMC.
Hi Jacob,
this should work but I didn’t test it out.Just put the ip address of your XBMC machine in Hypercon instead of 127.0.0.1 and make sure port 9090 is not blocked by the firewall. This should point the XBMC Checker to the remote XBMC machine.
Let me know if it worked.
Regards, Chris
Great tutorial ! Would it be possible to post some pics on how the leds are connected to the pi? Not a great electrician myself and some pics would help me out. Thx alot !
Hi pengo, check this image out -> led cables SPI (grey, violet) and Pi power cables (+red and black) connected to the Pi with female jumper cables. Make sure you connect the LED power cables directly to the DC power jack adapter also shown on the image.
Regards Christian
@Christian,
Thanks!! I found this on ebay, and it says 5050SMD http://www.ebay.com/itm/331069796676 I’m a n00b when it comes to LED’s, and a novice electrician at best.
Christian,
Thank you for putting this tutorial together! I live in the US and would like to find a LED strip that costs less than $100 plus shipping. I found many on a chinese direct shipping website, but not sure what to order. Do you have specs for these so I can be sure to order the right one? I plan on powering the LED’s separately from the PI.
Hi Brandon, well just make sure you order a 5V SMD pixel LED strip with WS2801 ICs and a 5V power supply. Other chips are also supported by Hyperion/Boblight but not covered in my how to. Chinese direct shipping is most likely the cheapest option. Otherwise those should also work: http://www.amazon.com/length-individually-addressable-SMD5050-Non-Waterproof/dp/B00C3ZR90O/ref=sr_1_2?ie=UTF8&qid=1400658121&sr=8-2&keywords=smd+led+ws2801
Kind regards Christian
Hi Christian,
I don’t understand why one would need two raspberry pi? Am I missing something? Looking forward to trying this. Always wanted Ambilight, but never wanted a Philips TV.
Regards,
Carl
Hi Carl, if you take on the Hyperion approach, you’ll need just on Raspberry because Hyperion is much less resource hungry than the first Boblight versions compiled for the Raspberry Pi.
Regards, Chris
Hi Christian,
This looks great… thanks for writing it up and for going into so much detail!
I noticed that in the video you posted (the Lion King one especially) there appears to be a slight lag between what happens on screen and the LEDs changing. Is that not a problem with scenes where there’s a lot of action going on?
It’s the kind of thing that would really bug me and I wouldn’t want to spend my time (and money) doing this if it just annoyed me :/
Also, correct me if I’m wrong but if I were to go with the Hyperion option I would only need the one Raspberry Pi… correct?
Hi Remy, that’s correct, you’ll need just one Raspberry Pi and XBMC and Hyperion will work flawlessly on the same Pi.
Well, when you’re focusing on the screen and not the colors you won’t most likely notice the really short delay. Especially in action movies with fast moving pictures the color effect won’t be that intense anyway. But in the end, everybody has their own taste.. and if you don’t like it, you can still use it as a quite powerful ambient light lamp mounted invisible on the back of your TV. 😉
Regards Christian
Hi Christian,
Excellent guide! And it came right on time for me. But I got a couple of questions…
Currently I am having a couple of problems with my setup to watch movies on my TV. Most formats aren’t compatible with the TV or the Home Cinema system, and the only solution I see is connecting a PC to the TV (not my favorite solution). Would this Raspberry Pi setup solve this problem? I mean, will it need to do encoding or streaming? Or does it work like a regular PC and will read anything that he reads from disk and just output it to the screen?
Also, where did you find those componentes? I am struggling to find them.
Thank you!
Hi Pedro, the Raspberry Pi is a computer and with XBMC installed, it’s a media center capable of encoding, streaming blue rays movies from a NAS, external HDD, etc.
You could find the components most like on Amazon, ebay or any big local electronics distributors.
Hey Christian
That’s a really nice tutorial and big thanks to you for it. I just have a small question for you though .. Is it possible to buy a 12v led strip and power it with a 12v power supply separately and leave the pi powered with the regular micro USB power adapter? The reason I ask you is because the 5v pixel RGB led strip and 5v power adapter are not very commonly sold in India.
Regards
Rohit
Hi Rohit, you’re welcome! That should be no problem, just use a regular 5V phone power adapter (at least 0.7A) and connect it with a micro USB cable to the Raspberry Pi. Connect the 12V power supply directly or with a DC jack to the +12V/GND connectors of the 12V led strip and it should work.
Regards Christian
how much would it cost me to just pay you to make another one ?
thanks
Hi Brandon, I consider the purpose of this project is learning and not doing business. So, I encourage you giving it a try it’s really not that hard.
Kind regards, Christian
This is amazing- thanks for the write up! But I’m sure there are a lot of folks out there like myself and Mitchell who have already invested a TON of time setting up an XBMC media pc (mine is on Windows 7) who are DYING to know how to do this, building on what we already have. Is there anyone out there who would know or would dare to experiment?
Hi Andre,
You’ll need some piece of hardware that features a SPI bus controller, otherwise you won’t be able to control the LED’s. One of the cheapest options is a Raspberry Pi. Then on the Pi, you’ll need just to install hyperion and a compatible USB video grabber (STK1160 chipset) as described, you don’t need to use or install XBMC on that machine.
Now all you have to do is to connect the S-Video output of your Windows 7 graphics card to the USB video grabber S-Video input, directly. When your graphics card is able to output video on HDMI and S-Video simultaneously, your fine. Isn’t there any S-Video / analog simultaneously video out on your existing media center, you’ll need an HDMI/DVI to analog converter and eventually an HDMI splitter to convert your HDMI signal or you could go for an display port to composite converter like this.
Hope this helps.
I hate to sound like a spelling Nazi, but really, making the same mistake over and over again is really annoying to me. “Quiet” means to make little or no noise, “quite” is the word you mean to use, referring to the utmost or most absolute extent or degree; absolutely; completely.
Hi Samwyse , thanks for that piece of advice 😉
Hi, I already have xbmc already running on a media pc, is there a solution to incorporate this? Also any chance of a solution to get it working with the ps4?
Hi Mitchell,
I’d suggest to go for the USB grabber solution, maybe you can get hyperion to work on your media pc. With a grabber and and AVR, you’ll be able to ambient light your ps4 or other any HDMI input source. Please, check this post for further details: http://techtalk.christian-moser.ch/wordpress/?p=562
could you possibly compile a image file and upload it for us to download? Im having problems at step 4
thanks Marc
Hi Marc,
I won’t create an image. Could you be more specific about your problem?
The guide is now updated with an additional application how to. I recommend using Hyperion instead, it’s easier to setup and offers the better experience.
Regards,
Christian
Please make sure, the “boblight.service” script exists at “/usr/lib/systemd/system/”. Then try again with: systemctl enable boblight.service
For a detailled systemd guide, please have a look here: https://wiki.archlinux.org/index.php/systemd#Using_units
Regards,
Christian
Thanks for your help again, that works, thank you.
Now I’d like to register the script as a deamon and get this:
[root@alarmpi boblight-archarm]# systemctl enable boblight
Failed to execute operation: Invalid argument
Thank you for answering all my questions, unfortunately I’m relatively new to Linux.
Regards,
Stefan
Hi Chris,
thanks for your quick reply and your help, it is highly appreciated!
I’m trying to checkout the boblight source code but it says that it’s not a git repository…
[root@alarmpi boblight]# git checkout https://github.com/werkkrew/boblight-archarm.git
fatal: Not a git repository (or any of the parent directories): .git
Any suggestions?
Thank you in advance.
Regards,
Stefan
You’re welcome.
Try this: git clone https://github.com/werkkrew/boblight-archarm.git, then move into the newly created directory “boblight-archarm”.
Regards,
Chris
Hi Christian,
I’m also stuck on step 4,
when I try to install boblight I just get
“-bash: ./configure: No such file or directory”
[root@alarmpi boblight]# ./configure && make && make install
-bash: ./configure: No such file or directory
Can you tell me where I went wrong?
Thanks for your help.
Regards,
Stefan
Hi Stefan,
I’m afraid, I forgot an important step after rewriting this chapter. You have to checkout the boblight source code, before calling ./configure && make && make install. Please, have a look again, it should be more clear now.
Regards,
Chris
Hi Chris,
thank you for the quick reply, now I understand it. When I asked how it was hooked up I thought the TV was acting as the input. That is why it was confusing at first. Now it’s clear.
One solution I found was using an hdmi splitter and then a hdmi->composite converter and then a usb composite grabber. Or what I would like better is using the TV itself as an output source so I can even use the ambilight when for example I use my external HDD with the TV.
Anyway, thanks for your help again and good luck with your projects.
Regards,
Peter
Hi Christian,
thank you for the tutorial, great help as I am planning to build an ambiligth for myself.
The video source part if however a little unclear. I understand that boblight-dispmanx provides screenshots but how does the Pi receive the video signal?
How is it hooked up to the TV? Did I miss some part of the walkthrough?
Regards,
Peter
Hi Peter,
You’re welcome. I tried to explain the video source part a bit more in detail. The Pi is hooked up to the TV with a HDMI cable. The media center (OpenELEC – XBMC), running on the Pi will be acting as the video input. So everything that is played with XBMC will be captured by boblight-dispmanx and sent to boblight.
I’m working on another solution that decouples the ambilight from a media center so that the input signal is actually from a HDMI source.
Regards, Chris
This is very interesting however what do you use for video source? Are you using a webcam for calculating video source or video source played from PI?
Thanks Pierre,
The video source is boblight-dispmanx running on the Pi. The application captures screenshots from the Pi’s video driver and sends the color information to boblight, directly.
I’ll try soon to capture the video output from my AVR, so that the system will operate without the need off boblight-dispmanx. Stay tuned.
Regards, Chris
hey I’m lost after the point 4. how do I get to the config
Hi Alain,
I tried to describe Step 4 in more detail.
Let me know, if you still have problems.
Regards, Chris