RSS Amplifier

Feed :: TheOrangeOne · Dec 17, 2024

Making my TV glow with WLED

0
Sign in to vote or save

TheOrangeOne

RGB LEDs can be added to pretty much anything. Some places, like your car or your vacuum, it's probably not more than a gimmick. But in others, like your computer or "battlestation", it can bring an otherwise mundane-looking setup to life.

One day, for reasons I can't entirely remember, I decided to set myself a new project: I want a backlit TV. Not the kind of backlight that LCD TVs have, but on the back of the TV itself. Often called "bias" or "ambient" lighting, this adds a glow behind the TV, serving both as some ambient lighting for the room, but also making the TV look more modern.

My TV, in all its RGB glory!

At the start of this year, I treated myself to a 65" 2022 LG CS6 (basically a C1 with some updated processing) OLED. As an OLED, it's crazy thin and has incredible image quality. It really doesn't need to look any nicer than it currently does, but I wanted to try anyway. The TV is sat against a white wall, with a few bits of furniture either side.

<aside

Yes, it's not the newest model, yes I'm aware there might be other TVs out there. But it was a good price, has served me excellently all year, and hopefully will for many to come.

</aside>

The easiest way to achieve this is with a pre-built kit - and many exist at pretty reasonable prices. But almost all of them are closed source, proprietary and need special apps to function. Some of the nicer ones might integrate with HomeAssistant, but I wanted more. I want to build something myself, to learn a bit more about this ecosystem.

#MagicHome

A few years ago, when I first discovered controllable RGB LED strips, I had a MagicHome. These were great, fairly inexpensive devices, which could be relatively easily updated from their proprietary firmware to run ESPHome.

The MagicHome is designed for 12V LEDs, which means I can use nice bright LEDs with a simpler power supply. Using an ESP device with 12V LEDs gets more complex, since the ESP and the LED strip require different voltages, and need either 2 power supplies or something to step down the voltage to something which won't release the ESPs magic smoke. The MagicHome deals with all of that itself, without the magic smoke.

#The problem

To flash the MagicHome with ESPHome, it needs some soldering to access the serial bus of the controller. Unfortunately, I was awful at soldering back then - And now, I'm no better. Since deploying the MagicHome, I've changed WiFi networks, and my MagicHome didn't have a captive_portal setup. Attempting to re-connect some wires to the pads and get a sensible connection lead to me ripping the solder pads off, and there's no way I was in a position to fix that. So I gave up and ordered another identical unit.

Or so I thought...

Sadly, whilst there are many devices out there which look identical, the internals are far from it. Whilst the previous devices had an ESP8266 at their heart, newer devices have a very different, far less open controller, which can't currently run ESPHome easily. I bought 2, and neither used an ESP. Documentation online for flashing them with ESPHome was sketchy at best, with very little reliably confirmed working.

I wanted this deployment to be long term and reliable, so I wanted to do it properly. Obscure hardware with strange flashing and upgrading processes wasn't something I really wanted to deal with. So, with a heavy heart, I abandoned that idea, and decided I had to build something myself.

#Controlling addressable LEDs

If I had to ditch the MagicHome, I might as well ditch the boring "analog" strips, and go full digital.

The MagicHome is designed to control "analog" strips. These strips have 4 pins: one for each colour (Red, Green, Blue) and another for ground. If you put more power into a pin, the corresponding LED is brighter, and so is a stronger colour. This means the strips themselves are incredibly simple, however means the whole strip must be lit identically - no per-LED control.

Addressable strips on the other hand have just 3 pins: A single power pin, ground and data - because yes, they're digital! The controller supplies power to the strip, and uses the data pin to control the strip. The protocol for the digital pin is incredibly simple, but it means each LED can be controlled individually, rather than the entire strip. The strip is directional, making the wiring slightly more complex, but powering longer distances is significantly simpler, and the slight added complexity of a digital strip is more than worth it.

#LED Strips

