Installing LED strips that can be programmed yourself: This is how you do it


LED strips are fun and safe to work with and can also be used flexibly. You can use them, for example, as mood lighting in the living room or garden. Programmable LED strips make it even more fun to experiment with light. This allows you to work with colours, effects and patterns. With WLED you don’t even have to do any real programming.

With LED lighting and LED strips you can create almost all types of light and let your creativity run wild. In this article we look at LED strips. You can use these flexibly. For example, you can mount them on the inside of a cove along the ceiling for indirect lighting. Because the light is nicely distributed, this can serve as (atmospheric) basic lighting. You can also easily store extra cables in a cove.

Alternatively, you could also mount an aluminum profile with a hood against the ceiling in which you place the LED strips. Such a profile is always advisable: it keeps dust away and aluminum conducts heat, which extends the life of the LEDs. With a profile in view, you can use a diffuse hood that hides the electronics and distributes the light better. LED strips are also often used outdoors.

For mounting LED strips you can usually use clips (supplied) or double-sided adhesive tape. The latter usually works fine, because the whole does not weigh much. The LED strip itself also has an adhesive side, so you can stick it in the profile.

Many variants

LED strips come in all shapes and sizes. For example, the length of the strip (usually 1, 2 or 5 meters), the voltage (usually 5, 12 or 24 volts), the density of LEDs on the strip and the watertightness varies. In this article we used LED strips with the popular WS2812B.

On an LED strip, the components, which we call pixels, are placed one behind the other, usually at 30 or 60 per meter. Color (RGB) and brightness can be controlled separately for each component. The strip works on 5 volts. You can use several in succession, but especially with high density of the LEDs and with longer lengths you have to keep a close eye on the voltage supply, more about that later.

With regard to water resistance, you have several options with this type. For this you look at the degree of protection. Known are mainly IP30 for indoor use and IP65 or IP67 for outdoor use. For indoors it is best to choose IP30, because these strips are easier to process; think of cutting and soldering loose ends.

With the WS2812B you can conjure up different colors and segments.

Control LED strips

To control an LED strip you only need one pin of a microcontroller (see the box below ‘How do LED strips work?’). For controlling you can use a raspberry pi or Arduino, but also an ESP8266 or ESP32 microcontroller. We opt for the somewhat more powerful ESP32. We then install the WLED software on it. It is also doable for a beginner. Thanks to WLED, you don’t have to program yourself.

After flashing the software, your microcontroller will create a Wi-Fi hotspot where you can log in to handle the initial setup and connect to your own Wi-Fi network. You can then easily operate the LED strips via a browser or app. Integration with Home Assistant is also possible, the well-known software for home automation, which we have written about before. So you also immediately have smart lighting.

The ESP32 is a popular microcontroller for controlling your LED strips.

How do LED strips work?

LED strips with the WS2812B are very popular and relatively easy to use. But how exactly do they work and what happens when you control them? Each component on the strip (or pixel) can display the colors red, green and blue and has an input and output for data. That data is processed within the component.

In fact, the microcontroller sends a long ‘pulse train’ with the desired color and brightness for each pixel. Each component ‘snacks’ its information and passes on the remainder. That is why you will have to set the number of pixels in WLED, so that the pulse train is actually long enough. The order of the pixels doesn’t matter either, as long as the output of one pixel goes to the input of the next. You can therefore also cut the strip between each pixel, on the cutting line, to shorten it or to link it to a second strip.

LED strips contain WS2812B pixels connected in series.

power supply

Both the microcontroller and the LED strips require a power supply. That may be the same power supply, because both work with 5 volts. If you use a separate power supply, make sure that the ground (gnd) is common. You could optionally switch the power for the LEDs on and off with a relay, via a pin on the microcontroller. WLED offers standard support for this. The WS2812B always consumes some power, even if it does not provide any light. You can limit the standby use with this.

What kind of power supply you need depends on the number of pixels and the desired brightness. With the WS2812B you can assume up to 60 milliamps (mA) per pixel. That is with the color white, where all LEDs (red, green and blue) will light up, and with full brightness. At 60 pixels per meter, this is 3.6 amps (A) per meter. For 5 meters you need a power supply that can supply 18 amps, so 90 watts in total. We recommend taking some extra margin. The Mean Well power supplies are well-known and reliable, for example.

Mean Well power supplies are a popular and reliable option.

voltage drop

A problem when working with LED strips, especially at 5 volts, is that a significant voltage drop can occur, especially at longer lengths. As a result, the LEDs at the end of the strip burn less brightly or with different colors. A second problem is that a relatively large current can flow, especially at higher brightness, which can lead to unsafe situations.

