4 channel Digital LED controller – ET-DL01
Our previous design, the ET-AL01 Analog LED controller, was designed to control the regular “Analog” (RGB) LED strips. These strips are easy in use, but due to the way they work, the whole strip will emit the same color.
There are RGB LED strips available which have RGB LEDs installed which can be addressed individually, the so-called “Neopixel” strips. These strips are based on LEDs which use a WS2812 or compatible interface chip, which allow each LED to have a different setting / color. There are even addressable RGBW and WW/CW addressable LED strips available. More on that later.
Please subscribe to our YouTube channel and hit the bell to never miss a (esp)thing!
The requirements were:
- ESP32 or ESP8266 controlled. Preferably ESP32, which allows more LEDs to be controlled at a fast rate
- Operating at 5, 12 or 24V DC, so the LED power supply could also feed the controller
- Four output channels
- Two input channels for sensors
- One universal IO
- Serial interface
- Must fit in a nice looking enclosure, should not look too industrial
- Parts should be available at AliExpress or Amazon for affordable prices, making it as cheap as possible to build
- Firmware should be ESPhome or WLED. (Something which is achieved by using the ESP32 / ESP8266 modules)
The LED strips are normally based on a WS2812 or compatible controller chip. A table showing the electrical characteristics is below:
As you can see the Vdd, or the power supply, of the chip is normally between 4.5V and 5.5V, and the logic levels to drive the chips are related to the Vdd. A logic “1” is defined as “0.7 Vdd”, which means that when the chip is powered by 5V, the logic “1” level is 0.7 x 5.0V = 3.5V. The logic “0” level is defined as 0.3 Vdd, which results in 1.5V.
These levels indicate that a voltage less than 1.5V is interpreted as a logic “0” and a voltage greater than 3.5V is interpreted as a logic “1”.
Since the ESP8266 or ESP32 controllers are using 3.3V as IO voltage, which is not sufficient as per the datasheet to reliably generate logic “1” voltages, some sort of interfacing needs to be created.
As indicated above, there needs to be a reliable way to generate the correct voltage levels to drive the LED controller chip. In our previous design we had a similar issue, not to drive a chip, but to drive the MOSFETs at a higher voltage. We can use exactly the same solution, the 74HCT244 chip, for this Digital LED Controller. For a complete explanation why this chip is suitable, please read the section in the ET-AL01 blogpost.
See below for the signal coming from the ESP32 to the 74HCT244:
This is the output from the 74HCT244 to the LED strip:
Output frequency: (Measured with one channel in use, running the “Rainbow mega fast” effect.)
As you can see the pulses are sent out with a frequency of 800kHz.
The LED strips come in several different power supply versions. The most common supply voltage is 12V, but 24V strips and 5V strips are also available. To be able to feed the ET-DL01 controller from the same power supply as the strips it is driving, the design has incorporated a voltage regulator which allows input voltages of 8 – 24V. If 5V strips are being used, the voltage regulator needs to be bypassed, for which a simple solution has been created. At all times, the IO voltage to the LED strips will be 5V!
When the power supply is 5V, do not install the diode D1 and voltage regulator IC1. Instead place a jumper as indicated on the PCB. This will remove the reverse polarity protection, so please take extra care when connecting the power supply to the controller! Since there is no voltage regulator, please make sure the voltage does not exceed 5V!
The controller has a total of 4 outputs for the LED strips. These outputs are exposed on the terminal strip, and are referenced to the GND (negative) connection of the power supply. To make sure that the LED strips work reliably, it is very important that the GND (negative) connection of the data connection is properly at the power supply. It is recommended to keep the wiring between the controller and the LED strips as short as possible!
The controller has 2 inputs for switches or sensors. To activate the inputs, a voltage of 3.3V or 5V needs to be applied. For this reason a 5V connection is made available on the terminal strip, which can be used to power sensors etc. Both inputs are isolated from the controllers by an optocoupler. The optocoupler protects the inputs of the ESP module against damaging voltages, which can be picked up by long wiring to the input switches or (faulty) sensors.
Besides the dedicated inputs and outputs, the controller has one additional IO pin exposed. This pin is directly connected to the controller, and can be configured as input or output by the YAML configuration file. Since it is directly connected, take care in using this pin, since it is possible to damage the ESP controller easily!
Lastly, the serial port of the ESP module has been made available. This serial port uses 3.3V signal levels. “TXo” means transmit out, data from the ESP module to the outside world, “RXi” means receive data from the outside world to the ESP module. Be careful not to exceed the 3.3V voltage levels, since this might damage the module permanently.
Circuit diagram and PCB
Bill of materials
See below the list with the components you will need to build the DL01 controller. A number of these items will not be sold in smaller quantities at AliExpress. We will try to use the same components as much as possible in future projects.
We would really appreciate it if you will use the links below to buy the components, since it will give a little bit of commission to us without any additional cost for yourself. These commissions will be used to cover some of the costs involved in the development of the design.
|WEMOS1||1||Wemos Mini D1 ESP32*||AliExpress|
|WEMOS1||Wemos Mini D1 ESP8266*||AliExpress|
|IC1||1||Switching regulator 8-32V in, 5V out||AliExpress|
|OK1, OK2||2||PC817 / EL817 Optocoupler||AliExpress|
|C1||1||470µF / 16V 6mm diameter, 2.54mm pitch||AliExpress|
|C2||1||0.1µF – pitch 5.08mm||AliExpress|
|R1, R2||2||Resistor 220 ohm||AliExpress|
|X1||1||9 pole terminal, or 3x 2 pole + 1x 3 pole. 5.00mm pitch||AliExpress|
|JP1, JP2||Male pin headers. 2.54mm pitch||AliExpress|
|PCB||1||A 5-pack is the smallest order at PCBway, enough for you and your friends 😉||PCBway|
|LED strip||opt.||12v WS2811 RGB strip||AliExpress|
|LED strip||opt.||12V SK6812 RGBW strip||AliExpress|
|Power Supply||opt.||SANPU SMPS LED Driver 110v/220v 12v 150w||AliExpress|
* You only require one of the modules!
Putting it together
Like with all other projects, it is the easiest to start with identifying the components purchased as discussed in the blog post. After sorting the components and cleaning the PCB, start with the lowest components first. For this project, we advise to work in this order:
- Pin headers
- Screw terminals
- ESP module headers (Use the hints in the soldering blog post!)
- Electrolytic capacitor
- Voltage regulator. Make sure that the voltage regulator is not too tall for the enclosure. You can reduce the height by either by bending the pins of the voltage regulator a little bit, or mounting the regulator horizontally, so it hovers above the 74HCT244.
Once all components are soldered in place, perform a good visual check of all joints, and pay particular attention to possible solder bridges (unwanted solder connections between pins). Do not forget to clean the excess solder flux from the PCB using alcohol!
substitutions: devicename: et-dl01 long_devicename: ET-DL01 Digital LED controller esphome: name: $devicename platform: ESP32 board: mhetesp32minikit wifi: ssid: "esphome" password: "Qwe123456" ap: ssid: "$devicename Fallback Hotspot" password: "yourpass" captive_portal: logger: api: password: "yourpass" ota: password: "yourpass" sensor: - platform: wifi_signal name: "WiFi Signal $devicename" update_interval: 60s light: - platform: fastled_clockless chipset: ws2812b pin: GPIO22 num_leds: 100 rgb_order: BRG name: "$long_devicename channel 1" - platform: fastled_clockless chipset: ws2812b pin: GPIO26 num_leds: 100 rgb_order: BRG name: "$long_devicename channel 2" effects: - addressable_rainbow: - addressable_rainbow: name: Rainbow Effect With Custom Values speed: 10 width: 50 - addressable_rainbow: name: Rainbow mega fast speed: 35 width: 200 - addressable_scan: - addressable_scan: name: Scan Effect With Custom Values move_interval: 80ms scan_width: 1 - addressable_twinkle: - addressable_fireworks: - addressable_color_wipe:
Under normal circumstances the DL01 will be fed by the same power supply as the LED strip. Since the LED strip can draw a significant amount of current, it is advisable to connect the DL01 in the following manner: (We use a 12V power supply and 12V strip as an example)
As you can see, a separate negative (GND) wire runs from the DL01 module to the negative of the power supply. The positive connection can be “shared” with the strip, since the module contains a regulator which will filter out the voltage dips and spikes due to the change of current to the LED strip.
The “Din” connection of the strip is connected to the “CH1”, “CH2”, “CH3” or “CH4” terminal.
For the power wiring, do not use very small wires, since this will create issues with the higher currents to the LED strip. For the data connection you can use small wire, since there is a very small current flowing through the wire.
In case you would like to connect a sensor or switch to the DL01, you can do this as per below example. We show here the connection to a PIR motion detector. The PIR module runs at 5V, which is available on the terminal strip:
Since the currents are small, you can use small wire for this. The inputs are 5V tolerant, so there is no worry about blowing up the module.
ESP32 or ESP8266?
For this project, like with the AL01, you can use the ESP8266 or the ESP32 based modules. The difference between the modules is mainly the processor speed, which determines the max. number of LEDs which can be controlled at a higher refresh rate. For smaller (less LEDs) systems, an ESP8266 based module will work fine. However the moment the number of LEDs in the system becomes too large, there is a chance that the LEDs will start to react visibly slower. Therefore we recommend using an ESP32 based module, unless the number of LEDs is very limited.
During the construction of the prototype, and the measuring of the signal waveforms afterwards, we found out that a bad batch of the 74HCT244 were delivered. The output voltage never reached the expected 5.0V, but did not go over 3.6V. The LED strip did work with this signal though, but if this 74HCT244 batch would have been used for the AL01 analog dimmer, the MOSFETs on that module would not be driven correctly, resulting in a lower light output. We did a test, and instead of the expected 12V output, only 7V output was achieved on the AL01 dimmer.