The past few days i try to figure out how a triac works in order to control a small ac fan with an arduino uno. I do have a MAC97A6 triac and ofcource my uno board.
Could anyone plase help me figure out how the triac works and how to control it with the uno ? The videos iv'e watched didn't really help.
I assume you know what AC voltage is? It's positive half of the time and negative half of the time and there are two zero-crossings per cycle (50 or 60 cycles per second, depending on where you live).
After being triggered (turned-on) a TRIAC latches-on until current drops to zero (i.e. at the next zero crossing).
So dimming (or speed control) works by detecting the zero crossing, then after some delay triggering the TRIAC with a quick-short pulse. The TRIAC stays on for the remainder of the half-cycle and since power is only on for part of each cycle you get dimming, or slowing of a motor.
Note that with power line voltages, both the TRIAC and the zero-crossing circuit must be electrically isolated from the lethal voltages! Normally this is done with opto-isolators (and there are special opto-isolators for TRIACs).
The triac is switching the mains voltage. It cannot be reasonably isolated from it.
Isolating the driving circuit may improve safety if done properly. Otherwise it only gives false sense of safety.
I am afraid it is quite common here to have optocoupler isolation of signals and connected grounds.
You cannot isolate the triac from mains voltage but you can isolate Arduino from the triac. The latter is what DVDdoug probably had on mind but did not formulate clear enough (for me to understand).
i know what single phase ac is also we use 230V mains.
So for the zero crossing detection i will probably use a bridge rectifier and an optocoupler. Now for the triac do i also have to use optocoupler to drive the triac ?
That part is a little confusing to me.
This article is very useful.
My problem now is that i can not source the MOC3021. I do have a few other optocouplers though. Maybe some other will also do.
I cant help wonder how this triac is triggered directly from the mcu. what would be the connection diagram ? I am not sure i understand the connection explained here. Could you please explain it to me ?
The optocoupler is not needed because the transformer already provides isolation. A comparator (most microcontrollers has at least one) would give better results.
The isolation is lost by connecting GND to the mains neutral (it may become hot not only due to a wiring error but also its failure).
The triac is drawn with main main terminals swapped.
Agreed, the isolation is lost since one pole is connected to the circuits ground. That pole may very well be either Line or Neutral.
To be honest i think that it is safe because the circuit will be sealed into a plastic box. no way someone can touch a live wire.
In case of failure the circuit will blow. thats for sure.
I dont really like that design much but ive hit a wall with sourcing
the parts...
For design connected to mains power I would use a switching power supply to get 5V directly instead of the 12V + regulator. Simple ZC detection is shown in the included application note.
The circuit will generate a lot of heat. This may considerably affect temperature measurements - being fully enclosed makes it even worse. AVR182 Zero Cross Detector.pdf (229.7 KB)
IMO the isolation makes the circuit more complicated, less efficient and only marginally safer. Unless you want to add some user input.