I have been looking for a simple ac dimmer circuit to use with my arduino and/or raspberry pi. I have used the TLC 5940 PWM Driver before just to control LEDs and I wanted to adapt this to controlling strings of xmas lights. Since I am just beginning with electronics, I don't wanna blow my face off by doing it wrong. Do you have any suggestions for anything that is not only compact but cost effective???
Electronic – arduino – multi channel ac dimmer for arduino
acarduinodimmerpwmraspberry pi
Best Answer
I've done this before, except I was controlling theater lights at 20A per channel. Here's how I did it:
simulate this circuit – Schematic created using CircuitLab
The theory of operation is:
You can do this in parallel for as many channels as you have hardware and processing time for. I always bit-banged it with interrupts while the main loop handled communications.
The PWM must be synchronized with the AC power line because the triac latches on until the current stops (which it must do every zero crossing, so we're okay there). You technically don't have to hold it on, but it makes the logic easier and removes the requirement for a minimum load.
The latching behavior may also cause a problem for false triggers. If the load is too reactive, including L1, then the triac dropping out may cause enough inductive kick to retrigger it, so it effectively sticks at 100% on.