The ESP32 Backlight Controller is a device designed to enhance workspace illumination for nighttime work sessions. Built with convenience and comfort in mind, it provides users with adjustable brightness control for COB LED-strips, ensuring optimal lighting conditions without causing strain on the eyes.
The ESP32 Backlight Controller offers a streamlined solution for individuals who prefer working during late hours but find traditional lighting too harsh. By seamlessly integrating Wi-Fi connectivity and a range of features including FTP server support, asynchronous web server functionality, and WireGuard compatibility, users can easily customize and control their workspace lighting to suit their preferences. With its intuitive setup process and OTA firmware update capabilities, the device offers both convenience and versatility, making it an ideal addition to any nighttime workspace.
- FTP-server to load web-page content and .json configuration;
- Asynchronous web-server provide ability to keep connection from everyone in the same net;
- PWM 15 KHz;
- Save previous state of brightness (Every 300 seconds);
- OTA firmware update;
- Configuration over JSON (which are put via FTP).
-
Required libs: ArduinoJson, AsyncTCP, ESPAsyncWebServer, AsyncElegantOTA, ESP8266FtpServer; As arduino's libs support is weak, please, find some of prerequisites in the "prerequesites" branch, as during timeflow some of the libs are deprecated, moved or forgotten & did not fixed;
-
Prepare your config.json:
{
"ssid": "your_wifi_ssid",
"password": "your_wifi_password",
"ap_ssid": "access_point_ssid",
"ap_password": "access_point_password",
"hostname": "your_hostname",
"login_name": "your_login_name",
"login_pass": "your_login_password"
}
JSON fields description:
ssid - Name of your home Wi-Fi access point;
password - Password of your home Wi-Fi access point;
ap_ssid - SSID of ESP32 AP in case if connection to home Wi-Fi unsuccessfull;
ap_password - Password of ESP32's AP;
hostname - ESP32 hostname;
ftp_username - FTP username;
ftp_password - FTP password;
- Compile and download firmware to your ESP32;
- Assemble device;
- Via Wi-fi your Wi-Fi router interface or via VCP (COM-port in Arduino IDE) check ESP32 Wi-Fi IP addr;
- Connect to ESP32 via WinSCP, FileZilla or any other ftp-service, please use FTP port 21, enter your ftp_username and ftp_password. Drop .html, .css, .json files to ESP32;
- Enter IP address to browser's address bar from a device in one network with ESP32;
- (optional step) It would be better if you could provide DHCP-reservation of ESP32 IP address in your Wi-fi router;
- Use the device.
In case if you need to update firmware, you may use OTA update. Just enter /update, drop your file there and wait untill OTA will finish.
X1 - input source, X2 - load. COB let strip or whatever. In case if input voltage higher than 12V, please use heatsink on your 7805 as it is linear DC-DC convertor, all not-used power will be converted to heat. Resistors values are highly variative. R3, R4 should not be too small as it's pull-down resistors and their main goal is to close gates in case of logic level change. R1 should be selected together with VT2, to provide enough current/voltage to open/close VT1 gate. VT2 itself can be any suitable for 3.3V bipolar transistor, TTL logic gate like NOT, AND, whatever. Just be aware that it should be enough to control powerful VT1 transistor. Basically you can use the device without VT2, you just need to find any MOSFET with low Rds and Vgs 2...4V, it would be even better, as IRF740 should work with ~220V load, so its an overkill in this schematic. I just found only IRF740 in my storage couple of years ago :D L1 is optional, it's main goal is to supress PWM dimming. It can be used together with a capacitor, or just L1 itself. But it's nominal should be selected based on your led strip and personal preferences. Please, during selection start with some small values or use dimming circuit as in case of sharp power-off L1 will generate current needle and can burn your MOSFET. ESP32-Wroover module is used here. But any other ESP32 with suitable WiFi support is OK. You just need to configure your GPIO, PWM, etc. via conf.h file before compilation.
In case if you need to control device with voltage 20V and higher, please select another DC-DC step-down convertor from your Vin to 3.3 V (ESP32 power), also you should select another transistor/transistors or use power control module, solid-state relay, etc., as I'm not sure that Vds of your MOSFET would be enough to handle the higher voltage