As someone new to the world of addressable LEDs, it's quite a big world. If you don't really know what you're doing, there's a lot of information to dive into, much of it conflicting and based on personal opinion. I decided fairly early on that I wanted a 5V LED strip. The powering and wiring is significantly easier, and for this deployment I won't benefit from 12V. Not to mention working with 5V is less shocking than 12V.

Fairly quickly, I came across this guide, which gives a great overview of the options and statistics you care about, without overwhelming you. For future projects, I'll be reading the same page again.

In the end, I decided on WS2812B, since they're 5V and very easy to get hold of. I bought a 4M strip with 60 LEDs per meter, since because the light would be diffused off the wall, I didn't need high pixel density. For a 65" TV, 4M is comfortably enough, with a little spare to potentially add to the TV unit.

#Wiring

Most ESP boards run at 5V, which is why they're so easy to power using USB (which is also 5V). An LED strip however will require more power than a conventional USB charger will provide, and significantly more than the GPIO pins on an ESP board are rated for (generally only 1A or so).

Trying to draw too much current through the ESP could damage the board, the power supply or even your home.

However, unlike an analog strip, the high-current wires which carry power don't need any kind of signalling at all, since that's handled by a separate pin altogether. This means, whilst the digital pin needs to go through the ESP, the power pin can go directly to the power supply, to get nice clean high-current power. The digital pin has very low draw, and so can come straight off the ESP just fine.

When wiring up the strip, it's important to connect the pins correctly. If you, for example, wire ground and power the wrong way, you'll release the magic smoke from the LEDs and they'll stop working forever. I did this, and had to buy a new strip. In my case, I got the legs on the barrel jack the wrong way around. Learn from my mistakes: use a multimeter to be sure.

Wiring diagram for the LED strip.

(The brown wire is ground, but black wires don't show up well in dark mode)

Each LED apparently tops out at around 55mA of power when at 100% brightness shining white. Expecting to need around 180 LEDs, that's around 9 amps. I bought a 10 amp power supply to be on the safe side, and know I wasn't going to be pushing things too far.

When an analog strip is turned off, it draws no power at all. When a digital strip is turned off, it still draws some power. Not much, but some. Mine draws about 1.5W for the entire strip (including the ESP, 1W without it). It's not a deal-breaker, but it's not ideal. The recommended solution to this is to put a relay on the LED strip's power line, so it can be completely disconnected when not in use. In future, I might, but for now this is fine.

For ease, I powered everything off of a single power supply. It's possible to separate them, however you can get issues with floating ground (which I've discovered the hard way in previous projects). Because everything was running at 5V, I didn't need to handle any voltage step-down - I just had to take power from the power supply, split it, and give one wire to the ESP and another to the LED strip. Connect the grounds, and connect one of the GPIO pins (WLED has some recommendations) from the ESP to the data pin (usually the middle) of the strip. I suck at soldering, so getting this all to look nice whilst connecting multiple wires to a barrel jack took me longer than I care to admit. But eventually, it was all connected and working.

I'm not the most confident or competent solderer in the world (which is why photos of my soldering are absent from this post). For my own sanity, I left the controller plugged in with no LEDs connected for several hours, and a further several hours with the strip connected but turned off, just in case of any issues. The last thing I wanted was melting plastic, smoke, or worse coming from behind my TV, especially when we weren't home.

#Controller

I have quite a few ESP devices around my house, doing various things. From a bluetooth proxy, to temperature sensor, to a macropad. They're cheap, easy to work with, and small enough to hide.

I happened to have one left in my parts box, just asking to be used for this project. It's an ESP8266, so not as powerful as the far more popular ESP32, but for this purpose it would be ample. Controlling an LED strip isn't especially computationally intensive, and for a single strip I've not noticed any latency issues.

#Software

When it comes to the software for an ESP device, there's really only one choice for me: ESPHome. It's simple to use, powerful, and compiled right on my server. The deep integration with HomeAssistant also makes managing updates easy, and configuring new boards or components a breeze.

