Page 1 of 1
AC light dimmer
Posted: Tue Jan 28, 2020 10:41 pm
by jeancarlogrim
Hi, I would like to develop a AC light dimmer with ESP32. I am trying to use the Led controller pwm, but I need to sync with the zero cross input on falling edge. Can anyone help me telling me how to sync the pwm with input?
Regards
Re: AC light dimmer
Posted: Thu Jan 30, 2020 3:57 pm
by Gardin
I've built an AC dimmer using interrupts. One external interrupt get triggered by the zero cross of the mains voltage and from the ISR function I scheduled a pre-configured timer to turn a pin HIGH, so that the activating the triac.
Why are you using pwm with zero cross?
I know that there are some circuits that uses mosfets and pwm as control, and do not require zero cross synchronization... But I never built one of those and particular prefer using triacs.
Re: AC light dimmer
Posted: Thu Jan 30, 2020 6:21 pm
by jeancarlogrim
Gardin wrote: ↑Thu Jan 30, 2020 3:57 pm
I've built an AC dimmer using interrupts. One external interrupt get triggered by the zero cross of the mains voltage and from the ISR function I scheduled a pre-configured timer to turn a pin HIGH, so that the activating the triac.
Hello Gardin,
I was trying to make a 60hz pwm sincronized with the zero cross of main voltage. Basically the same you did. I tried to make with interrupt, I could make on Arduino IDE using the attachinterrupt function, but in ESP IDF I could now understand how the interrupt function works, I read the resources but I did not understood...
Is it possible you share with me your code for the dimmer?
Regards,
Jean Grim