Mike Senese is a content producer with a focus on technology, science, and engineering. He served as Executive Editor of Make: magazine for nearly a decade, and previously was a senior editor at Wired. Mike has also starred in engineering and science shows for Discovery Channel, including Punkin Chunkin, How Stuff Works, and Catch It Keep It.
An avid maker, Mike spends his spare time tinkering with electronics, fixing cars, and attempting to cook the perfect pizza. You might spot him at his local skatepark in the SF Bay Area.
Televisions these days are technological marvels — absolutely massive yet paper-thin screens with crystal-clear 4K (or better) resolution, up to 120Hz refresh rates, high dynamic range (HDR) color and luminance, and other features that turn living rooms into amazing personal theaters. As great as these new TVs are though, the magic still ends at the thin bezel that frames the screen. But what if you could make your shows, movies, or games stretch beyond the television itself?
With a Raspberry Pi, a few pieces of HDMI hardware, a strip of assignable LED lights, and free software, you can do just that. The hardware processes your video content, detecting the specific colors that are closest to all edges of the screen and then driving the LED lights to correspondingly project the same colors outward behind the television. It all happens dynamically and in real time, creating an immersive lighting effect that makes the content feel even larger and more exciting.
This trick is known as ambient lighting or bias lighting. You can find a couple all-in-one ambient lighting systems that offer this effect from companies like Philips, but they’re expensive and proprietary. Fortunately, it’s not hard to put your own together, nor is it particularly expensive. Ready to get radiant? Here’s how.
What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.
To get the LED backlights to display hues corresponding to what’s shown on the screen, we’ll be splitting the video signal from an external HDMI device (Apple TV, Chromecast, Roku, etc.) into two signals. One of those passes through to the television screen where it will be displayed normally, while the other gets routed via USB to the Raspberry Pi, where the HyperHDR software processes the signal down to just the video elements on the outer limits of the TV screen, then sends that signal to the LED light strip (Figure A).
There are a wide range of LED strip lights on the market and HyperHDR can handle most of them. It can even use external Philips Hue lights remotely, via the Hue Bridge — allowing you to place additional lights alongside the television for even wider ambient light dispersion. Turn your whole room into the viewing experience!
For my build, I used WS2812B string lights. They’re cheap and easy to find, and they run off 5V, so you can even build a power circuit that powers these and the Raspberry Pi with just one plug. I got a 5-meter (16.4-foot) strip with 60 pixels per meter. More pixels equals more resolution, right? Well, yes, although I’m not convinced that the improvement over the 30 pixels/meter option is worth the extra wattage needed to power them. (There are also advantages to using 12V strip lights, such as the WS2815 version — these don’t suffer from voltage drops across longer lengths, as the 5V ones can. But they don’t offer the easy option to power the Pi from the same power source.)
Speaking of power sources, you’ll need one that is sufficient for lighting all those LEDs. We’re talking 150–300 LEDs, potentially blasting a full, pure white light, meaning they’ll be drawing maximum amperage. A standard phone charger won’t cut it for that; you’ll want to get a laptop-style power brick (Figure B) that matches the voltage of your string lights and has a fair amount of amperage. Mine does 5V 10A, for 50 watts of power, but if I were wiser I’d get a bigger power supply that can go up to 300W, just for safety. They’re not much more expensive, either.
To connect the LED light strip to the power source, use a 5V barrel jack adapter. Some power supplies include this, but you may have to buy one. They usually come in a small set; be sure you get the “female” side with it. Strip a small bit of insulation off the power leads from the LED lights, then connect these to the screw terminals of the female jack. The red wire goes to positive (+), the black or white wire goes to negative (–) (Figures C and D).
NOTE: If you’re using 5V lights and want to couple in power for your Raspberry Pi, here’s where you’ll do it. Cut off the big end of a Micro-USB or USB-C cable (depending on which model Pi you have), find the red and black wires, strip off about ⅛” of insulation, and insert them in the corresponding + and – slots along with the wires that power the LED strip (Figure E). This will let you power the Pi from the same power supply
For longer lengths (300 LEDs), also feed the tailing red and white wires into the barrel plug here as well, so the voltage and ground feed both the start and end of the lights.
Finally, use a M–F jumper cable to connect the Data line from the LED strip (it’s the middle pin on most strips) to pin 18 on the Pi (it’s the sixth pin from the bottom corner) as shown in Figure F.
IMPORTANT: If you decide to power the Pi separately, you’ll also need to put a jumper between one of the GND pins and the ground wire on the LED strip, otherwise it won’t work.
If you’d like, you can now plug the devices together. Connect your external HDMI streaming device into the HDMI capture card, an HDMI cable from there into the TV, and also a USB-A cable into a USB port of the Raspberry Pi. My Pi’s USB jack supplies power to the capture card; look for the red light on it to know that it’s working.
Then turn on the TV and your HDMI streaming device, and select the HDMI input that you’re plugged into on the TV. If everything has power, you should now see your normal con
For best results you’re going to want a rectangle of LED lights around the back edge of your screen, close to the sides. Some people just affix the light strip with its built-in adhesive, folding the strip at the corners. Others build a dedicated frame to hold the lights at an angle, with pre-made corner connectors (Figure G). This is up to your personal preference.
Whatever you do, count the LED lights on each side and mark them down. You’ll need these numbers for the HyperHDR configuration.
You’ll also want to decide where the input for the light strip should start. Top corner? Bottom center (Figure H)? This is software-configurable as well. The default direction of the lights is clockwise (when looking at the screen from the front) but you can reverse that in the software if necessary. You can also input a gap setting in the software, measured in LED pixels, for instance if you leave a space in the light strip for the television stand. Mark all these numbers down, you’ll need them in a moment.
Finally, mount or stash the HDMI hardware somewhere out of sight bu
For this project, we’ll use HyperHDR, a variation of the popular open source Hyperion software. It allows you to match the vibrance of the LED lights with what’s displayed on your HDR-capable TV screen, without needing an expensive HDMI splitter that transmits the HDR signal on both split channels. Most HDMI splitters and capture cards downgrade the split-off signal to SDR, which results in less-rich color transmission on the surrounding lights. HyperHDR fixes that.
Download the latest version. I’m running the 64-bit beta version of 19.0.0.0 on a Raspberry Pi 3. Look for SD-card-image-19.0.0.0beta1-aarch64.img.xz on the releases page, which also works on the Pi 4, Pi Zero 2 W, and rev 1.2 of the Pi 2. (Check out awawa-dev for releases supporting other Pi models.)
Once the file is saved on your computer, use a card imaging app to build a bootable SD card from it. I like Etcher but other options like Rufus work great too. You can also use the Raspberry Pi Imager tool, which is a pretty slick method of creating many different types of images with the settings you want. Use a card with at least 8GB capacity.
Once the image is built you’ll need to add a file to the card to give it your Wi-Fi credentials, which will allow you to log into its UI and configure the settings. To do this, open a text editor and input the following, with your own network details:
Save that text file with the name wpa_supplicant.conf and drag it onto the /boot folder of your card while it’s still in your laptop.
Now you can boot up the Pi — insert the SD card in your Pi, plug it into the TV you’ll be using with an HDMI cable, and power up the Pi. You’ll see the familiar Raspberry Pi bootup screen. After a couple minutes of processing, it will ask you to log in (user pi, password raspberry), then change the default password and mark it down. I use a USB keyboard and mouse to input these directly into the Pi on-screen; you can also SSH into the Pi from a separate computer, but since this project already involves a TV screen, it’s just as easy to input the info directly.
Next, find the IP address of the Raspberry Pi by running the ifconfig command in the terminal on the Raspberry Pi. Write it down, you’ll want it to SSH into the Pi. You’ll find it as the inet number at the start of the wlan0 section, probably something like 192.168.xx.xx. Alternatively, I use the Fing app on a spare Android phone to find my Pi’s IP address remotely; I find this is easier.
Now you can remove the USB peripherals and disconnect the Pi from the HDMI connection. From here you should be fine doing everything else via SSH and the HyperHDR user interface.
If you’re using WS2812B LEDs, it’s likely that you’ll be using PWM to control them, via pin 18 (the default PWM pin for HyperHDR and many other Raspberry Pi LED projects).
However, one thing that isn’t always communicated in ambient backlight project write-ups is that the Pi’s PWM function can only be accessed and controlled if the Raspberry Pi is running in “root” mode. It’s quite likely your installation won’t initially be in root; generally it is discouraged as it allows direct access to critical files. However, the LED lights won’t turn on without it! So next, we’ll enable root access on the Pi with the following steps:
• Open the Terminal tool.
• SSH into the Pi using that IP address you wrote down from the previous step, by typing: ssh pi@<IP address of Raspberry Pi>
• Input your password.
• Verify that your Pi is not already running as root. In the terminal, type: sudo systemctl status hyperhdr@pi.service
If, inside the results that pop up, you see Active: active (running) since… you are running as pi and not as root. Press Control-C on your keyboard to exit the results and go back to the command prompt.
• Now disable the pi user: sudo systemctl disable –now hyperhdr@ pi.service
• Then enable the root user: sudo systemctl enable –now hyperhdr@root.service
• You can now verify that root is active by using that same status command: sudo systemctl status hyperhdr@root.service
Now go to a separate computer, open a browser, and type in http://hyperhdr:8090 to get to the HyperHDR user interface (Figure J). You may get a prompt to choose a password here.
There are a ton of setting configurations in the software, and you’ll need to explore those yourself for best performance with your own setup, but the main ones to jump to first to get things working are:
• VIDEO CAPTURING: Your HDMI grabber should automatically show up here, under the Device setting (Figure K). You can keep the resolution and frame rate on Automatic, but to keep things zippy, reduce the settings down to even 640×480 and 20FPS — we’re not dealing with fine pixels. You can also activate HDR to SDR tone mapping here. Click “Save settings.”
On that same screen, in the Instance USB Capture section, click the checkbox to Enable USB capture, then click “Save settings.”
• LED HARDWARE: Under the LED Controller tab, choose “ws281x” from the “Controller type” dropdown menu (Figure L). You may need to change your RGB order (there’s a wizard for this under the Advanced menu). Input your total number of LEDs. Click “Save settings.” You might now see some of your LEDs starting to light up at this point.
Click the LED Layout tab next. Here’s where you’ll input those LED counts, gap length, and input position. Once you click Save settings
From here, if you have content playing on your HDMI streaming device, you should be able to see corresponding ambient lights playing. Cool, isn’t it? You might need to fiddle with the software for a bit to get the LED placement correctly configured, along with color matching, black bar detection (recommended), and lots more.
Naturally, the effect is most noticeable in a darkened room or at night. You may find yourself repositioning the TV to get better light dispersion, or to prevent those bright LEDs being too visible by people standing alongside the television.
The Hyperion forum has guidance on setup and hiccups. Also, as noted in the materials list: Users with A/V receivers, surround sound, and CEC-connected devices will need to use slightly upgraded HDMI hardware to maintain those features. It quickly becomes a slippery slope.
You’ve just added a new dimension to your home media center. Enjoy the immersion!
Mike Senese is a content producer with a focus on technology, science, and engineering. He served as Executive Editor of Make: magazine for nearly a decade, and previously was a senior editor at Wired. Mike has also starred in engineering and science shows for Discovery Channel, including Punkin Chunkin, How Stuff Works, and Catch It Keep It.
An avid maker, Mike spends his spare time tinkering with electronics, fixing cars, and attempting to cook the perfect pizza. You might spot him at his local skatepark in the SF Bay Area.
When you buy through links on our site, we may earn an affiliate commission.
Our websites use cookies to improve your browsing experience. Some of these are essential for the basic
functionalities of our websites. In addition, we use third-party cookies to help us analyze and understand
usage. These will be stored in your browser only with your consent and you have the option to opt-out. Your
choice here will be recorded for all Make.co
Websites.
Allow Non-Necessary Cookies
Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!