I recently started a new project with the goal of creating a replica of the Philips Ambilight system that could be used with any existing TV and HDMI-capable playback device on the market. This project generously sponsored by Conrad in their latest efforts to showcase makers around Sweden. I would therefore like to thank them for providing the hardware used in this project.
I’ve built Ambilight setups before, but they’re always been restricted to only use the playback device which the software runs on, which meant that all the video had to be played through XBMC on the same Raspberry Pi that was controlling the lights. As I’m a big fan of Nexus Player, I would like to be able to use this device, or for example our Xbox One, something that is now possible through this setup.
The setup is very straight forward, but it does require a few technical components to make it work, see below.
- Raspberry Pi (Model 3 recommended because of Wi-Fi)
Click here to view product at Conrad.se
- Micro-USB cable for Raspberry Pi power
Click here to view product at Conrad.se
- SD-Card for the Raspberry Pi
Click here to view product at Conrad.se
- HDMI splitter, one (1) input, two (2) outputs
Click here to view product at Conrad.se
- HDMI – AV (RCA) Converter
Click here to view product at Conrad.se
- USB Capture Card (UTV007 chipset)
Click here to view product at Conrad.se
- WS2801 light strip (50pcs, 12mm, 5V)
Click here to view product at eBay.com
- Power supply unit (PSU) for the light strip
Click here to view product at Conrad.se
- USB power supply for the Raspberry Pi and AV converter
Click here to view product at Conrad.se
- Three (3) HDMI cables and one (1) RCA video cable.
These can too be found at Conrad, here (HDMI and here (RCA).
I used a light strip with 50 bulbs, but you can choose freely. For an ambilight with four sides, I would not recommend going lower than 50, but feel free to go higher. Also, depending on the Raspberry Pi you are using you might also need a powered USB hub (Conrad product). You should not need one if you’re using the Model 3.
Disclaimer: I’m not using the referenced light strip PSU since I had another one at home already, but it delivers the correct voltage and power, so should in theory work perfectly fine for this application. It’s also cost efficient. The one I have looks like this, but they work the same, delivering a DC output of 5V, 5A.
Phew… That’s it! As you can see there are quite a few components required to make this work, and while it might seem complicated, it’s really very straightforward, and for the most part, plug and play.
Basically, say you have a Nexus Player or an Apple TV. You would then connect the output of the device to the HDMI splitter input.From the splitter, another two (2) HDMI cables will go from the outputs. The first goes into the desired HDMI-port on your TV, and the second one plugs right into the input port of the AV converter. The RCA cable is then connected from the video (yellow) output to the video input on the capture card. The capture card then easily connects to the Raspberry Pi through one of the USB-ports. If this makes your head start spinning, it all be shown in detail in the video. But now lets get to it!
1. Initial Raspberry Pi configuration
Download the latest Raspbian operating system and install that to the Raspberry Pi SD-card. Once it’s installed, try starting the Raspberry Pi with a monitor connected to make sure the system works like intended. The operating system already includes all of the drivers that we need for the video capture card, so it’s easy. If you don’t know how to put the system on the SD-card, please refer to this guide. If everything works as intended you can go ahead and shut it down for now.
2. Connecting the HDMI media device
In this step we’ll be connecting the HDMI device of your choice, be it Apple TV or something else, to the HDMI splitter and then the TV. Start by connecting one of your HDMI cables from the output of your media device to the input port of the HDMI splitter. Then connect a second HDMI cable from the first splitter output and into the desired HDMI port on your TV.
3. Connecting the HDMI splitter, AV converter and Capture Card
From the second output on your HDMI splitter, attach the third and final HDMI cable to the input port of the HDMI to AV converter. Once done, connect the RCA cable to the video (yellow) output on the splitter, and into the video input on the capture card. Last but not least, connect the capture card to one of the USB ports on your Raspberry Pi.
4. Connect the light strip to it’s power supply and the Raspberry Pi
Connect the positive (5V) and the negative (Ground) to the 5V power supply and power on, but make sure the polarity is correct. This usually means that the first light on the strip will start glowing, usually in a blue-isch hue, but depending on your brand, nothing might happen at all. The next step is to connect the lights to the Raspberry Pi GPIO pins so that it can correctly transfer the data needed. This is done by connecting to the following pins: 9 (GND), 19 (Data) and 23 (Clock). The colors might vary depending on your light strip, but these are my colors.
In my experience the best way to connect the strip is to use some male to female breadboard jumper cables (eBay link), but anything that will make the connection should suffice. For the record, here is a GPIO pinout of the Raspberry Pi Model 3.
Connecting them should be a breeze, and once connected the light strip should not be flickering. If it is, then you’ve wired something incorrectly, try again.
5. Make those lights shine!
Assuming you’ve made it this far, everything should now be hooked up. If so, go ahead and power on your Raspberry Pi. The software used to generate the Ambilight effect is called Hyperion and is a free and open-source Ambilight software. It’s fairly straight forward to set up and even comes with a Java application for easy installation and configuration. The application is called HyperCon, and you can follow the guide here to download and get it up and running.
Once you’ve got it started you can head straight to the SSH tab and connect to your Raspberry. It should look something like this:
Type in the correct IP address, username and password and connect to the Pi. Once in, press “Show Traffic” to get a complete log of what’s happening and then press “Inst./Upd. Hyperion” to install the Hyperion software and it’s required components on to the Pi. If this process is successful you should see your colors on your light strip as Hyperion starts.
6. Customization of your Ambilight
Now you’ll have to use Hyperion to configure how you’d like your Ambilight to function. A detailed step by step guide can be found at the Hyperion Wiki. Here is a quick rundown of my configuration:
Hardware
- Type: WS2801
- Output: /dev/spidev0.0
- Baudrate: 250000
- RGB Byte Order: RGB
- Direction: counter clockwise
- LEDs horizontal: 16
- LEDs left: 9
- LEDs right: 9
- Bottom gap: 0
- 1st LED offset: 18
- Horizontal depth: 3%
- Vertical depth: 2%
- Horizontal gap: 0%
- Vertical gap: 0%
- Overlap: 0%
- Blackborder detection: Enabled
- Threshhold: 5%
- Mode: classic
Process
- Smoothing: Enabled
- Type: Linear smoothing
- Time: 100ms
- Update Freq: 25Hz
- Update delay: 0
Grabber
- GrabberV4L2: Enabled
- Device: /dev/video0
- Video standard: PAL
- Width: 96
- Height: 54
- Red signal threshold: 0.1
- Green signal threshold: 0.1
- Blue signal threshold: 1.0
External
- Booteffect: Enabled
- Effect: Knight Rider
- Duration: 3000
7. Finishing touches
By now your Ambilight should be working, but most likely scattered around the floor in what’s probably not a very pretty sight. For my build, I bought some L-shaped aluminum profiles and cut these to the desired dimensions for my TV. I then measured where the holes should be and drilled them out. Keep in mind that for the encased WS2801, the holes should be 12mm.
I then designed some corners which I printed out with my 3D-printer, and they worked like a charm. I added a few drops of Loctite just to be sure though.
8. The final result
I mounted the frame to the back of my TV and cleaned up the wires (they’re in the white box below the counter) and this is the end result. Taaada!
9. Conclusion
I hope that you’ve enjoyed this project of mine, and that this semi-comprehensive guide will be off assistance, should you want to build one yourself. If you like this, please do share it on Facebook, and don’t forget to comment. Also, if you do manage to build your own Ambilight, please share it with me! 🙂
If you’re interested in seeing more, you can find photos and videos of the build process in my Google Photos album.
Result
Conrad has now published the project guide and the accompanying video, which can found here, and the video below:
Things other people recently wrote