120vac PWM

Thread Starter

edramos

Joined Jul 8, 2013
3
I need to control the pwm going into a 120vac source, ideally used for an incandescent light bulb. I need to pwm the light bulb using a microcontroller. Im trying to figure out whats the safest and most efficient way of doing this. I know that the use of a relay is out of the picture. So I need some Ideas. I heard some terms like, SCR, Triac, Thyristor? Please any input is valued, Thanks.
 

strantor

Joined Oct 3, 2010
6,798
Use a dimmer from home depot. You could apply PWM to a solid state relay (triac) controlling a light but PWM is usually used for DC rather than AC. You would need to make your frequency so low that you might experience fluctuations in light; if you went too high with the frequency then your light would remain effectively always on and would not be dimmed.

The dimmer from home depot has the circuitry to fire the triac at the proper times to achieve the dimming without noticeable oscillations and comes already assembled, for a reasonable price, guaranteed to work the first time.
 

richard.cs

Joined Mar 3, 2012
162
You can PWM with a pair of MOSFETs joined source-source, or with a single MOSFET or high-voltage bipolar inside a diode bridge. Or for a resistive load you can full wave rectify *without smoothing* and get pulsy d.c. that you can PWM with a single MOSFET or bipolar in the conventional manner (this is the same as option 2 except that the load is inside the bridge and therefore sees d.c.)

In all of these the PWM frequency will have much higher than the line frequency - the load will see PWM at 20 kHz say with a 50 or 60 Hz envolope around it.

Or you can use phase-angle control like a conventional lamp dimmer, this is effectively PWM at the line frequency.
 

Thread Starter

edramos

Joined Jul 8, 2013
3
Use a dimmer from home depot. You could apply PWM to a solid state relay (triac) controlling a light but PWM is usually used for DC rather than AC. You would need to make your frequency so low that you might experience fluctuations in light; if you went too high with the frequency then your light would remain effectively always on and would not be dimmed.

The dimmer from home depot has the circuitry to fire the triac at the proper times to achieve the dimming without noticeable oscillations and comes already assembled, for a reasonable price, guaranteed to work the first time.

I have to use the microcontroller to control the dimming. I think I am going to have to convert the 120vac to dc then control it without the pwm, using an ADC converter in the program. I need help in doing this.
 

strantor

Joined Oct 3, 2010
6,798
Ah, sorry, I missed the microcontroller stipulation. Why do you feel you need to ditch the pwm idea? It's super simple, like Richard.cs described, just rectify and PWM the dc with a mosfet. Should be no problem.Make sure to use an isolation transformer though.
 

richard.cs

Joined Mar 3, 2012
162
I think I am going to have to convert the 120vac to dc then control it without the pwm, using an ADC converter in the program. I need help in doing this.
The methods I suggested will work with a micro, what microcontroller do you have in mind? Many of them have built-in timers and pwm modules. You can also do phase-angle control with a micro but PWM is better (more accuracy, linear load on the mains if filtered).

You haven't specified how fine the control needs to be, or the size of your load (20 W lightbulb or 500?). If you used a PIC for example you get 10 bits resolution on the built-in PWM but some micros will only give you 8 bits. Almost certainly at the top end that's enough but it's possible to see surprisingly small steps with tungsten lighting, especially when part-dimmed. I used to have Christmas lights that did 4-bit dimming and they were really irritating on the slow setting.

Finally strantor raises an important point - the source and gate of your mosfet will bounce between 0 and 170V from mains earth, and so will your microcontroller if you connect it directly. To make this safe you have 3 options:

1) Use an isolation transformer. This is also important when testing if using 2 or 3.
2) Accept that the micro and all attached circuitry is live and insulate appropriately - this really depends on what it's connected to and you really have to know what you're doing.
3) Isolate the microcontroller from the MOSFET with an optoisolator (common on homebrew but needs a low voltage power supply on the mains side as well as an isolated one for the micro), or with a transformer (more common on commercial equipment but still fairly simple to do if your PWM frequency isn't too low).
 

Thread Starter

edramos

Joined Jul 8, 2013
3
The methods I suggested will work with a micro, what microcontroller do you have in mind? Many of them have built-in timers and pwm modules. You can also do phase-angle control with a micro but PWM is better (more accuracy, linear load on the mains if filtered).

You haven't specified how fine the control needs to be, or the size of your load (20 W lightbulb or 500?). If you used a PIC for example you get 10 bits resolution on the built-in PWM but some micros will only give you 8 bits. Almost certainly at the top end that's enough but it's possible to see surprisingly small steps with tungsten lighting, especially when part-dimmed. I used to have Christmas lights that did 4-bit dimming and they were really irritating on the slow setting.

Finally strantor raises an important point - the source and gate of your mosfet will bounce between 0 and 170V from mains earth, and so will your microcontroller if you connect it directly. To make this safe you have 3 options:

1) Use an isolation transformer. This is also important when testing if using 2 or 3.
2) Accept that the micro and all attached circuitry is live and insulate appropriately - this really depends on what it's connected to and you really have to know what you're doing.
3) Isolate the microcontroller from the MOSFET with an optoisolator (common on homebrew but needs a low voltage power supply on the mains side as well as an isolated one for the micro), or with a transformer (more common on commercial equipment but still fairly simple to do if your PWM frequency isn't too low).
I am going to use a 60W incandescent light bulb controlled by the launchpad msp430
 
Top