Microprocessor controlled light dimmer?

  • Thread starter Thread starter dencker
  • Start date Start date
  • Tags Tags
    Light
AI Thread Summary
The discussion revolves around creating a programmable, remote-controlled light dimmer using an AVR Mega16 microcontroller. The original poster considers replacing a potentiometer in their existing dimmer with a MOSFET controlled by the microcontroller. However, responses clarify that controlling AC lighting requires a different approach, typically involving a thyristor (triac) to manage the firing angle for dimming rather than a simple MOSFET. Additionally, using PWM for dimming is suggested, but it must be carefully implemented to ensure safety and functionality with AC voltage. The conversation emphasizes the complexity of integrating these components for effective light control.
dencker
Messages
5
Reaction score
0
Hi folks :smile:

At the moment I'm rebuilding my room, and now I want to make a programmable, remote controlled light dimmer. The remote isn't my problem.
I already have a dimmer with a built-in potentiometer. My AVR Mega16 processors output is digital - either 0V or 5V.
I thought of using a DAC (Digital-Analog Converter), which I will then connect to a MOSFET (i.e. TIP120). Could I just directly replace the potentiometer with a MOSFET which I then control from my micro processor?
Or isn't it that simple? :biggrin:

Thanks in advance,
Dencker.
 
Engineering news on Phys.org
dencker said:
Hi folks :smile:

At the moment I'm rebuilding my room, and now I want to make a programmable, remote controlled light dimmer. The remote isn't my problem.
I already have a dimmer with a built-in potentiometer. My AVR Mega16 processors output is digital - either 0V or 5V.
I thought of using a DAC (Digital-Analog Converter), which I will then connect to a MOSFET (i.e. TIP120). Could I just directly replace the potentiometer with a MOSFET which I then control from my micro processor?
Or isn't it that simple? :biggrin:

Thanks in advance,
Dencker.

I'm kinda not clear on what you have and what you don't have. Assuming you want to control it using RF, I would buy an RF rx and tx module on ebay and interface the RX module to your AVR. The RF modules are easy to interface with. When you press "on" on the TX module, the RX module output goes high. Then program your AVR watch for the "high" signal from the RX module and send out the appropriate PWM signal to your mosfet which switches your light.

It will be relativity complicated if you use DAC to control the brightness of your light instead of PWM.
 
The remote controlling should be no problem receiving, I already programmed this and made the processor understand certain commands from the remote I want to use :smile:

I'm quite new to this subject, so excuse me for any dumb questions :-) But how would a MOSFET "understand" a PWM signal? Wouldn't it just turn on and off?
 
http://screencast.com/t/llDqlQEJl

The mosfet you see on the sketch above is what I intend to replace the potentiometer from the dimmer with, like these:
http://www.elari.com/inside/images/dimmer-ryhma2(net).jpg

Where, instead of the button, is a mosfet. Kinda hard to explain, but I kinda want the mosfet to act like a resistor instead of the 'turning-knob', which I will then control from my AVR Proc.
 
Also, nevermind about the GND symbols.
 
Is this AC lighting we are talking about? If it is you can't treat it like you would with a DC LED. A reverse bais mosfet controlled by a PWM is not something you can use to control the voltage or current of a 120VAC light.
 
There's a potentiometer in your dimmer, but that's usually not what controls the brightness. You usually have a thyristor (triac) whose firing angle is controlled based on the potentiometer setting. It is similar to PWM chopping, but you pass, for instance, 40% of the AC wave form through to achieve 40% light (it's not always one to one like this, but I'll use that to illustrate the point).

There's a nice animation on the Wiki that illustrates what I'm talking about:
http://en.wikipedia.org/wiki/Thyristor

EDIT: And you can use the microprocessor to control the thyristor's firing angle.
 
Last edited:
The potentiometer controls the triac, the triac controls the firing angle.

A Mosfet will conduct equally well in both directions. Still, the FET source will tie to Neutral. Either you have to run the control circuit hot, or isolate it with an opto-isolator, for one. Linearity may be a problem. The Fet channel resistance is exponential in the gate-source voltage. You're uController needs to compensate for this. Because it's so nonlinear your uC needs a 16 bit counter, or two in series, or you could do it in software. You can find a uC with a D to A output, or pulse width modulate, then smooth it with a low pass RC arrangement. The FET gate capacitance may serves to some of this purpose.
 
Oh alright, I get the idea. So how would you suggest that I solve my problem best?
 
  • #10
dencker said:
Oh alright, I get the idea. So how would you suggest that I solve my problem best?

If this is a one-off use a J8 (edit: your favorite microcontroller) and bias it off the line with a resistor and shunt regulator, I guess. What's your total current burden?
 
Last edited:
Back
Top