AC Dimmer circuit ideas

Hey all - I built a working AC light dimmer (110v/60hz) using some guidance from the following link: http://www.instructables.com/id/Arduino-controlled-light-dimmer-The-circuit/

It works fine, but I’m looking for ways to dramatically improve the design. To summerize how the above works - it incorporates a zero-crossing detector fed into the arduino, and the arduino uses that to output a signal to a triac that switches on/off very quickly in sync with the AC frequency.

I’d like to rely less on the arduino for the timing, and feed the zero-cross signal directly into a 555-timer which is then controlled via PWM on the arduino. That way - I wouldn’t be relying on the arduino to control the output signal timing so if it is performing blocking calls and such (network connections etc), the AC light doesn’t flicker.

I’m a novice when it comes to the circuit side of things. I did find some sketch notes http://i.imgur.com/bHNxw.jpg (found on reddit http://www.reddit.com/r/arduino/comments/1417sp/dimming_ac_lights_with_pwm/)from a guy who did the same kind of thing… looks to me like a sawtooth generator that is fed by a zero-cross signal and PWM from the arduino, but I haven’t had much luck trying to reproduce - or understand - the circuit.

Am I going about this wrong or is this the right direction? 8)

How about this;-
Solid State Relay Voltage Resistance Regulator

Output Voltage : AC 24-380V
Rated Load Current : 40A
Potentiometer Input Resistance : 500K (Potentiometer is Not Included)

Amazon, $15.38 & FREE Shipping (Two-Day)

if <10A, the heat sink could be removed.

500K Potentiometer, Amazon, $7.99 & FREE Shipping (Two-Day)

I wanted to avoid using an SSR due to the bulk, though that would reduce complexity. Looking for a way to externally sync the phase and pulse generation circuit, so the arduino can be free to do other things without affecting output.

I started looking at CD4046's - a phase locked loop generator but I don't quite understand if it would fit the bill better than a 555.

(1) Arduino PWM could be RC'ed into a "stable" DC (2) Zero_Cross could be RC'ed into a sawtooth

(1) Is the adjustable threshold voltage of a comparator (inverting input) (2) Is the trigger voltage of a comparator (non-inverting input) The comparator output is low till (2) > (1) The output will go HI quicker, with respect to ZC, when threshold is closest to Gnd.

The comparator output is the trigger (low-to-hi transition) of a non-retriggerable multivibrator (74HC221). The '221 output would go to the input of an opto-triac the output of which is connected to the TRIAC gate. Just keep the pulse width narrow enough that it won't extend past the next ZC at max delay.

damn you're smarter than me. lol ;)

I think I understand what you're recommending. I think another way to implement it would be (but I haven't tried yet):

Use a monostable 555 with external trigger coming from the zero cross circuit, and use the arduino's PWM output to control the duty cycle. I think that would work, but I'm going to read up on the 221 you suggested first.

replaysMike: I wanted to avoid using an SSR due to the bulk, though that would reduce complexity. Looking for a way to externally sync the phase and pulse generation circuit, so the arduino can be free to do other things without affecting output.

I started looking at CD4046's - a phase locked loop generator but I don't quite understand if it would fit the bill better than a 555.

Ok, let me list your requirements;-

  1. compact
  2. zero-cross control
  3. 5 V pwm control

Here we go for Plan B;- Solid State Relay Zero-Cross, 5V PWM Regulator, now we need to select SSR base on current and it will be compact. There is no major difference between SSR and DIY package but time to delivery, cost, liability. However DIY will give us more fun, flexible, help learning...

Yup I hear what you're saying.. SSR is quickest to use, I think I'm shooting for DIY that makes me learn something ;) I have a lot to learn!

Getting a 555 configured as a monostable to provide the delay between zero crossing and turning on the triac is straightforward, but controlling that delay from the Arduino is not. I think you should continue using the Arduino to generate the delay. To avoid problems with blocking calls, use the zero cross signal to generate an interrupt. In the interrupt service routine, clear one of the 3 timer/counters in the atmega328p. Then use one of the output compare pins of that counter to drive the opto isolator that drives the triac. You can program the delay by setting the value in the output compare register for that timer.

Assuming a 16MHz Arduino, then you can use the 8-bit timer 2 with the prescaler set to 1024 and get a timer resolution of 64us. That gives you 156 brightness steps using 50Hz mains or 130 steps using 60Hz mains. If you need more steps than that, you can use the 16-bit timer 1 instead.

How about this work around;-

replace 2.5k potentiometer with digital potentiometer? arduino->digital potentiometer->555