Using a relay with WLED

Table of Contents

Introduction #

WLED has built-in support for using a relay module to interrupt power to certain devices. Oftentimes this is used to cut power to the LEDs when they are turned off in WLED, as they still draw small amounts of power even when powered off with the software. However, another equally popular use of a relay is to interrupt power to the power supply powering the board and the LEDs. This helps extend the life of the power supply, which normally will continue to use power and cycle its fans to keep cool even when the LEDs are off. By interrupting power to the power supply when the lights are turned off, no more current will be used by either the power supply or the LEDs. However, since the board will no longer be supplied power, it needs a backup power source to maintain a network connection to turn the lights back on, which will trigger the relay to restore power to the power supply.

*Warning* This project requires making connections with both DC and AC electricity, which is dangerous. If you are not comfortable and familiar with electricity please entrust this project to an electrician. Improper wiring or poor connections can lead to sparking or fire, electrocution, or the damaging of circuit board components.

Using a relay #

These steps will go over how to use an external relay with the Eternaglo Plus board to interrupt power to a power supply, however the steps are largely the same for interrupting power to an LED strip, with the difference being that the 12V DC line to the LEDs will be interrupted instead of the 120V AC line to the power supply.

This method uses a 5V single channel relay module, which usually looks similar to this:
wled relay module
Make sure to use a relay with sufficient specifications for your project. Many relays similar to the one picture above have a maximum current capacity of 10A, so keep that in mind for your project.

Begin by connecting the relay to the Eternaglo Plus board, which has a dedicated terminal for exactly this purpose. These relays need a connection to 5V power and ground, and a signal to trigger the relay open or closed. Ensure that there’s no power to the board before beginning your connections. Start by connecting the 5V pin on the Eternaglo Plus relay terminal to the DC+ terminal on the relay module, then the GND to DC-, and the IO5 pin to the “IN” terminal.

The 5V and ground will provide power to the relay. By default the relay will interrupt power without an additional signal to the “IN” pin. When WLED is powered on it will send that signal to the IO5 pin on the Eternaglo Plus. You will know that the relay signal is being sent via the green indicator LED near the relay terminal. Some relays, like the one picture above, have a jumper to choose whether the relay triggers when the signal is high or low. Most of the time they come preset to high, which is what will work in this scenario. If the relay you are using does not have the option to choose a high trigger, you can change a setting in WLED that will trigger the relay with a low signal instead. Read here to learn more.

Then you can connect your AC power to the power supply as normal, but interrupt the hot (black) wire with the terminal. The connection from the wall will be connected to the “NO” (normally open) pin on the relay, and the “COM” (common) pin will be connected from the relay to the power supply. Now, when the relay receives a high signal from the board, it will trigger the relay to continue the flow of electricity from the outlet, through the relay, and into the power supply. When the lights are turned off in the software it will cease to provide that signal, which will cause the relay to interrupt power.

WLED relay wiring diagram

Before plugging power back in, double check all your connections. Once they are verified to be correct and safe you can plug in AC power and verify correct functionality. In order for the board to maintain a network connection when the power supply is turned off it will need a constant 5V connection via the USB C input.

For more information on using a relay with WLED, click here.

Logo
© 2024 Eternaglo LLC
Proudly based in the mountains of Pleasant Grove, UT, USA