Help with a low-voltage AC dimmer - Page 1
Forum section: electronics / beginners

author: ledtester
author_rank: Super Contributor
timestamp: July 04, 2020, 02:48:38 am
content: I'm trying to build a low voltage phase-controlled AC dimmer with a microcontroller.I'm using the RobotDyn AC light dimmer module:https://robotdyn.com/ac-light-dimmer-module-1-channel-3-3v-5v-logic-ac-50-60hz-220v-110v.htmlIt's meant to be used for 220V AC, but I'm just using it with a 14 VAC transformer. To get a zero-cross signal I've put a 39K resistor in parallel with R1 and R3 as shown in the attached schematic.The basic operation of the microcontroller is to wait for a zero-cross signal and after a predetermined delay emit a 40 us pulse on the DIMMER line.The following two scope captures were made with a 14 VAC as the power supply and a 10K resistor as the load. The channels are:YELLOW: the zero-cross signalBLUE: the pulse on the DIMMER linePURPLE: the voltage across the 10K resistorIn the first capture the delay is 3424 microseconds and the behavior is as expected.In the second capture the delay is 2632 microseconds and I'm getting a spurious zero-cross event when the DIMMER line pulse is sent (every BLUE line has a YELLOW line under it).I'm ignoring zero-cross events which happen too early, so those spurious zero-cross events are not affecting my program, but I'm wondering why I am getting them.I've found there are ranges of delays which give rise to these extra zero-cross events (see the "sweep data" attachment). Basically delays between 2320 and 2720 microseconds and 8120 and 8400 microseconds will show this behavior. Interestingly, when the delay is between 8120 and 8200 us, only every other DIMMER pulse generates the spurious zero-cross events and I can see that on the scope.FWIW, I've determined that the zero-cross signal is about 1200 microseconds before the actual zero crossing.Any ideas? Thanks!

author: ledtester
author_rank: Super Contributor
timestamp: July 04, 2020, 04:22:55 am
content: Btw - the 14 VAC transformer is a small one... only 20 VA.

author: Zero999
author_rank: Super Contributor
timestamp: July 04, 2020, 01:14:27 pm
content: Reducing the current limiting resistor to 10k and replacing the opto-isolator with one with an AC input, with back-to-back LEDs and removing the bridge rectifier will help.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 04, 2020, 03:29:19 pm
content: I found the schematics here:https://robotdyn.com/pub/media/0G-00005677==Mod-Dimmer-5A-1L/DOCS/Schematic==0G-00005677==Mod-Dimmer-5A-1L.pdfFirst:I find the parallel combination of R1 and R3 weird. Standard resistors are usually only rated for 100V to 200V or so, and not for the 310V peak for normal 230Vac.Apart from that, I like that you use your common sense and test this with a low voltage transformer.40kOhm seems much to much. I would design the opto coupler LED current to around 5mA, so for 14Vac, a ballpark figure would be:14/.005 = 2800Then you can also use pullup resistors with a lower value, which help with filtering out spurious pulses from capacitive coupling.Opto couplers have a thing called "current transfer ratio", and this is usually a somewhere around 0.5 to 2, but not very precise. If you want to know more about this, then put your triac aside for a moment and just experiment with an opto coupler and a few resistors or potentiometers on a breadboard.Also connect it to some pulse generator to learn how these resistors (and therefore currents) interact with the switching speed of the optocoupler.Also:Do you still see the spurious spikes on the Yellow line if you completely disconnect the Purple probe from your circuit? It may well be a result from capacitive coupling through the scope probes.With 230Vac input and an always connected LED in the optocoupler this is rlatively wastefull.As a completely different way of doing this is to make a capacitive pickup.This is quite easy and safe to do. You can take a piece of mains wiring (the flat type is ideal) and then tag some extra wires on the outside (for a length of around 5cm), and fixate them with some tape, (or shrinkt tube later).Then lead these extra wires to your breadboard, and build a capacitive voltage divider. and add an comparator (opamp) to check which of these 2 wires has the highest voltage.Because you leave the normal 230Vac cable completely intact and only add something to the oudside, it is quite safe to experiment with it all you like. It is very similar to holding the 230Vac cable in your hand.Do note that you have to add resistors, because the inputs of all opamps need a DC path for the bias currents.

author: ledtester
author_rank: Super Contributor
timestamp: July 06, 2020, 06:17:55 am
content: Thanks - increasing the current through the 4N25 solved the spurious triggering problem. Specifically with a 3.3K resistor in parallel with R1 and R3 made the extra zero-cross events go away.I will be experimenting with different zero-crossing detection methods as well as relating any other oddities I find with this project - so watch this space.