I am making a simple AC chopper for a dimmer circuit for a table lamp. It consists of a simple Triac which is fired using a RC circuit with a variable resistor. I've attached the schematic.
My problem is that instead of using a potentiometer like in the circuit, I now want to control this circuit using a microcontroller to vary the resistance. The problem is that there is 220vAC flowing through the variable resistor and I obviously have a control signal of 5vDC coming from the microcontroller.
I have controlled AC switches before using DC control circuits by using simple relays which have 2 completely isolated coils. What I'm asking is, is there a similar way to control a variable resistor?
I've been researching photocouplers, looking for a solution. But it seems photocouplers behave similar to relays (in that there are only 2 states, either on or off). Any help would be appreciated.
A micro-controller dimmer is nothing like the crude analogue one you've shown - it's all done in software, you detect the zero-crossing point, and trigger the TRIAC a suitable time after that in order to set the dimming level you want.
If you wanted a crude analogue dimmer, then use a servo (or simple geared motor, if only want relative control and not absolute) to turn the pot, and a micro-controller to control the servo/motor.
A micro-controller dimmer is nothing like the crude analogue one you've shown - it's all done in software, you detect the zero-crossing point, and trigger the TRIAC a suitable time after that in order to set the dimming level you want.
If you wanted a crude analogue dimmer, then use a servo (or simple geared motor, if only want relative control and not absolute) to turn the pot, and a micro-controller to control the servo/motor.
I am very new to analog circuitry and triacs, so forgive me for proposing a preposterous analog design
From what I understand, you are proposing that I use a triac which would be fired directly by my microcontroller through the coding. Correct me if I'm wrong there.
A few things that pop into my head if this is the case then.
My microcontroller is powered by the same power source, except it passes through a transformer + rectifier + filter + linear regulator combination to obtain a steady 5v DC voltage. How would I go about using the output 5v of the microcontroller to control a triac? Though I imagine this would be done using an optocoupler, what are your thoughts?
How would I go about detecting the zero crossing point of the input voltage? How would I translate that into an interrupt for my microscontroller?
From what I understand, you are proposing that I use a triac which would be fired directly by my microcontroller through the coding. Correct me if I'm wrong there.
Nope, you're quite correct - that's the way it's done
A few things that pop into my head if this is the case then.
My microcontroller is powered by the same power source, except it passes through a transformer + rectifier + filter + linear regulator combination to obtain a steady 5v DC voltage. How would I go about using the output 5v of the microcontroller to control a triac? Though I imagine this would be done using an optocoupler, what are your thoughts?
How would I go about detecting the zero crossing point of the input voltage? How would I translate that into an interrupt for my microscontroller?
I understand the circuit you gave in the link you posted, but it is connected to the mains grounds though a high resistance. Wouldn't it be better to just isolate the controller side of things completely?
For now this is what I think I'm going for, as this circuit completely isolates the AC Mains via 2 opto couples. However I may also look into opto-triacs with built in zero cross sensors like Mikebits said as they seem to be much easier to work with.
Thanks for everything guys !