ESP32 with Triac
Posted: Fri May 03, 2019 8:04 am
Hello.
I've spend most of this week trying to find a working code for ESP32 ( not IDF ) which would works for trigering a triac ( PWM or so ) in a meaning of regulating the output ( dimming a lamp or so ) but NO LUCK AT ALL.
Most of the code I have found is about Arduino or ESP8266 with incompatible libraries or not working pieces of code for ESP32.
I've tried to implement the hardware timer of ESP32 for the trigering but seems like I am missing something.
Yet still banging against the wall and not sure where to begin.
I am using as a Triac - BTA41 with optocoupler MOC3063 and Zero Cross detector optocoupler 4N25 - seems like I am detecting the zero cross fine, but yet something is wrong with the timers.
Please, if someone have a working fine piece of code with ESP32 for dimming AC loads with triacs - share.
Thank You in advance.
P.S. I am attaching the circuit I have designed for my needs.
I've spend most of this week trying to find a working code for ESP32 ( not IDF ) which would works for trigering a triac ( PWM or so ) in a meaning of regulating the output ( dimming a lamp or so ) but NO LUCK AT ALL.
Most of the code I have found is about Arduino or ESP8266 with incompatible libraries or not working pieces of code for ESP32.
I've tried to implement the hardware timer of ESP32 for the trigering but seems like I am missing something.
Yet still banging against the wall and not sure where to begin.
I am using as a Triac - BTA41 with optocoupler MOC3063 and Zero Cross detector optocoupler 4N25 - seems like I am detecting the zero cross fine, but yet something is wrong with the timers.
Please, if someone have a working fine piece of code with ESP32 for dimming AC loads with triacs - share.
Thank You in advance.
P.S. I am attaching the circuit I have designed for my needs.