However, whilst you can use it for LED strips, and I have in the past (what do you think the MagicHome ran?), it's not necessarily the best thing out there for it. This ESP was going to do nothing but control this LED strip, so I could afford to specialize and use the right tool for the job.

Enter WLED.

WLED is a lightweight microcontroller firmware specifically designed for controlling LED strips (as the name suggests). Rather than having the component flexibility of ESPHome, it does one thing, and does it incredibly well. Being designed for it, WLED can be much easier to configure and use, and has bespoke features like (fake) output current limiting and relay control. Whilst WLED is intended to be used standalone, rather than requiring something like HomeAssistant, the integration with HomeAssistant is still feature-packed.

<fact

WLED's documentation site is at kno.wled.ge. Yes, really.

</fact>

Before this project, I'd never used WLED, so I thought I'd give it a go.

Much like ESPHome, WLED can be flashed directly from the browser. But unlike ESPHome, configuration is done through a web interface running on the device, without the need to recompile and re-upload the firmware. This makes it harder to version, but much quicker to configure.

Plugging in a compatible device and visiting install.wled.me is all that stands between you and a functioning WLED installation. You can even configure WiFi directly through your browser.

#Configuring WLED

Before attaching the LED strip, I made a few configuration changes in WLED to make sure it was compatible.

The first step was setting the right LED number and type. It's easy to change this later, but for debugging it was easier to set it now. At first, I only told it I had a strip of 10 LEDs, so I could test everything was working without unrolling the entire spool. My first set of 12V analog LED strips warped the reel and caused issues with the adhesive when it heated up too much - which I didn't want a repeat of.

With that configured, I turned the strip on, and it worked! Only the first 10 LEDs turned on, as expected, and they could be set to any lighting effect I wanted. Sure, many of them look strange with only 10 LEDs, but it's a start!

With the basics working, I rolled out the full strip, upped the LED count in WLED to the full 240, and proceeded to spend far longer than I care to admit being mesmerised by the effects and pretty LEDs which sat before me.

With all the lights on, I wanted to see the power draw, mostly just out of interest. With the napkin math reporting that the strip would consume a maximum of 9A at its absolute brightness, I was expecting to see 45 watts. But, no matter what I did, I couldn't make it draw much past 27W. The brighter and whiter the colour, the more power the strip will draw. I'm glad I was on the safe side with my PSU, especially for my first build, but for future builds, I know I don't need to over-spec things quite that much. Since this is for my TV, and the LEDs need to diffuse off the wall to be seen, having them be fairly bright was important, so I'm glad the power supply can handle it more than comfortably.

#Installation

The controller works, the strip works, even the interface works. Now it was time to put it on the TV.

<note

My TV is an OLED, which is incredibly thin. I did some research, and since the back of the TV generally has some heat shielding to protect the TV LEDs themselves, the extra tiny amount of heat and electronics from an LED strip shouldn't be an issue.

</note>

Since the strip is directional, I picked a side and started there. Doing the straights is easy, but making LED strips turn corners is difficult. For this, I used some corner connectors. I've used them before for my analog strips, and the principle is the same, without the extra annoyance of more wires to manage. They're not perfect, and you need to be sure there's a good connection, but they're incredibly simple to work with, adjust, and don't require any soldering (another big bonus in my book). When connecting the corner pieces, make absolutely certain that the power and ground lines are on the correct side, else you'll release more magic smoke.

I intentionally left a few centimetres of gap between the strip and the edge of the TV, both to ensure the strip couldn't be seen and to better let the light diffuse. Whilst I tried my best, the strips weren't perfectly straight, but it's close enough for an even-looking diffusion.

The LED strip, in place on the back of my TV.

I put the controller on the unit just behind the TV, with a small extension so it couldn't be easily seen. I used a quick-disconnect so that when installing and/or performing maintenance, I didn't need a soldering iron anywhere near my TV, and swapping this out was much easier.

#Counting LEDs

With the strip installed, I had a few LEDs left over, which meant I wasn't using all 240. Chances are, I'd not notice this, but I wanted to do things properly, and tell WLED the exact number of LEDs it hand, just in case it impacted any effects.

