on
ESP32 Light Controller
To go along with my custom LED panels, I’ve design my own ESP32 based light controller.
This is an updated version of my original ESP-01 based design.
Key differences:
- ESP32 based
- SMD components
- Multiple LED channels
- USB connector and onboard USB to UART IC for easy flashing
Design
Power Supply
The required voltages are: 3.3V for the ESP32 and 5V for the LED strips.
The power input is a USB-C connector, which supplies 5V and 3.3V is the output of a linear regulator.
MCU and USB UART
Since the ESP32 does not have native USB support I added a CP2104 which handles USB-UART automatically.
Strapping pins and boot mode
The ESP32 will enter download mode if IO0 and IO2 are pulled down after reset.
Now, as it turns out, IO12 is also a “strapping pin” and is used to configure the SPI flash at start up. It needs to be pulled down for this ESP32 module. As you can see I have IO12 pulled up for LED channel 0. This prevented my controller from flashing, until I manually fixed it.
I’ve also included the auto-reset circuit so the ESP32 can be reset from USB-UART.
Level Shifter
The 3.3V IO from the ESP32 needs to be level shifted up to 5V to match the LED strip. This circuit is a non-inverting level shifter.
As mentioned above I had IO12 pulled up when it should have been pulled down. To fix this I removed R4 and R7 and let the internal pull-down set IO12 to 0 logic level.
LED ports
Large 1000uF caps are placed close to each LED port to prevent initial voltage spike from damaging the LEDs. Also a 100 ohm resistor is placed on the data line to prevent the initial flicker you typically see when connecting LED strips to an Arduino.
Firmware
I’m using wled for the LED control firmware. In the settings menu the output GPIO pins can be selected.
Results
As mentioned above I had to remove R4 and R7 to get the firmware flash to work. Though this seemed to prevent the auto-reset from working (where it did work before removing R4 and R7). Either way, download mode can be reached by using the boot button.
Future Work
WLED has a bunch of usermods I’d like to support like temperature sensors / fan control / buttons / etc.
Another thing I wanted to try was adding a USB-C power delivery sink controller to the board to request higher power levels from a supply.