1
\$\begingroup\$

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.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ I doubt that a triac dimmer would work without line voltage. If you just need a knob, could you just use a potentiometer? \$\endgroup\$
    – Daniel
    Feb 13, 2017 at 3:13
  • \$\begingroup\$ I'm trying to put an esp8266 in a gang box as a cheap home automation controller. If I can use the existing switch and not have to use mains at all, that would be ideal. \$\endgroup\$
    – Robear
    Feb 13, 2017 at 3:31
  • \$\begingroup\$ There should be off the shelf X-10 solutions for this, have been available for decades. Easy to control directly and remotely with an mcu or computer or whatever. \$\endgroup\$
    – old_timer
    Feb 13, 2017 at 4:18
  • \$\begingroup\$ What if I hooked the AC line to an ACS712 -> Resistor -> Neutral? I presume I'd only need a small amount of current running to fire the triac in the dimmer to run. I could just dissipate it as heat. \$\endgroup\$
    – Robear
    Feb 13, 2017 at 19:47
  • \$\begingroup\$ Some dimmers only have two-terminal variable resistors, and might have an odd taper (resistance vs. angle). Lacking full specifications, it's not certain to be a suitable input device. Never connect to mains power (stick to current-limited low voltage power sources), for safety. \$\endgroup\$
    – Whit3rd
    Feb 13, 2017 at 23:58

2 Answers 2

1
+50
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ This is exactly what I was looking for. This is very similar to this solution, which was my point-of-reference, but I was just unsure about the correct optocoupler and how to safely load it with a resistor. I'll probably use triacs and multiple resistors to vary the load. I'm using this to determine thermal dissipation, but do you have any recommendations for max load wattage? Some triacs need 50mA to fire, and that's an 11 watt load @ 220v. \$\endgroup\$
    – Robear
    Feb 19, 2017 at 22:24
  • 1
    \$\begingroup\$ The LTV814 looks absolutely ideal for the job. Thanks for posting the link. Even if the holding current is above 10mA, the length of the drive pulse to the Triac should mean you get at least a pulse from the optocoupler. If you create a zero crossing reference for at least one phase in your house then you could work out the position of the control even though the Triac is below holding current and the device potentially on other phases. If your AC supply is Bi-Phase as in the US then a single zero crossing reference works for all points of course. \$\endgroup\$ Feb 19, 2017 at 23:14
  • \$\begingroup\$ Excellent point - I hadn't even considered polyphase AC. That's okay, though - this definitely solves my biggest problems. I'm sure there are zero crossing detector circuits out there for polyphase AC systems I can find. This gets me going for now. Thanks again! \$\endgroup\$
    – Robear
    Feb 20, 2017 at 6:01
  • \$\begingroup\$ If you do set the load current below the holding current of the Triac then you might benefit from using a more advanced optocoupler such as the 6N137. It has a higher speed capability and may give a more acceptable pulse to your MCU. \$\endgroup\$ Feb 20, 2017 at 21:03
1
\$\begingroup\$

You could remove the circuitry and wire directly to the pot in the dimmer but typically the pot in a mains dimmer is too high value to work directly with an Arduino ADC input- you would normally want something around 10K and the dimmer pot is usually much higher value.

It's possible to use a rail-to-rail op-amp such as a MCP6002 to buffer the pot wiper voltage, but I think it would be easier to just buy a pot and knob.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.