AC light dimmer

jeancarlogrim
Posts: 2
Joined: Tue Jan 28, 2020 10:35 pm

AC light dimmer

Postby jeancarlogrim » Tue Jan 28, 2020 10:41 pm

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

Gardin
Posts: 31
Joined: Fri Dec 13, 2019 4:53 pm

Re: AC light dimmer

Postby Gardin » 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.

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.

jeancarlogrim
Posts: 2
Joined: Tue Jan 28, 2020 10:35 pm

Re: AC light dimmer

Postby jeancarlogrim » Thu Jan 30, 2020 6:21 pm

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

Who is online

Users browsing this forum: Majestic-12 [Bot] and 123 guests