Dimmer Circuit w/ uC

Thread Starter

Dalaran

Joined Dec 3, 2009
168
This is still in the planning stage, but I am looking to dim a set of 4x ~40W light bulbs (110V AC) using a uC. I only need 4 or 5 different settings from off to full.

What is the best way to go about this? I'm assuming a horrible idea but one could use 4/5 separate relays with a different resistor to trim the power getting there. But I figure there is a easier/cheaper way?

Cheers.
 

retched

Joined Dec 5, 2009
5,207
the dimming can be accomplished by the uC. You can set the duty cycle for, say, 20% 40% 60% 80% and 100% if you wanted 5 dimmer settings. That would be the easiest part. I dont know if a solid state relay would be fast enough to handle pulse wave modulations that fast on the AC side. Did you have a uC in mind?
 

retched

Joined Dec 5, 2009
5,207
also, could you be happy with high-power leds in place of the lamps? You could then forgo the need for a relay. You could do it all pretty easily.
 

Thread Starter

Dalaran

Joined Dec 3, 2009
168
It is to re-furbish an old electric fireplace (no PCBs). All of the parts heater/fan/lights etc run off AC so I would like to keep it this way. The PWM output is a great idea. I guess instead of a relay I could use a high power MOSFET for something and drive the gate with the PWM? I suppose the frequency of the PWM wouldn't matter much as long as it is above the eye detection level? Maybe if I keep the frequency low I will be able to use the relays I already have...?

Thanks for the advice.

Oh and I will most likely be using a PIC16F886 (or maybe smaller but comparable chip)

Cheers.
 

SgtWookie

Joined Jul 17, 2007
22,230
You don't use PWM with a TRIAC.

Once a TRIAC gets turned on, it stays on until the current through it falls to zero.

So basically, to control a TRIAC, you look at the zero crossing, and then delay the turn-on time in proportion to how much or how little power you want flowing through it.

Dimmers use a TRIAC or SCR with a cap and variable resistor. The RC time is varied by the resistor. The larger the resistance, the longer the delay in the cycle is before the TRIAC/SCR turns on.

A relay is not the thing to use for PWM; it would not be nearly fast enough, too noisy, and the contacts would wear out in a matter of hours or days.
 

Thread Starter

Dalaran

Joined Dec 3, 2009
168
Interesting. Thanks very much for your insight.

I will do my reading on TRIAC/SCR.

Is there a method to control dimming of AC lights via PWM?

Thanks.
 

SgtWookie

Joined Jul 17, 2007
22,230
Actually, controlling the delay between the zero crossing and the SCR/TRIAC trigger IS a form of PWM, if you think about it.

With the TRIAC, you're delaying the time when it's triggered. The longer the delay (up to 1/2 of the AC cycle) the less current flows through it.

The frequency is fixed by the incoming AC frequency. Where you live, that might be 50Hz, 60Hz, or if you're working on an aircraft, it could be 400Hz. The zero crossings will occur at twice the incoming frequency; so 100Hz, 120Hz, and 800Hz.

You'll need to detect the zero crossings (at which point you know that the TRIAC will turn off if it isn't triggered), then delay for the desired amount of time before triggering the TRIAC.

Oh, TRIACs are basically back-to-back SCRs. The generic name for that class of semiconductor is "thyristor"
 

Thread Starter

Dalaran

Joined Dec 3, 2009
168
hehe Thanks again. So it seems the only solution to my problem is the TRIACs.

Looks like I should get to reading/sourcing components!

Thanks.
 

retched

Joined Dec 5, 2009
5,207
There may be another way. Sarge, let me know if this is way off. I know of digitally controlled variable resistors, can they be used as rheostats? Could you use the uC to control the dimming that way? I have only seen this type of technology used for trim pots, but I do not know all.

check this out:
http://www.intersil.com/dcps-dccs/
 

SgtWookie

Joined Jul 17, 2007
22,230
Controlling incandescent lamps using rheostats would be terribly inefficient. The power dissipation in the rheostat would be very large.
 
Top