Do you want to build your own ambilight, but you don’t know where to start or what to buy?
In this tutorial I’ll try to cover what parts I brought for my build and how I configured the software. While I’m still not done creating a 3D-printed case for my Raspberry Pi and providing it with an ordinary power supply, this guide should help you a long way.
I’ll be using the following hardware, hardware tools are not included in the list:
- Raspberry Pi
- 4GB SD card
- USB WiFi adapter (Optional: You could also use LAN)
- WS2801 LED Strip
- 5V Power supply (I used an old PC PSU)
- Some wires and a soldering iron
In order to be able to test the LED strip before mounting it on the screen, I recommend to start with configuring the Raspberry Pi. Download the lastest version of Raspberian and use Win32 Disk Imager (Windows) to write the image to the SD card. Once done, insert it into the Raspberry Pi, connect a screen and keyboard and power it on. The default username for Raspberian is Pi and the password Raspberry. When it has finished booting you should be presented with the “Raspberry Pi Software Configuration Tool)”. If not, you can use the following command to launch it:
First of all you should expand the filesystem in order to use all of the available storage space. Select “1. Expand Filesystem” and Select YES to expand. We also need to enable SSH and SPI support under “8. Advanced Options”. Reboot the Raspberry Pi when prompted. In case your are using wireless and not LAN, you’ll have to configure your network before continuing. I recommend you follow this guide for that. It’s now time to install the requirements by issuing the following command:
sudo apt-get update sudo apt-get install libqtcore4 libqtgui4 libqt4-network libusb-1.0-0 ca-certificates
Once this is done you can go ahead and install Hyperion which is the software that will control the lights. Issue these commands, line by line:
cd /tmp wget -N raw.github.com/tvdzwan/hyperion/master/bin/install_hyperion.sh chmod +x install_hyperion.sh sudo ./install_hyperion.sh
There you go! Hyperion is installed and you almost done with the software part.
Configuring the LED’s
Before you’ll be able to test or use your LED’s you’ll have to configure Hyperion. The good thing is that it has a pretty good utility to do that. Just download HyperCon.jar and run it. If you haven’t mounted the LED’s to your TV yet and want to try them out to see that all of them light up, you can change “Horizontal #”, “Vertical #” and “Bottom Gap #” just so you match the number of LED’s you brought. You’ll see the number of LED’s in the right bottom of the screen. You don’t have to worry about the other settings for now, just hit “Create Hyperion Configuration” and save it somewhere.
Copying the configuration to the Raspberry Pi
In order to copy the file to the Raspberry Pi, you’ll need to know its IP-address and use WinSCP or similar to copy the file over. I’m not going to cover the basics here, just connect using SCP, its IP and Pi/Raspberry as username/password. Once logged in, upload the file to “/opt/hyperion/config/”. Reboot your Raspberry Pi and you should see all light light up when it has finished booting. If you want you can also remote control it using the Android or iPhone app. If you have done everything right it should work pretty nicely.
Connecting the LED’s to your Raspberry Pi
Connecting power to the LED’s and Raspberry Pi might be a bit tricky, at least to explain. For now I’m using an old PC power supply because that’s what I had lying around. What I did was to remove the black and red wire from a Molex connector as this will give me access to the 5v I need to power both the Raspberry Pi and the LED’s. Next I used a wire connector to connect the black wire to the Raspberry Pi and to the LED strip. Follow this image from bite-in.com and be careful that the colors of the wires may differ (the black wire on my LED strip wasn’t ground). Red (5V) goes also to both the LED strip and your Raspberry Pi as the image illustrates. Now there are only two cables left from the LED that go to two of the GPIO pins of your Raspberry.
Mounting the LED’s to you TV
I highly recommend to watch this video on YouTube. There’s not much more to add, just take your time and don’t rush it! It wasn’t that hard.
Creating a new Hyperion configuration
Once you have mounted the LED’s, you’ll need to count the number of LED’s and create a new configuration. I recommend to start off with the default, just changing the following:
- Direction: Depending on where you started, you might have to change this.
- Led in top corners/bottom corners: false
- Horizontal #, Vertical #, Bottom Gap # should match the number of LED’s you have.
- 1st LED offset: Use this to set the offset so that LED 0 is where the LED strip starts.
Make sure that the preview-image on the right matches your TV, then save the configuration and upload it to your Raspberry Pi. Now you just need to reboot and you’re done! Now you can install the XBMC addon following this guide and everything should work.
Make your Raspberry read-only
While I haven’t tried it myself yet, I may suggest this guide in order to make your Raspberry Pi’s SD card read-only. The reason you might want to do that is that the Pi doesn’t like it if you just pull the power without shutting it down properly. You might experience file system errors or corrupt the SD card if you do. This guide should make it possible though, preventing potential errors to occur. 🙂
Good luck! If you need any help, please let me know! 🙂