You can solve these problems by connecting additional power cables in parallel, for example every 2.5 or 5 meters. A 5 meter LED strip usually has an extra pair of power cables at the end. You can always solder wires to the 0 and + of the strip yourself. Make sure the cables are thick enough to handle the required current and to limit the voltage drop.

If it is very difficult for your project to bring extra cables to the LED strips, for example because you will be working with very long lengths, it might be better to opt for 12 volts. Once you have connected everything, connect the data line of the LED strip to the data pin of the microcontroller. With the ESP32 this is D2 (gpio 2). With a longer cable you may need a so-called level shifter (3.3 to 5 volts), because the ESP32 produces a lower voltage (3.3 volts) than the WS2812B expects (5 volts).

Longer LED strips often have extra connections to inject power.

Installation of WLED

WLED is one of the most popular packages for controlling LED strips with, for example, the WS2812B. The software also offers support for some other types, such as the WS2811 and WS2815, both on 12 volts. The first step is to flash the software on, for example, an ESP32. There are several methods for this.

An easy method is to use the ESP Home Flasher tool. This is a program for Windows that recognizes the ESP32, when the drivers are installed, and can then flash the image file of WLED. We recommend that you consult the instructions on the WLED website if it does not work immediately. Via a smartphone or tablet you can then log in to the hotspot with the name WLED-AP and the password wled1234†

Then visit the address with a browser 4.3.2.1† You can now specify the settings of your Wi-Fi network, so that the microcontroller connects directly to that network from now on. You can also choose a name, for example wled-office.local† You can then operate the LED strips further with a browser at that address.

With WLED you can set simple colors and effects for your LED strip.

Working with WLED

When you open the WLED user interface, it is useful to first Config go through the settings for your LEDs. The number of LEDs is especially important. If the number is not set correctly, the LEDs further down the strip will not light up. You can also read what kind of power supply is recommended on this configuration page.

below colors you can choose a color or pattern and under Effects one of over a hundred effects. It is also interesting that you Segments different segments that you can then give a different color or brightness. To set this it is useful to go to PC Mode to go.

Then make sure that a segment is checked on the right and choose the color, pattern and effect on the left. You can also control the LED strips with WLED via external programs. For example, you can give light shows by installing the xLights software on your PC. It then works together with WLED.

Within WLED you can divide an LED strip into several segments.

Other applications

In addition to WLED, there are other applications for controlling your LED strips. Popular, for example, is the imitation of the well-known Philips Ambilight (see the box below ‘Atmospheric backlighting’). This is possible with LED strips with the WS2812B. We recommend LED strips with 60 LEDs per meter for optimum brightness. Calculate the wattage for the power supply needed, with some margin. It mainly depends on the total length of the strip and therefore on the size of your TV.

Characteristic of Ambilight is that the LEDs on the back of the television do not always adopt the same color, but adapt themselves individually to the color that can be seen at the same position on the screen. Because you can adjust the color and brightness for each pixel on an LED strip with WS2812B, this is not a problem. Obtaining the image information is more challenging. There are a few ways to get that done.

A proven method is to use a Raspberry Pi Zero W with a one-input, two-output HDMI splitter. You connect the signal from, for example, a media player to the input. The first output simply goes to the television and the second to a video capture card that converts HDMI to USB, connected to the Pi.

Software, such as Hyperion, can then use that video stream to send an Ambilight signal to the LED strip via one of the gpio pins on the Raspberry Pi. You do have to enter some settings, so that the software knows, for example, where and how the LED strips are placed.

With Hyperion you can mimic Ambilight for any television via a video grabber.

Atmospheric backlight

Ambilight is a feature on Philips televisions. In fact, these are LED lights that are mounted on the back along the edges of the television. This causes the wall behind the television to match the color on the screen. You can adjust it to your taste in many ways. It not only looks attractive, but is also calmer for your eyes. If desired, you can also link your Philips Hue lamps to your Ambilight.

For televisions without Ambilight, Philips has been offering the pricey Hue Play gradient light strip (from 180 euros) for some time now. With the LED strip, equipped with mounting clips and available in three sizes, you can add Ambilight to any television. You are not there yet with the purchase of the LED strips, because you also need a Hue Bridge (60 euros) and Hue sync box (250 euros). That makes it attractive to build yourself, as briefly explained in the article.

†

Recent Articles

Related Stories

Stay on op - Ge the daily news in your inbox