I'm trying to get the Arduino to control low-voltage AC loads (18v in a toy train system). My thought is to use a triac, detect the zero crossing of the AC supply, and pulse the triac for phase control.
I've got the zero crossing detect working, but I'm very confused about how to set up the triac, since nearly all examples I find involve optocouplers and mains voltages. I know that the commercially available toy train products drive triacs directly from microcontrollers. Some of them use this this triac, which I'm using for my experiments.
Figure 3 of this application note seems to suggest that the microcontroller Vcc should be connected to the AC line, and no connection to microcontroller ground. Does it also indicate that a LOW pulse to the gate turns on the triac?? It also doesn't say anything about where the load is placed relative to the triac - elsewhere I have read that it matters. I have a feeling the application note is presuming more knowledge than I have.
If it matters, the Arduino will in the final application be powered from a supply drawing from the AC line (bridge rectifier + 7805 or switching module).
If anyone can tell me exactly how the triac, AC supply, and load should be connected, I'd be very obliged!
Figure 3 of this application note seems to suggest that the microcontroller Vcc should be connected to the AC line, and no connection to microcontroller ground
Yes and figure 1 shows the ground connected to the AC line. It matters not, it is just that you have to connect one of them to the Arduino so you can get a current path through the triac.
As long as it AC line is isolated from the DC supply it will be fine. I am assuming it is coming from a transformer or something similar.
Grumpy_Mike:
Yes and figure 1 shows the ground connected to the AC line. It matters not, it is just that you have to connect one of them to the Arduino so you can get a current path through the triac.
As long as it AC line is isolated from the DC supply it will be fine. I am assuming it is coming from a transformer or something similar.
Not sure what isolation means in this context... as mentioned in post #1, the DC supply would be derived from the AC line. E.g., either full or half-wave rectified plus a 7805. For half-wave the DC ground would be one of the legs of the AC line.
I'm sorry, every reply seems to be confusing me more. The AC line doesn't have to be connected to anything?? But the whole question is how to connect the triac and the microcontroller to the 18V AC line!
There are no mains involved anywhere. Everything AC is the 18V AC supply - yes, derived from a transformer. Perhaps I am not making myself clear enough, but I don't know what other information to provide.
I'm just lost on the question of where the microcontroller power supply, the 18V AC line, the triac, and the load all connect. And whether positive or negative current into the gate is preferable, and how that choice constrains the other elements of the design.
Figure 3 in the AN, together with the comment at figure 2, tells the story, imho. For details you may refer to Wikipedia.
You're switching in 2nd and 3rd quadrant; that means to switch you have to pull the gate negative in respect to MT1. And that's exactly what you do here: the +5 Vcc is directly connected to MT1, then either +5 to gate (no switching) or 0V to gate (switching on - gate potential is now at -5V compared to to MT1).
I think the schematic in Figure 3 is pretty clear on how everything connects... The load goes somewhere in what's marked as "line", as it's AC of course it doesn't matter at all on which side it goes. There's no such thing as "high side" or "low side" like you have in DC circuits.
The only thing you may want to reconsider is the TRIAC itself, as the model you mentioned can do only 1A continuous.
Vdd from microcontroller connected to A1 is positive ground, the microcontroller 0V is really -Vdd, so you need a negative regulator, use 7905 instead of 7805. Now all ground in your circuit are connected to this -Vdd.
A2 from Triac is connected to load. AC mains is connected to A1 and load (the other line).
Take care about connections!: all lines connected to mains are subject to danger. Do not touch directly your circuit when energized!
If success please post results!.
Contrary to some of the information appearing in this thread, some triacs can indeed be triggered with a positive gate current only (Quadrants I and IV).
I wound up copying the arrangement shown in figure 3 of this patent and it seems to be working ok.
Indeed there are tiacs that can be triggered by a positive current for all quadrants. You just have to find one that has a holding current that is below your load current. Perhaps a ST Z04 Triac.
I think once you find such a Triac the triggering is trivial. Could be as easy as a small Mosfet driven from the arduino controlling the base (or gate if Mosfet) of a PNP from 12 V.
Also you might consider:
IL410, IL4108
Not sure if the current capability is enough for you but it would make things simple.
To be honest I found triggering the BT131-600 quite trivial. All it needed was an AC opto (such as the MOC3041) and a resistor. Peak detection was also optoisolated as this was a 230V AC circuit.