Triac controlling AC fan

Hello everyone.

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.

Thank you !!!

TRIAC Dimmer Theory

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).

1 Like

Do you plan to use this on mains voltage (i.e. 120 VAC)?

To trigger this device you must generate a gate voltage of about 1.5 voltage through a resistor to limit the current to about 20ma or so.

This would be into the G pin with respect to the T1 pin. i.e. T1 would be common of the signal and G the positive or your signal.

image

Hi,
Can I suggest you Google;

arduino ac fan speed control

This may be of help.

You will need to sychronise your gate signal with the incoming AC mains to get the correct phase control.

Tom.. :grinning: :+1: :coffee: :australia:

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.

Hi,

Opto-coupled triac drivers.

https://www.onsemi.com/products/interfaces/triac-driver-optocouplers/moc3163m
Tom... :grinning: :+1: :coffee: :australia:

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 suppose that is what he ment

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.

Hi,

Have you Googled;

arduino ac fan controller

Did you look at the link on post#7?

Tom... :grinning: :+1: :coffee: :australia:


Not yet. I only took time to draw a diagram. This is how i imagine the zero crossing detection circuit.

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 ?

I wonder if this circuit is correct. Notice the neutral of the AC connected to the mcu ground...

Hi,
How are you going to control the fan speed?
If you are going to fit a pot, you need triac drive optocoupler as well.

Personally you can never guarantee that neutral will be neutral, fit an opto anyway.
Plenty of examples around.

What controller are you going to use? UNO with pin numbers 63???

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

What else could be wrong on this schematic?

  1. The optocoupler is not needed because the transformer already provides isolation. A comparator (most microcontrollers has at least one) would give better results.
  2. 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).
  3. The triac is drawn with main main terminals swapped.
  4. No decoupling cap for the mysterious MCU?

I plan to adjust the speed based on the temperature reading of DHT11 sensor.

Yes. My only problem is that its not available in my area. not even online.

It is an UNO. I just used a different MCU in the drawig since the cad software doesnt have the uno.

Hmm how could i use a comparator ?

Oh.. I thought it works both ways...

Tha was just in the drawing. the actuall board will have decoupling.
Why

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.