DIY Ambilight

From fakedWiki
Revision as of 17:05, 24 December 2020 by Jan (talk | contribs)
Jump to: navigation, search


I've been using two Lightpack v1 modules connected via USB to my mediacenter box for years, but after getting a new TV, the old Lightpack setup wasn't big enough anymore. Pretty much all products that can be bought ready-to-use cost way too much so i deciced to build my own Ambilight clone.

Most solutions seem to go the way of using a HDMI splitter and a HDMI capture card connected to a Raspberry Pi, which interprets the grabbed video frames and controls the LEDs connected to one of its GPIO pins. This is not the way i wanted to go, first because that would require running another Raspberry Pi, and second because that's where it gets expensive if you want something that captures at 4K@60Hz and does not mess up the HDMI connection.

As one of the requirements was being able to use it with Kodi (on a Vero 4K+), Enigma (on a VU+ Uno 4K SE) and Android TV (on a Nvidia Shield TV Pro), controlling it via USB like the Lightpack does was also not an option, unless i wanted to move the USB cable between each device whenever i switch to it, so it needed to be something that can be controlled via network.

The very first search result for "ws2812b wifi" is WLED, so i started reading up on what it does and how to use it. The short version: it's a firmware for the wifi-capable ESP8266 board which can control addressable RGB LEDs (commonly referred to as "ws2812b"). And it has support for Hyperion, which is a software that can grab the display output of a video device and convert it to instructions for LED controllers.


WLED seems to be around for less than two years (as of this writing) but it looks like it is very mature and has lots of features and supports many common protocols already. Using ESP8266 boards also makes it very easy to set up, as those boards cost <$5, can be bought pretty much anywhere and you only need a USB cable to upload new firmware (disclaimer: i've been using them for years, so i may be a bit biased regarding what would be considered "easy to use").


Hyperion was also the software i have been running on my Kodi boxes, as it provided a very reliable video grabber and made it reasonably easy to set up the LED layout, which is something you have to do so Hyperion can covert the rectangular image from the video grabber into a command for the LEDs at the respective positions. (It basically looks at the video image, sees that e.g. the top left corner is red, so it refers to the LED layout you configured because it needs to know which LEDs in the LED strip are mapped to the top left corner, so that it can send a command to turn those red, too.)


For the first proof-of-concept build i just went with the setup shown in the WLED Wiki and the hardware i had laying around: an ESP8266 Board, a TXS0108E Level Shifter and a short WS2813 LED Strip. That got wired up on a breadboard and connected to a 5V power supply (although the USB connection for uploading the firmware would probably have been sufficient for those few LEDs - just don't go full brightness), et voilà, we have blinkenlights. I was able to control the LEDs via the web interface, and the included effects looked like everything was working a intended, so i moved on to full build stage.

Two things i'd like to point out right away, because i only noticed them after the first prototype was finished and i connected the full 5 meter LED strip to it and had to integrate these fixes when i thought i was already done:

  1. Yes, you should add the relay, because even when switched off, those 300 LEDs draw ~0.25 amps unless you completely cut the power by using a relay.
  2. Yes, you should inject power also from the other end of the LED strip, as there will be a very noticeable drop in brightness along the LED strip.

So here's the bill of materials for my DIY Ambilight:

  • ESP8266 Board Amazon 3 for ~12€
  • TXS0108E Level Shifter Amazon 6 for ~10€
  • KY-019 Relay Amazon 3 for ~5€
  • WS2813 LED Strip Amazon 5m for ~47€ (60LED/m, black, IP30)
  • 5V 20A Power Supply Amazon ~16€
  • 4 pin LED Strip Connectors Amazon ~5€
  • 1000 uF Capacitor Amazon Set of 125 for ~9€
  • 470 Ohm Resistor Amazon Set of 500 for ~7€

Breaking the cost down into what was actually used for my build, i ended up at ~75€. This does not cover the cost of the wires, connectors, soldering tin and tools i used, let alone the time, but it should give you a general idea. ProTip: buy electronics in bulk. It's cheaper, and it's always good to have some ESP8266, level shifters and relays at home. ;-)

After wiring it up, i would have liked to see something like the image below, but real life is messy so i won't show any actual photos of the build: