Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - DIMMER LIGHT CONTROL

(you are viewing a thread; or go back to list of threads)

DIMMER LIGHT CONTROL (by ROGERIO FRANCISCO)
Is it possible to control a brightness of a lamp using ldmicro?
Thu Nov 17 2011, 09:21:11
(no subject) (by Jonathan Westhues)
There's a number of different ways you could do that. If it's a DC-powered lamp, then you could use the PWM output with a FET switch, similar to

http://cq.cx/interface.pl#14

You could choose a PWM frequency of a few hundred hertz; slower might cause visible flicker, and faster increases switching losses in that FET. The duty cycle determines the brightness of the lamp.

If the lamp is powered off the 60 Hz (or 50 Hz) AC mains, then that doesn't work. There, it would be typical to do phase control dimming. This means that you turn a switch on for some fraction of the 60 Hz cycle, synchronously with the 60 Hz cycle.

To do that, you need to measure the phase of the line voltage, typically with some kind of comparator feeding a digital input. That comparator can be as simple as a resistor into the I/O pin, as described, for example at

http://ww1.microchip.com/downloads/en/AppNotes/00521c.pdf

The microcontroller then triggers a switch using a digital output, at some constant time after the zero-crossing indicated by that comparator. An example circuit is in

http://ww1.microchip.com/downloads/en/AppNotes/00958A.pdf

(This application note switches entire 60 Hz cycles, not partial 60 Hz cycles as described above. But the concept is very similar.)

In LDmicro, you could implement this phase control in software, though you'd need a cycle time that's fast compared to the 1/(60 Hz) ~ 17 ms, e.g. around 100 us.

But I wouldn't advise this unless you're experienced in the design of electronics to run off line voltage, since there's a risk of lethal shock or fire if you make a mistake. You might instead buy an 0-to-10 V input dimmer, like

http://www.alibaba.com/showroom/0--10v-dimmer.html

These accept a control voltage between 0 V (off) and 10 V (completely on), and dim some kind of load in response to that. You can generate the control voltage from the PWM port, by low-pass filtering it and then amplifying it using an opamp, e.g. by a factor of two if the micro is running with Vdd = 5 V.
Sat Nov 19 2011, 15:31:43
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):