How to build your own Ambilight TV with Raspberry Pi and XBMC

Posted byChristian Moser Posted on20. February 2014 Comments241

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).

Connect WS2801 to Raspberry Pi Model B

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.

  1. Install a media center distribution for the Pi. I recommend Raspbmc for beginners, it’s easier to install and less locked down.
  2. 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
  3. 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
  4. 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.
  5. 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.
  6. 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
  7. 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.
  8. 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”.
  9. 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.

  1. Go to http://archlinuxarm.org/platforms/armv6/raspberry-pi and follow the instructions.
  2. Boot up the Pi and remote login: ssh root@raspberryip password is root.
  3. Create a new directory and switch:
    mkdir boblight && cd boblight
  4. 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.

  5. Let’s checkout the optimised boblight source.
    git clone https://github.com/werkkrew/boblight-archarm.git
    
  6. 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

  7. 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.

  8. 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.
  9. 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.

  10. Lets test the LED config.
    // Stop the deamon
    systemctl stop boblight
    // Manually start boblightd
    boblightd

    Check the output for errors.

  11. 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.

  1. Install the newest version of OpenELEC (XBMC distribution) on your Pi: http://wiki.openelec.tv/index.php/Installing_OpenELEC_on_Raspberry_Pi#tab=Linux
  2. 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
  3. 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
  4. We’re done, just restart the system
    sudo reboot
  5. 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!

Category

