230v ac dimming thoughts

hello all,

i wanty to be able to dim some ac bulbs wit a triac and triac optocoupler but have some questions regarding the setup

if i use the pwm library, is it possible to sync the pulses with the 50Hz mains so i can use zero voltage crossing. I was thinking about using a analog input and a transformer to sense the zero crossing, it being shifted 90 degries so i have time to trigger the exact moment.

maybe i should not use the pwm library and do it completely in c, so i'm not restricted to the 3 or 6 pwm outputs.

any thoughts on this?

is it possible to sync the pulses with the 50Hz mains

No, the PWM signal is trigger off the processor’s clock and while you could do it, it’s messy and offers you no advantage over using the conventional system. You are best using the PWM signals and then smooth them into a DC signal and then using that to control the capacitor charge rate that determines the phase angle firing. You can even get solid state relay units that have a control 5 volt input that determines the phase firing angle but they are expensive. Have a look at the Farnell web site.

i'm very curous about your "conventional system" are there schematics on the web and how would i name it in google?

maybe polling a analog input for zero crossing is not a bad idea after all...

The conventional system consists of a variable resistor charging a capacitor across live and neutral. The R C junction is fed to a DIAC which is sort of like a solid state discharge tube which looks like a short once a certain threshold is reached. (about 20V). This is fed into the gate of the TRIAC. This causes the TRIAC to fire at a time after the zero crossing determined by the RC time constant. As this is made shorter the TRIAC is triggered earlier in the mains cycle. At the next zero point in the cycle the TRIAC turns off.

To make this controllable from an other circuit then replace the variable resistor with an opto isolator and then the charging of the capacitor will be determined by the voltage fed into the opto's LED. You will need two optos one for each polarity of the cycle. These can be put in parallel (anti parallel actually) if a diode prevents breakdown on the reverse cycle.

If you want to do it in software then the best bet would be to generate an interrupt on each mains cycle (again an opto isolator is essential) and in the interrupt service routine set a timer to time out when the required phase angle time has expired. Then use the interrupt from this timer to trigger the TRIAC. You might run out of timers if you want to control more than a few.

I have used both techniques in the past. The problems start when the loads are big (5A or so) as things start to interfer with each other and you have to start putting inductors in line with the load to reduce the rate of initial current inrush.

For further information look at the data sheets for specific TRIACs or Google the words:- AC power control phase angle.