5 channel Analog LED controller – ET-AL01
Table of Contents
Introduction
Michel asked me to design an analog LED controller with 5 channels, since he wanted to be able to control a nice LED strip with an RGB LED and a warm white and cool white LED (Like Philips Hue). When searching the internet he could only find controllers with a single channel, four channels or ten channels. But a 5 channel controller for these kind of LED strips was simply not available!
He was very specific in his request, so I wrote down some design parameters first.
Also check out our YouTube video, subscribe, hit the bell and send the link to all your friends. You know the drill 😉
Please subscribe to our YouTube channel and hit the bell to never miss a (esp)thing!
Design parameters
The requirements were:
- ESP32 or ESP8266 controlled. Preferably ESP32, due to the higher PWM frequencies the ESP32 supports
- Operating at 12 or 24V DC, so the LED power supply could also feed the controller
- Five channels, with an as high as possible current capability
- Must fit in a nice looking enclosure, should not look too industrial
- Parts should be available at AliExpress at affordable prices, making it as cheap as possible to build
- Firmware should be ESPhome. (Something which is achieved by using the ESP32 / ESP8266 modules)
Practical design
The heart of the design is a “Wemos Mini” (compatible) module. By using these modules, it becomes very easy to integrate, and greatly simplifies the design. It also allows people to pick an ESP32 or ESP8266 module, which creates a little bit of flexibility too.
To control the output channels, MOSFETs will be used, with a standard footprint / case so that a number of compatible models can be applied. The design is flexible enough to drive most of them.
Why use a 74HCT244 chip?
Since the ESP modules use I/O levels of 3.3V, and a lot of MOSFETs require more control voltage, a so-called “level shifter” needs to be used. Many different solutions exist, ranging from the usage of driving transistors, special level shift chips, or the usage of TTL chips. All solutions have pros and cons, and the decision has been made to use a TTL chip in this design. The decision was based on the easy (cheap) availability on AliExpress, very standardized operating parameters (irrespective of manufacturers!) and small footprint on the PCB.
The 74244 exists in a number of TTL families, all with their own parameters. When looking at the requirements of the design of the controller, the most suitable family is the “HCT” family. See the below table from the datasheet of Texas Instruments SN74HCT244:
See the below table for the IO levels of the ESP32:
If you compare the two tables you see that the output level of the ESP chips are defined as a factor of “VDD”. VDD is for the modules used 3.3V, so if we convert the levels listed to fixed numbers, we see that the “High-level output voltage” has a minimum of 2.64V, and for the “Low-level output voltage” a maximum of 0.33V.
When the input levels of the 74HCT244 datasheet are checked, we see that the max. “Low-level input voltage” is defined as 0.8V. Therefore the 0.33V is low enough to ensure that the level is detected properly. Same for the min. “High-level input voltage” which is defined as 2V. The 2.64V from the ESP32 is therefore more than enough to ensure the logic “1” is detected properly.
In the table you can also see the output voltage specification. There are only two levels given, “Min” and “Max”. The “Nom” (nominal) is missing, since the output will only take 2 possible levels, which are defined as 0V and “Vcc”. The “Vcc” in the circuit will be 5V, therefore the output voltage for a logical “1” will be 5V. This is very beneficial for the driving of the MOSFET connected to the output pin.
The last parameter which is important is the max. output current per pin:
The 74HCT244 can supply max. 35mA continuously per pin. This is important to drive the gate of the MOSFET sufficiently in a rapid manner. The gate – source connection of a MOSFET acts like a capacitor, which needs to be charged for the resistance between the drain and source to lower. If the current flowing into the gate is limited / low, this charging will be slow(er). The HCT series has one of the highest maximum output currents. The opposite for the “switching off” of the MOSFET, the capacitor needs to be discharged. A lower discharge current capability will result in slower switching.
For a more in-depth discussion regarding the design, read this blog post.
Circuit diagram and PCB
The design I came up with is this:
The PCB design of this diagram:
On top you see the GPIO interface pins. These can be used as a general purpose IOs. The number between ( ) are the IO numbers of the ESP32 modules, and the numbers between the [ ] are the IO numbers of the ESP8266 modules. You will need these numbers to configure the IOs in the software configuration. These pins are capable of handling 3.3V and 5V input levels, and if used as an output, 3.3V output level. To feed possible sensors, right next to the GPIO pins you will see the 5V and 3.3V power output connections. The 3.3V power is coming from the ESP module, and is limited in power. Try to limit the amount of current drawn from the pin (Think in currents not exceeding about 100mA). If you need a lot more current at 3.3V level, use an external voltage regulator, connected to the 5V power output. This is fed by the regulator on the PCB, and would normally be able to supply 250mA or more, depending on the regulator used, to the pin.
Next to the GPIO pins, 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.
At the bottom you see the screw terminals. The power input is located on the right hand side, and the LED strip will be connected to “CW, WW, R, G, B, +”
Build it!
Bill Of Materials
See below the list with the components you will need to build the AL01 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 project design.
Reference | Qty | Description | Link |
WEMOS1 | 1 | Wemos Mini D1 ESP32* | AliExpress |
WEMOS1 | Wemos Mini D1 ESP8266* | AliExpress | |
IC1 | 1 | Switching regulator 8-32V in, 5V out | AliExpress |
IC2 | 1 | 74HCT244 | AliExpress |
T1, T2, T3, T4, T5 | 5 | IRLZ44N or compatible logic level MOSFET | AliExpress |
D1 | 1 | 1N4001 | AliExpress |
C1 | 1 | 470µF / 16V 6mm diameter, 2.54mm pitch | AliExpress |
C2 | 1 | 0.1µF – pitch 5.08mm | AliExpress |
R1, R2, R3, R4 | 4 | Resistor 1k | AliExpress |
X1 | 1 | 8 pole terminal, or 4x 2 pole. 5.00mm pitch | AliExpress |
JP1, JP2, JP3 | Male pin headers. 2.54mm pitch | AliExpress | |
Enclosure | 1 | 76x56x29mm (AK-N-04) | AliExpress |
PCB | 1 | A 5-pack is the smallest order at PCBway, so talk to your friends 😉 | PCBway |
LED strip | opt. | 12v RGBCCT | AliExpress |
LED strip | opt. | 24v RGBCCT | AliExpress |
Power Supply | opt. | SANPU SMPS LED Driver 110v/220v 12v 150w | AliExpress |
Power Supply | opt. | SANPU SMPS LED Driver 110v/220v 24v 150w | AliExpress |
* You only require one of the modules!
Putting it together
When building the project 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:
- Resistors
- Diode
- 74HCT244
- Pin headers
- Screw terminals
- ESP module headers (Use the hints in the soldering blog post!)
- Electrolytic capacitor
- MOSFETs
- Voltage regulator. Make sure that the voltage regulator is not taller than the MOSFETs! You can do this by bending the pins of the voltage regulator a little bit, so it will lean a little bit.
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). Clean the excess solder flux from the PCB using alcohol!
Software configuration
Once everything is soldered together, it is time for the software configuration. Follow the instructions in our YouTube video. Configuration files below:
Secrets:
esphome_wifi_ssid: 'your_ssid' esphome_wifi_password: 'your_wifi_password' esphome_ap_password: 'your_ap_password' esphome_api_password: 'your_api_password' esphome_ota_password: 'your_ota_password'
ESP32:
substitutions: devicename: et-al01_esp32 long_devicename: ET-Al01 Analog LED controller (ESP32) esphome: name: $devicename platform: ESP32 board: mhetesp32minikit wifi: ssid: !secret esphome_wifi_ssid password: !secret esphome_wifi_password ap: ssid: "$devicename Fallback Hotspot" password: !secret esphome_ap_password captive_portal: logger: api: password: !secret esphome_api_password ota: password: !secret esphome_ota_password sensor: - platform: wifi_signal name: "WiFi Signal $devicename" update_interval: 60s output: - platform: ledc pin: 26 frequency: 25000Hz id: ledc_cw - platform: ledc pin: 18 frequency: 25000Hz id: ledc_ww - platform: ledc pin: 19 frequency: 25000Hz id: ledc_r - platform: ledc pin: 23 frequency: 25000Hz id: ledc_g - platform: ledc pin: 05 frequency: 25000Hz id: ledc_b light: - platform: rgbww name: "$long_devicename LED-strip" warm_white: ledc_ww cold_white: ledc_cw red: ledc_r green: ledc_g blue: ledc_b cold_white_color_temperature: 5000K warm_white_color_temperature: 3000K
ESP8266:
substitutions: devicename: et-al01_esp8266 long_devicename: ET-Al01 Analog LED controller (ESP8266) esphome: name: $devicename platform: ESP8266 board: d1_mini wifi: ssid: !secret esphome_wifi_ssid password: !secret esphome_wifi_password ap: ssid: "$devicename Fallback Hotspot" password: !secret esphome_ap_password captive_portal: logger: api: password: !secret esphome_api_password ota: password: !secret esphome_ota_password sensor: - platform: wifi_signal name: "WiFi Signal $devicename" update_interval: 60s output: - platform: esp8266_pwm pin: D0 frequency: 100 Hz id: ledc_cw - platform: esp8266_pwm pin: D5 frequency: 100 Hz id: ledc_ww - platform: esp8266_pwm pin: D6 frequency: 100 Hz id: ledc_r - platform: esp8266_pwm pin: D7 frequency: 100 Hz id: ledc_g - platform: esp8266_pwm pin: D8 frequency: 100 Hz id: ledc_b light: - platform: rgbww name: "$long_devicename LED-strip" warm_white: ledc_ww cold_white: ledc_cw red: ledc_r green: ledc_g blue: ledc_b cold_white_color_temperature: 5000K warm_white_color_temperature: 3000K
Using a channel as a digital output
If you do not require all the analog channels, there is an easy option to create a digital channel out of an unused analog channel. To do this, do not mount the MOSFET for the channel, but instead install a jumper from the top connection to the center connection of the MOSFET footprint. This will make a direct connection from the 74HCT244 output, to the screw terminal. Once this connection is made, the output can be used to drive a WS28XX (or compatible) LED strip. For the respective channel a YAML entry needs to be edited;
Light: - platform: fastled_clockless chipset: ws2811 pin: GPIO5 num_leds: 238 max_refresh_rate: 8ms rgb_order: BRG name: "$long_devicename-DIGITAL" effects: - addressable_rainbow: name: Rainbow Effect With Custom Values speed: 10 width: 50 - addressable_rainbow: name: Rainbow mega fast speed: 35 width: 200 - addressable_scan: name: Scan Effect With Custom Values move_interval: 100ms scan_width: 1 - addressable_color_wipe: name: Color Wipe Effect With Custom Values colors: - red: 100% green: 100% blue: 100% num_leds: 1 - red: 0% green: 0% blue: 0% num_leds: 1 add_led_interval: 100ms reverse: False
Final thoughts
After the design was finished, we both build a controller to test. The controller which Michel built has been in use for a number of weeks now, without any issue. No issues with MOSFETs getting warm or overheating, no issues with stability, so we are confident that this controller will work for you too.
This project, the ET-AL01 5 channel Analog LED controller, was the reason for starting this website. We found out that there are more circuits which we think people are looking for to build. What we decided to do is to create more projects with the same design philosophy; Easy to build, of easily and cheaply available components, and well tested. And they need to look nice too!
For us one of the major things is also to make sure that the projects / circuits we publish are safe to build by other people. We will do our utmost best to ensure this. However, like with all other DIY projects you will find online, we will not be responsible for any possible (financial) damage which might result from building our projects. Yes, unfortunately we need to include this disclaimer…
If you run into issues during the construction, or you have any question regarding this controller, please leave a comment below. We will try to reply as soon as possible!
Make sure to subscribe to our YouTube channel so you won’t miss any of our upcoming project videos!
I have been looking for a product like this for a long time !
can they deliver the PCB to Germany?
Yes! They ship worldwide!
Have fun building it..!
This is really good and I have been looking for a similar solution for a while now.
I have a couple of suggestions for the V2.0:
– An Ethernet port option for a wired connection to the server (may be something similar to “Lan8720 breakout”). Perhaps using a Board that supports PoE ?
– PIR sensor integration because why not!
– a binary_sensor ( a press button switch) to toggel the LED light locally using “Template Switch” function incase the connection with Home-Assistant server was lost for some reason
For general purpose, there are four gpio pins exposed, together with a power connection and ground. Check the top header on the PCB. Unfortunately there was no physical space to add screw terminals for these connections.
We will keep the suggestion of the Ethernet port / POE in mind. Maybe we’ll implement it in a future design.
Couldn’t find an analog 5 channel? What about the H801? https://esphome.io/cookbook/h801.html
That is indeed a 5 channel controller. I had 2 of them in my house, but it is esp8266 based and thus has software PWM with frequencies up to ‘only’ 1000Hz. The esp32 does hardware PWM up to 40Mhz.
I have mine running at 25.000Hz which makes a huge difference for video. If I now film from my office or make a teams call, there is no more flickering.
I also have the esp32 BLE enabled so when I am in the office some motion based automations are disabled using BLE presence detection.
The H801 also has no options for external sensors and no options for converting a analog channel to digital (addressable led).
Good answers! Perhaps I was fooled by your design parameters which included esp8266. Thanks for the great site.
Also https://quinled.info/quinled-an-penta-diy-specifications/
Greetings.
Just found your article, interesting idea already ordered my 5 PCBs 🙂
But as a ESPHome newbie I have a question: it is possible to I make ET-AL01 acknowledge a momentary switch, enabling physical power toggle, for example? I would be wonderful to control lightning through physical switch, leaving finetuning to the HA.
The short answer is Yes!
You can connect up to 4 buttons to the 4x GPIO spots on the bottom-right corner of the board (They are in pairs, with the GPIO pin right next to a ground pin). You can then use ESPHome to do any automation you like. I personally did ON/OFF, BRIGHTNESS UP, BRIGHTNESS DOWN, and toggling a single effect.
Hi, thanks for the design, I have built one and so far so good. I have a question though: what are the physical dimensions of the PCB, more specifically, what is the X and Y distance between the mounting holes? Thanks Ondrej
I don’t understand. If you build one, you have the measurments or not?
It would be more precise if you told me the dimensions instead of me measuring them from the physical PCB… That’s what I mean.
External: 70.0 x 50.0 mm
Holes: 61.8 x 40.9 mm
Hole diameter: 3.5 mm
Great project. So if I wanted to drive addressable LEDs (WS28XX (or compatible) LED strip) I don’t use the MOSFET. For a digital channel are the limits (i.e. max # LEDs per channel) driven by the MCU (ESP8266 vs ESP32) and the external power supply? What else I’d have to take into account?
If you are looking for a design only to drive the WS28XX LED strips, I would like to recommend the design we made for this: https://www.espthings.io/index.php/2021/08/15/4-channel-digital-led-controller-et-dl01/
To use one or more channels of this design for the WS28XX strips, make sure your power supply is sufficient, and that the cabling to the first LED of the strip is as short as possible. The data signals driving these strips use pretty high frequencies, and the timing is relatively critical. (See the comment section of the aforementioned post)
Looks great!
Are there Io unused? For i2c ina260 power measurement and a digital or analog input for internal temperature measurement?
BR
I’ve now had the boards for about a month and have successfully driven a wide variety of analog LEDs, but I have a couple concerns and would like some guidance:
Flickering! There are intermittent flickers while changing brightness, while being at a low brightness, and so-on. There is even flickering at full brightness. This is with 12V and 24V strips.
Off too early: The lights typically don’t light below <10% "brightness" in ESPHome. Is there a way to fix that or just mitigate it in ESPHome?
Thanks!
Can you please tell me which board you are using? Is it the esp8266 or the esp32? Intermittent flickering points to a CPU which is too busy to handle the pwm output in a timely manner….
The 10% brightness switch off you might be able to mitigate a little by changing the gamma_correct parameter of esphome.