241 People reacted on this

  1. Hi Christian,
    Thanks for this good article.
    I connected a WS2801 to the GPIO of my RPi, all powered by a 5V/12A power supply. The RPi turns on pefectly with this, but not the led strip.
    I’ve read that the first led should turn on when the strip is powered correctly but it is not. Should it turn on when not connected to the RPi?
    When touching the strip close to a led, the green light turns on for each led, so I guess the strip is working. Do you think it can be a connection problem? Is it a common issue?
    I did not solder anything yet, but powering the RPi works like a charm this way.
    Thanks

    1. Did you connect the clk/data correctly? Seems like the strip doesn’t receive any control signals from the rpi. The strip most likely won’t do much without the bus signal. If all is connected, check if SPI is activated on your rpi.

  2. Finally made it with openelec + raspberry pi 2 + Hyperion. My question now is if can use the lightprocess with raspberry pi and having kodi on another device ( my smart tv for example ). I thought maybe to change the ip in the config but it seems that’s not enough. Any advice?

    1. You need to configure the ip of the rpi running hyperion in your device running kodi. They need to be on the same network.

  3. Hello, I followed your tutorial and installe everything but I am having a big problem… Only the first LED in the strip will light up and sometimes it seems to be changing color, I am using a 5V 3A power supply for the LED and the PI can you help me please cause am kind of desperate.

    Do you think it’s from the power supply? Is 3A enough to power the PI and 92 LEDs?

    I have been changing the LED strips from the beginning to the end there 5V through the LED so it should light up I am using the the LED as http://i.imgur.com/MVoAVmP.png and a Raspberry PI B V1.1 the Raspberry PI is power up as follows http://imgur.com/O4wo2Xx

    1. Hello,
      Got mine fixed, I had to activate SPI in config.txt and a link in the config file to the /overlays folder.

        1. Hello,

          Everything is working perfectly but sometime there is a kind of flash not all LED flashes, only one or two LED flashes there’s nothing to do with tv images.

          Is this a know issue? Can you help me to fix that?

          It seems to appear randomly only when watching TV when I use hyperion effects it works like charm no flashes. Can you help me please?

          1. I have the same issues. Doing the demo video it works, but with movie / series playing it flashes random leds. If you have found something please let me know also.

          2. Flashes disappeared after adding a level shifter. It’s been almost a month now I didn’t get a simple flash.

            Raspilight is brillant 🙂

      1. Hi. Can you be a little bit more detailed? Having the same problem and didn;t right understood how did you fixed . how did you activate that in config .txt?

        1. Hello,

          The best way to do it is to remove the sdcard, plug it to your pc and you should see the config.txt in the root folder if you installed openelec with noobs you might not have the config.txt then you will need to manually download the .img from openelec website and flash it to your sdcard using win32disk.

          If you are a linux or mac user you should use a dd command.

          1. activate SPI in config.txt – i guess you just added ”
            dtparam=spi=on”

            and a link in the config file to the /overlays folder- link of the config file in that folder?

  4. Awesome setup! I’m doing some research and trying to find the best solution for my setup. I run a Qnap Nas with plex server on it that is attached to my network, then I use plex app to stream my content. My Nas is not connect to my TV, I just use the built in app and my tv does not have video out. Is there anyway to setup something like this? Thanks.

    1. Hi Cotten,

      I wish someone will just respond to your question as I have similar situation and I’m thinking how possible it will be to outrightly power it using my QNAP TS-453A(8GB) on a VM but I’m not sure of the possibility here.

      @onmono please is this possible?
      Thank you.

  5. Hi Christian,

    Thanks again for making this guide, im having so much fun trying to make it work!

    However, I just have one question. Is it necessary to install a separate DC power jack for the leds? Cant I use the micro usb power to power both the leds and raspberry Pi?

    Thanks for taking your time.

    Danny

    1. Hi Danny, you’re very welcome.
      Yes, it is or you’d risk to burn your rpi caused by the high power consumption of the led strip. You could use the micro usb just for the pi, though.
      Chris

      1. Hi Christian,

        Im having a blast with the RaspBerry pi b+ I ordered for this project. Openelec has such an nice user interface its allows for easy use. Best diy project ever thanks again for giving us the know-how.

        But im here again to bother you with another question. How did you extended the 4 kabels (5V/GND/SI/DI) to the GPIO pins? The picture shows you used the jumpers to connect to the gpio pins of the Pi . But how did you connect the kabels from the ledstrip? On your photos the heat shrink is covering up all your cable connections.

        Im assuming (with my 0% know how ) that you somehow extended the 5V GND SI and DI kabels from the ledstrip with the male to female jumpers?

        Thanks again christian,

        Danny

        1. Hi Danny, glad you have accepted the challenge.

          I connected the 5v/gnd from the power supply jack to the led strip as shown on the wore diagram. Then I used the jumpers for connecting SI/DI on the rpi gpio to the strip. I think I have extended the jumpers wire length which is covered by the sink. You can use a soldering iron for that or connectors.
          Regards Chris

  6. Will this actually works on any TV?
    Or this is only for computer?
    Sorry if question has already answered :S

  7. Hello I really very very like your article. I bought some rgbw apa 102 led stripe from shining future LED… Any suggestions how I can efficiently control the rgb with the example programs and the white separately? Thanks

  8. Hey Christian,
    Like Dani I was looking to power the Raspberry Pi separately as I want it on 100% and not the lights (unless the way it is set up the lights are off when XBMC is in the menus. To do so I would only attach the DI and CI to the GPIO correct? (like so: http://i.imgur.com/MVoAVmP.png)

    And my other question is would I be able to start the LEDs from the middle of the TV to aid in cable management (like so: http://i.imgur.com/k7xI3yP.jpg), and in doing so would I just need to adjust the settings in Hyperion? Or does the way Hyperion handle the LEDs make this impossible?

    Thanks in advance,
    Sean.

    1. Hi Sean, yes just connect only the two pins to the Rpi and the power directly to the strip.
      Sure, you can start wherever you want. You just need to make sure to set the offset according to your starting point in hypercon.
      Regards

  9. Hi Christian,

    Great tutorial! Thanks a lot!

    Just a question. Could you explain why do you use the same power for LEDs and Raspberry?
    I was thinking of use a 5V power/3A to power my 80 LEDs and separately supply my raspberry pi 2 with the typical microusb 5V power. And connecting SD and CK to the corresponding GPIO, obviously. Could it work like that ?

    Thanks in adavance.

    1. You’re welcome! Yes, this would work, perfectly. I just wanted to have one single source of power for my setup.
      Best Chris

  10. I’m using osmc with hyperion but when I use a 5v 10a dc jack power supply I’m getting the under voltage rainbow square in the top right corner but if I switch to raspberry pi micro usb 5v 2a power supply there is no rainbow in top right corner but I have sum flickering with the leds now and again can anyone explain this please

  11. This is really neat… I am about to start on this project, so I am making a list of materials to purchase. I didn’t see in the article where you use the 1pin or 2pin female breadboard jumper wires, or the MicroUSB AC Adapter…. Could someone please explain what these are for? I am extremely new to all of this (circuitry/wiring/soldering, etc.) so please be patient with me 🙂 I assume the 1pin female breadboard wires are for the Pi’s breakout board, but I didn’t see anywhere the 2pin female wires were used. Thank you in advance for the help! Great article!

  12. I’m having trouble with the leds ws2801 I have a 5v 10a 50 watt power supply a 5v 8a power supply and a raspberry pi power supply but no matter which power supply I use I cant get more than 50 leds to light up at one time even more strange is 5v 10a and 5v 8a are displaying the under voltage rainbow on top of screen in osmc when the pi power supply doesn’t do this is anybody else having the same trouble lighting up all the leds they need and what is the fix thanks

    1. I can’t remember as it’s been a while since I did this project but your issue appears to be related to a config file setting. Double check your config file settings.

    2. I had same problem. A few things I would just double check if I were you. If you cut and soldered ur lights make sure no continuity between the solder points, and that all of your stip is going in the right direction. 2nd is make sure ur si and clock are on the right pins on the gpio. And 3 which is what happen to me, make sure on your wiring from the leds to gpio and power supply has no wire breaks. My clock Wire and ground were completely broken. As soon as I fixed it started working for me.

  13. how many leds should a 5v 10 amp power supply be able to run my power supply is only running about 51 out or 62 leds almost 1 side of the tv is not lighting up and its not the leds themselves ive tried them thanks

    1. I have 126 LEDs WS2801 working with a 7 amp power supply that is powering the RPI as well.
      Please, check the “Power supply calculation” for the calculation per meter.
      There might be something wrong with the hyperion.config.json configuration. Do you have generated the file with hypercon and the right LED count?

      1. hi Christian thanks for the reply what do you mean ( Do you have generated the file with hypercon ) I have generated a hyperion json file yes and the power supply should be good for the led I have running far less than yours and yes I have the correct number of leds in Json file

  14. Hi i am struggling to get the WS2801 strip as all sellers seem to stock the WS2812B led strips which only have three connections. (gnd, di, 5v) is there any way i could use these or possibly the apa102 (which feature the 4th ci connector) led strips? thanks Rich

    1. I have no experience in using the ws2812b strips seems like the hw support of the rpi is problematic. Anyway, you could try this guide
      Alternatively, you need to put an Arduino or similar in between, which makes things more complicated.
      Chris

      1. Thanks for the reply i decided to order the ws2801 strip from china. The newer chips just seemed to make things more complicated.

  15. Project successful 😀
    Fast forward to 20 sec 🙂 the Disney tune is not that interesting.
    https://drive.google.com/file/d/0B00V30yPWuc1bkdoNVUyU0ZNODA/view?usp=sharing

    Oh the movie ABSOLUTELY do no justice how it looks like it real life. I truly brightens up the wall in nice red colors 🙂
    Looks like a whore house 😛

    TIP!

    I bought this power supply to power both the led’s as the pi
    http://www.ebay.com/itm/191626401189?_trksid=p2057872.m2749.l2648&ssPageName=STRK%3AMEBIDX%3AIT

    Used the jack to connect the power supply to the pi and led’s.
    http://www.ebay.com/itm/5x-DC-Connector-Power-Plug-Jack-female-with-Screw-Terminals-2-1mm-x-5-5mm-/331176019258?hash=item4d1ba1053a

    Now I had one problem.
    The led’s and the pi are always on.
    This means when I switch back to tv I still have the blue osmc background glow behind my tv (maybe a black osmc background also solves this issue – have not tried that). I want the pi to be always on but the led’s only when watching a movie through the pi (content from synology nas 🙂

    First I choose for a simple ordinary light switch between the jack and the led’s to brake or make the circuit. However when I wanted to watch a movie I had to GET UP FROM THE COUCH!!! OMFG are you kidding me.. either that or ask my girlfriend to get up 😛

    Then I realised why not use a relay with an ir eye, so I can program it into my universal remote 🙂
    So I bought this (waiting for it to arrive)
    http://www.ebay.com/itm/400949555791?_trksid=p2057872.m2749.l2648&ssPageName=STRK%3AMEBIDX%3AIT

    and connect it between the jack and the led’s so I can easily turn the led’s on/off 🙂

    Can’t wait not having to get up from the couch 😀

  16. Hi, great tutorial…hope I will figure it out. Ordering the stuff now but I could use some help…I see so many LED strips on eBay..even when I search for WS2801 I can choose from how many LED’s (32, 48), Pixels, 150/160 pixels and also something called IP20 or IP67. Could you give exact details on yours so I can buy them the same. Does white of black PC make any difference….:( all too many options.

    e.g.
    http://www.ebay.com/itm/5M-DC5V-WS2801-5050SMD-32LED-M-Addressable-RGB-Dream-Color-Pixel-LED-Strip-12mm-/221727806585?var=&hash=item33a001d479

    or

    http://www.ebay.com/itm/5M-APA102-Led-strip-Light-150Pixels-Black-PCB-Replace-WS2801-Addressable-DC-5V-/371160853571?hash=item566ae92c43

    or

    and so on 🙁

    1. Hi Mike,

      You were asking for number of LEDs, Pixels and IP20 vs. IP67.

      I would say: the more leds per meter result in more detailed gradient, but will consume more power.
      32LED’s per meter at a 5 Meter Strip result in 160pixel (LED light points) in total.

      IP Code is just a classification of how “save” the device is in terms of touching it or put it in contact with water.
      Take a look here:
      https://en.wikipedia.org/wiki/IP_Code

      To sum it up: IP20 is enough for you, since you will not drown your TV under water 🙂

  17. Heya, nice tutorial! But i am having trouble actually, i have the Raspberry pi 2 so the old raspbmc do not work. Im trying all the ways to use the new OSMC but commands seems not to exist, do you have a tutorial on how to install hyperion using the osmc? Thanks!

    1. It won’t work with rpi2 as described, probably but don’t have time to upgrade the guide any time soon..

  18. Maybe i missed it but why would you need 2 raspberry pi’s?
    Nice job on the wiring btw 🙂

  19. last question, and might sound dumb but for connecting the strips, can i use an ethernet cables wires? the case will hold the cables and saves me from buying more cables that ill only use once. just dont know if they will work since im not to familiar with electrical.

  20. Why do you post to buy 2 pi’s if both methods use 1? Or is the 2nd pi optional as a dedicated ambient server?

    1. Never mind I read the whole thing. I already have a pi with openelec so can I follow the first method but instead of raspbmc do it on openelec? Also what would be the purpose to run a dedicated ambient pi server since another pi on the same tv has to be configured? Don’t see the point in that besides performance unless this could be done with other devices on the same tv. Or maybe can it be used just for remote lighting even when no media player and tv on? If so that’s worth it.

    2. yes, it’s optional. With hyperion it should be a problem to run everything on one Rpi

  21. Hello, I followed your Boblight tutorial word for word, I have now done it 3 times, everything seem to go well till I get to the point where I test the LED, when I (boblight-constant BB55AA) I get :

    Connecting to boblightd
    Connection to boblightd opened
    ERROR: 127.0.0.1:19333 Connection closed
    Connecting to boblightd
    Connection to boblightd opened
    ERROR: 127.0.0.1:19333 Connection closed
    Connecting to boblightd
    Connection to boblightd opened
    ERROR: SO_ERROR 127.0.0.1:19333 Broken pipe

    I’m not sure what I’m doing wrong if you could help me it would be great thanks

    1. Anything about this? thanks if you can help. I’ve been googling this since ive asked LOL

        1. I have hyperion on another RPI, but I want Bob light on another RPI as it will work with my S802 M8 andriod tv box running openelec, I guess you can’t help me with this problem by any chance.

    2. This error means, that the boblight daemon is not running on the Rpi. Did you start it with boblightd? Did you get any errors?
      // Stop the deamon
      systemctl stop boblight
      // Manually start boblightd
      boblightd

  22. Thank you for putting together this ‘How To’, it inspired me to build my own abilight! After a 3 days I’m about 90% there but at a loss. I have 102 LEDs around my TV, but only 1-50 are controlled 51-102 are simply ‘on’ and in a rainbow patern. I’ve checked and double checked my hyperion.config and everything looks okay. Any suggestions as to where to look?

  23. Awesome guides, just a quick question, if I wanted to run boblight on my pi as a stand alone ambilight server, and use a different device for kodi for example a PC… can I set up PC to send video info to boblight over network to the pi running boblight server. (don’t want to use hyperion at the moment)

    1. Yes it is. Boblight features client server communication. Just point the kodi boblight client to the boblight server:port.
      Thanks and regards Christian

  24. Hello Christian,

    very nice Tutorial!

    But i am quite a Noob in Raspberry Pi.

    Could you please explain how i can access the Raspberry Pi for Programming?
    (I have Win7 and 8 64bit, a MacBook Pro with OSX, and some Android Devices.)
    Is it possible to connect to the Raspberry Pi only via Network?
    Or must i use an HDMI Device?

    I like to have this for my 50″ Samsung PS50C7700 Plasma TV.
    I have connected an Satellite Receiver and sometimes i stream Movies from my FritzBox 7490 DSL Router Modem.
    What would you recommend me to build to get Ambilight with Sat-Receiver and maybe the Streaming via DSL Modem? (if thats not working via Modem, i can connect an USB HDD with the movies to the TV or the Sat-Receiver)
    Thanks in advance,

    best Regards from Germany,

    Mario

    1. Hi Mario,

      I’d recommend that you also to follow this guide: . This will get you ambilight for your sat receiver’s HDMI input. There are plenty of tutorials about rpi. I work most of the times with a ssh connection to the rpi.

      Regards Christian

  25. Hey Christian! I was wondering if you knew how I could hook up this set up with every HDMI on a 120″ projector screen

    1. any update? do you have done the setup for your screen?
      I will need to do for mine 108 inch and end up with 300 led
      but not sure if it will run smoothly

  26. This is incredible, I don’t think I have the technical aptitude to pull it off myself but I felt compelled to comment. If you ever started a kickstarter for something like this I would definitely donate whatever amount snagged me a consumer version. Anyways, good work man.

  27. Brilliant article, I was putting this together independently and then came across this article when looking for help on it.

    I’m just getting the components together to do this and I’m quite new to the electronics side of things. I’ve got a 5m LED strip (WS2801) with 32 LEDs per metre. There was no spec that came with the strip and I’ve contacted the provider, but no joy so far. You mention your strip uses 1.5 A per metre and looking at the shop you bought yours from it also appears to be 32 LEDs per metre. Would this be a safe assumption to go with? I know that assumption is the mother of a mistakes so….

    1. Thanks Dave,

      would say so, same chip, same led count per meter, should work.
      Good luck, Christian

  28. hi Christian is there any way you put a guide for the new kodi osmc for raspberry because now I have changed to this operating system hyperion and leds no longer work many thanks

  29. Thanks for the guide, came in very handy.
    I had some left over WS2811 12V led strip and used it with an arduino nano. 34 chips, 102 LEDS. Running off an external hard drive 12v supply, max current is 1.6A.

    A few notes, Your hyperion install instructions are incorrect for latest kodi, there is no -N option for wget, installed via instructions on hyperion page at github.

    Hypercon needs the effects directory changed to /storage/hyperion/effects instead of /opt..

    currently running at 115200 baud for stability, may try faster later.

    Thanks again.

  30. Thank you for the thorough guide, but unfortunately I have some problem between the RPi and the XBMC, the frame information is not transmitted.
    I run XBMC on a media centre (Pivos Xios XS if it matters) and hyperion on a RPi. I can control hyperion with the android app without any problem, so the wiring is fine. I also downloaded the hyperion add-on for the media center and set the ip of the RPi in its config. On the hyperion side I enabled XBMC checker with the ip of the media center and set everything else as well.
    When I start a movie the LEDs go from “idle white” to blank, if I stop the playback they go back to “idle white” state. So there is some link between the media player and hyperion but the picture data is either not sent or processed correctly. If the RPi is not running (turned off) I get a connection fail error message from the hyperion add-on, but if the RPi is up, there is no such notification, so I think the add-on can connect to the hyperion server on the Pi.
    Here is my hyperion config: https://dl.dropboxusercontent.com/u/4083023/hyperion.config.json
    Do you have any clue for this issue, or did anyone else meet such a behavior? Thanks

  31. I have set up the LEDs and have the software running on XBMC on the Pi. The LEDs however are lighting up at the main menu. They also seem to be extremely bright during the movies. I want to have them as more of an accent lighting when say there’s a super blue sky or fire. Not when there are dark scenes. Under the process tab I have messed with the settings (Thres., Gamma, etc.) but they do not seem to help. Any advice or help would be appreciated.

    1. You have to make those adjustments in the hyperion.config.json. Make sure that you reboot hyperion after every change otherwise the changes don’t have any effect. I think you have to decrease the hsv value gain but it’s hard to tell without seeing the real output.
      For a good overview, what all those settings mean. Check the Hyperion wiki: https://github.com/tvdzwan/hyperion/wiki/configuration
      It will take some playing around, but it’s worth in the end.

      1. To reboot Hyperion, do I just restart the Pi? I am not sure how to go about this process. Many thanks for the help again!

        1. It depends on the distro you’re using but for openelec:
          killall hyperiond
          LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperiond /storage/.config/hyperion.config.json

      2. trying to get my Raspberry Pi to work with and the lighting completely lost you have any guides I can go by that you can email me step by step possibly let me know please been at it for weeks can’t seem to get it going if you have a guide would really help me if you can email me one step by step please let me know and thank you

  32. Hi Chris, I am having trouble with my lights. There are a few random lights on (white) and they do not respond to the pi. Why would only a few ones in seemingly random places be on?

      1. Hi Chris,
        Just wanted to respond for anyone else who may be experiencing my issues with a Raspberry PI B+ and WS2801 LED strips with only one or a few lights on but not responding to the RPI. I was having issues with the spidev in /dev/ and SPI bus as Chris had mentioned above and corrected it using this site

        I had to:
        -> sudo modprobe spi_bcm2708
        -> sudo raspi-config
        -> Go to “Advanced Options”
        -> Go to “A5 SPI” option
        -> Click on yes when asked if you wanted to load the SPI kernel by default
        -> sudo shutdown -r now

        after a reboot everything was working to much of my disbelief after many hours of troubleshooting 😛

  33. Hi!
    This tutorial is great!
    it works perfect for me.
    I also added a feature that the Rainbow Swirl starts, as soon as my Mobile Phone conntects to my Wifi. And turns off as soon as it disconnects.
    For instructions visit my blog 😉

    This is really a great idea in the winter, where it’s dark when you go to work and dark, when you arrive back home from work.

  34. hi guys got everything working except for 1 little thing every time I play a video it will stop after 30 seconds or its the same with radio and music etc any ideas thanks

  35. Hi !
    Thank you for this great tutorial. I’m actually having trouble with my leds. I have ws2801, and it seems that I have random flickering on the ten first less. The pattern at the start is OK, but once the grabber has started, I’ve got those problems.
    And if I connect the Ethernet cable, or a second USB device, it get a lot worse : Flickering I’m all colors very quickly !
    I don’t understand, the ground is correct, and I use two 5V 2A phone charger for the RPI and the led strip (2A should be enough, I limited the whitelevels to 0,3 I’m the config file).
    Could somebody help me ? Thanks

  36. Hello, Cristian, PLEASE!!! can you add in article more detailed photo of LED connection point behind the TV mount. How you connect left and right strips in the middle of TV and connect there wire from RPi
    Thank you very much!

  37. HI,

    I think I did everything right but I have just the end LED lit (white) and no other indication of any response to either the test all red setting, video playback or the Android App.

    I’m using RaspBMC and Hyperion. Is it possible that insufficient current would give this symptom?

    What else can I check?

    Thanks.

    Is there any way to check the software install

    1. Hi Jim, it seems like your LED don’t get a proper signal from the SPI bus. Did you connect GND?. Please have a look at the comments section. I posted some advice for error analysis lately.

  38. […] se puede hacer con arduino , pero me quiero basar en este tutorial How to build your own Ambilight TV with Raspberry Pi and XBMC | techtalk ? Christian Moser , no creo que sea como los teles phillips que se ven filetes y ya vienen de fabrica solo una […]

  39. this is perfect for how i want to start my project but i was wondering where the 65 breadboard connectors come into play or have i accidentally skipped that part?

    also do you have a better picture of the back of the TV to point out the First LED?

  40. Hi, Cool guide, I only have one problem with it, where you have put the power into the raspberry pie doesn’t put to use any of the pi’s security mesures, the best place to have welded it would have been just behind the original power socket.
    But I’m going to give your version a try to see how it plays out !

    1. Hi Thomas, Thanks. What do you mean exactly with security measures? Do you mean the voltage protection (power fuse)? As long as you go with a 5V power supply there shouldn’t be any problem with that but be aware not to use more than 5V, otherwise it will burn the Rpi. Alternatively, you can power up with the (secured) micro USB port, but don’t forget to ground the GPIO pin!
      Regards Chris

      1. Hi Chris,

        I finally finished my setup but wanted to do some checks before i mount it back on the wall. My concerns to start is that there isn’t enough Amps, i have a 5v 3a (a guess) supply which I have just plugged into the micro USB. So first what did you mean when you said to Thomas to ground the GPIO pin? But secondly after using your method it seems I would need 6a in total. Is it best then not to use the micro usb port?
        Finally should i be able to use the Hyperion Android app with just my LED’s connected as a test?

        Thanks again for your help

  41. Hi, guys! Nice article! Read it and think to make something like this =) Can you help me? But I haven’t Raspberry Pi – a have Cubieboard and STM32F4 Discovery.
    I’ll be very appreciated =) Ansver me please on rozmathplus@gmail.com

  42. Aha ! I fixed it. I had to connect the Ground on the Pi to the power supply even though I am not using it for the power on the Pi. Once I did that it seems to behave properly ! Hope this helps anyone else out there.

  43. No luck with the re-solder (even though I am pretty proud of my soldering this time around so this project IS being helpful).
    One other potential clue on what is going wrong is that the first bulb in the sequence is always blinking rapidly. (This is true on different strands of the LED bulbs so I don’t think it is a problem with an individual bulb).
    I am using the original Raspberry Pi rather than the model B in the pictures but it appears that the pins for MOSI and SCLK should be the same as in your photo.
    And it does seem to react to the Hyperion-remote commands, it just seems random on what it does.
    Another potential clue is that I haven’t cut the length of LED to the specific lengths yet. I am hesitant to cut before I know what I am doing, but could part of the problem be that I have the whole roll of lights still even though I just have the 39×22 settings in the hyperion config ? I wouldn’t think this would make a difference but I am just trying to rule out anything obvious.
    Thanks for all the assistance you have given me and others up til this point and let me know if you have an idea for me to try next.
    Thanks,
    Dave

  44. They don’t all have the same color. I am suspecting my poor soldering quality. When I run the command I get the first few lights of blue, aqua, green, aqua, purple, blue, blue. It is odd. And if I change the command to do blue instead then it is other random colors. Hopefully it is due to my soldering and not a bad strip of the LED lights. I’ll keep you posted.

Comments are closed.