An attempt at a multi-channel incandescent light dimmer using the ESP32. Will eventually provide HTML/javascript based UI for dimming lights.
Still under construction. Able to do fades of up to 4 dimmer channels.
Experiments with the LEDC peripheral revealed a need to perform dimming manually (instead of with LEDC fade functionality) due to inability to adjust PWM phase via dimming. So, we implemented the dimming logic inside zero-crossing interrupt routine, but needed to perform all math as fixed-point due to hard faults when doing floating point in ISR.
Next step is to implement HTML/wifi based control. Looking at possibly using
- Sparkfun ESP 32 Thing (although any ESP32 module should work, possibly with changes in pin configuration).
- 2x 4 channel AC light dimmer board (but any MOSFET-based dimmer board with zero-crossing detection should work).
Requires ESP32 IDF.
Currently using v4.4.3 (git checkout v4.4 --recurse-submodules
)
. /path/to/esp/idf/export.sh
idf.py set-target esp32
idf.py menuconfig
idf.py build
idf.py -p /dev/tty.usbserial* flash