Go Down

Topic: AC Light Dimming [success] (Read 21 times) previous topic - next topic

Fleckz

May 22, 2012, 04:06 pm Last Edit: May 22, 2012, 04:25 pm by Fleckz Reason: 1
OK, here is another success story for AC Light Dimming.
I was reading this topic,
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1230333861/30
ppl there asked about 220V AC Light Dimming, also, I was interested in making this, so I did. this works perfectly for 220V 50Hz mains.

First of all - basics, you can't just use MOC3020 (or similar) to dim AC light, because of sync problem, you need to tell arduino when to turn triac on and when off, if not in time, light will just blink. To do that, in old forum you see opto-coupler H11AA1, it has two LEDs inside, easy to use for AC, thou, H11AA1 are not available here at local stores, so i had to use 4N35 and bridge rectifier!
In this way you just let arduino know, when the phase changes in mains and use that info to toggle opto-triac!

OK, here are the files for this project: http://fleck.rullz.lv/acdimmer/
circuit, arduino code and Lazarus Project to control light! :)

For those with 60Hz mains, you have to change number "34" in line:
delayMicroseconds(34*(255-dim));
My guess would be around 27 for 60Hz, but as i don't have 60Hz mains here, i can't try! If somebody can, let me know, i will update post etc...

Also all comments are welcome, bad and good...

Hashma

Nice work! Is this useable to control fan speed etc.?

I am going to make a PCB and test it out soon. Really nice to have the hard work done already! 8)

Fleckz


focalist

#3
Jun 01, 2012, 07:40 am Last Edit: Jun 01, 2012, 08:30 am by focalist Reason: 1
Here's a silly question.. I had wondered if it would be possible to do the phase sync and timing in a different way.. by using a feedback system.  Remember, I only know enough to be dangerous.  I just don't see why dimmer circuits aren't.. "smarter".

What I mean is that in my mind, you could initially switch the TRIAC on at any point, and "place" in the timing of the phase could be determined with a (adding a zener? to shunt the voltage) diode feeding a voltage back.  One half of the cycle, there's a voltage passed back, measure that duration and you know both the frequency and the phase timing.  Since the frequency is calculated from the timing, and the phase switching is done scaled accordingly, wouldn't that remove line frequency as a variable?  In addition, if you are able to monitor the voltage, you can measure the magnitude.. and therefore calculate desired output voltage switching.. removing source voltage as a variable (within reason).  I guess I'm just describing a switching-regulated power supply aren't I.... but what exactly is the difference?  It just seems to me that all these isolators and such ought not to be necessary, if the dimmer is capable of intelligently modifying the timing based on sensed output.. and the resulting device would be more flexible than a device which is locked in for a particular source voltage and frequency.

As I understand (and it's more than possible I misunderstand), dimmers function by switching the power off and on at appropriate times, effectively making them voltage regulators with a Bipolar PWM output of a sort. Other than finding the duration of the phase and the timing of the phase, I would think pretty much anything else is a matter of switching at the appropriate time.   Am I off base?

I really haven't researched TRIACS all that well, and maybe have misinterpreted how these beasties are used.  Seems like you have gotten a good grasp of how these work and what is required for them to do the job.. mainly a bit of me being too lazy at the moment to research why I ought to know better...
When the testing is complete there will be... cake.

Magic

In short : no, You can not.

And a little more elaborate : the TRIAC can only be switched on, and it will switch off itself when the voltage over it is 0 (or very close).
What You are describing can be done with an IGBT, but also in this case a 0-crossing detector is used. That is what sometimes is called a "soft dimmer". This works so that the IGBT is switched on at 0 volts and switched off depending on the level wanted. This way the big current surge when switching on a triac middle-phase is avoided because switching on is done at 0 volts.

Go Up