When measuring, I was focused much more on getting the lenghts right than counting the LEDs, so I didn't have an accurate number. I could have counted what was left, but instead I picked a sensible number, tried it, and started making educated guesses at numbers until I found the right one.

<tip

A very efficient trick for doing this is to do a binary search. It sounds very complex and computer science-y, but I assure you it's much simpler than it sounds.

</tip>

In the end, there are 183 LEDs on the back of my TV, leaving me with 57 (just under a meter) LEDs for another project.

#Testing

Just look at it, animating away in all its glory! Sure, a fixed colour would have given me most of what I wanted, but these addressable strips sure are pretty!

There was a small connection issue with one of the corners not putting quite enough pressure to form a good connection, but after that it really did "just work". Once the controller was on my network, it was immediately discovered and adoptable by HomeAssistant.

#Voltage drop

After a few days, I noticed the far side of the strip was a little darker than the start. Not huge amounts, but enough to annoy me. In my research, I knew voltage drop was a potential risk. As the strips get longer, there's too much resistance in the wire to carry enough power to keep the LEDs uniformly bright. It's a matter of physics, and it's not really avoidable.

The solution however is simple - add more power (from the same power supply). Adding another power (and ground) to the other side of the strip injects some more 5V goodness into the strip and keeps the colours uniform. Now, the entire strip is uniformly bright.

<note

Note that I only said power and ground - don't add another data connection. Since the LED strips are directional, it won't work as you expect, and could lead to strange behaviours if that data signal starts looping around the strip multiple times.

Extending the data signal is absolutely possible, but it's done in a slightly different way.

</note>

In total, the project cost just over £70.

This may seem like a lot, but many of the items were purchased in bulk. If I wanted another LED strip, I'd only need to purchase the LEDs themselves, and another PSU - there's plenty more of everything else. Sure, a similar kit would cost under half that, but you wouldn't come away with the satisfaction of having built something yourself, and knowing that the software running on it isn't doing strange things on your network.

#Review

The strip has been in place for a few weeks now, and I still love having it. Weekly movie nights look a whole lot fancier now. Adding a small halo of light around the TV helps blend the TV into the surrounding furniture, and reduce the intensity of the brightness coming from it to something less eye-searing. Thanks to some HomeAssitant automations, the strip automatically turns on and off based on the TV and time of day (sunset in this case), meaning I don't have to remember to turn it on, and I don't need to remind my partner to do the same.

The TV is quite far from the wall, so a lot of the brightness is lost. The TVs stand looks nice and slim from the front, but means the back portion is pretty large to act as a counterbalance. At some point in the future I'd like to wall mount it, which should help drastically, but that's yet another project for another day. There's still enough brightness for the room, and the light diffuses evenly.

Would I recommend someone else try this? Absolutely! I enjoyed playing around with LED strips and WLED, and this will be the first of many LED strips deployed in my house. Would I recommend a non-tinkerer build it from scratch rather than purchasing a kit, almost certainly not. Sure, it was fun, but it's time and effort many people won't see value in. The kits are reasonably priced, featureful, and don't need any maintenance (so long as the software keeps being maintained).

#Next

There's just one small problem with it: The strip only does what I tell it to. Generally that's a fixed colour or simple effect - it doesn't react to what's on the TV. With a strip and controller in place, I can get more fancy as time goes on. I've been eyeing up Hyperion for a while for reactive ("bias") lighting, but getting it to integrate with my setup without sacrificing the 4K HDR goodness is a little difficult. I've got some ideas, and they're slowly getting higher on my list as I love this setup even more. This is probably a big reason I'd just get a kit, but I'm hoping I can still replicate it myself.

<cta

Adam, if you're reading this, get to work!

</cta>

#Appendix: Parts

If you're looking to replicate this yourself, these are the parts I used. These are by no means the best, cheapest or more efficient, but they worked well enough for me.

<note

These links are not affiliate links, but you can still support what I do.

</note>

Read the original on theorangeone.net

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.