Electronic – arduino – How to use an arduino to detect the state of a dimmer switch

adcarduinodachome-automation

I have an AC Dimmer Switch you'd normally put in a gang box and use to dim lights in your house. If I wanted to hook up this switch to an Arduino (and JUST an Arduino, NOT mains voltage), how would I check the state of the switch?

My understanding is that a dimmer switch trims the AC waveform at the leading or trailing edge using Zero Cross Detection. So would it be possible for me to use a DAC to generate a 60Hz waveform and trick the switch into trimming it @ 5V instead of mains? Is there an easy way to do this? How do LED light fixtures do it?

Thanks.

Best Answer

Most two wire dimmers are very simple circuits like this:

enter image description here

And since you seem willing to use an ACS712 (which is not sensitive enough to provide indications without significant load), I'd suggest the following could work:

enter image description here

Here the load (lights) are replaced with a resistor (which disipates less than the Triac would powering any lights) that allows just enough current to flow to keep the Triac on (about 10 mA) when triggered so the signal to the arduino is low whenever the light would have been on.
From this you can calculate the relative position of the control knob based on the pulse width coming from the current detector (the opto's).

You could potentially just use one 4N35 and a diode (to replace the other) since the dimmer should be about the same signal on both positive and negative half cycles.