Arduino Forum

Using Arduino => General Electronics => Topic started by: nemo4all on Apr 11, 2012, 03:59 pm

Title: How to control AC 220V fan speed with arduino's PWM output..??
Post by: nemo4all on Apr 11, 2012, 03:59 pm
I am able to control the brightness of an LED with a pot and the output via PWM pin..

In the similar way how do I control the speed of a AC 220v fan or light ..??

There should me no humming in the fan
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Nishant_Sood on Apr 11, 2012, 04:30 pm
Quote
In the similar way how do I control the speed of a AC 220v fan or light ..??


That cannot happen with AC light dimming you have to slice at the right time depending on the frequency and voltage to lower the voltage so as to dim, PWM;s won;t work with AC lighting.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: nemo4all on Apr 11, 2012, 08:06 pm
yes I know that it is not possible directly..

So what other parts should I use to do That..

Like in this schematic here
(http://www.circuitstoday.com/wp-content/uploads/2008/02/lamp-dimmer.jpg)

How do I control the R1 with arduino...??
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Nishant_Sood on Apr 11, 2012, 08:23 pm
Quote
yes I know that it is not possible directly..


It's not the question of directly or indirectly it's basically because you need to ascertain the Zero Crossing and as per that you have to open the traic for that time only that will give you desired dimming.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Techone on Apr 11, 2012, 08:43 pm
@NI$HANT

You forgot to tell Joy your tread.  ;)

@Joy

Check this tread. http://arduino.cc/forum/index.php/topic,91274.0.html (http://arduino.cc/forum/index.php/topic,91274.0.html)

I did a schematic and a code to control AC using an Arduino. It is just for a 12 V AC for now ( I am working on it for the 120 V AV version )
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Nishant_Sood on Apr 11, 2012, 09:08 pm
Quote
You forgot to tell Joy your tread. 


First wanted him to learn that why we are telling him what we are telling him?, just wanted to make him work his way out of that previous concept of PWM'ing the A/C line's.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: nemo4all on Apr 11, 2012, 09:47 pm
then how do those remote for home lights and fans control the fan speed...??
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Nishant_Sood on Apr 11, 2012, 09:49 pm
Go to the link above provided, also learn of zero crossing , google it and then learn how to slice the voltage by using it.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: nemo4all on Apr 11, 2012, 10:13 pm
Just found this schematic
(http://www.extremeelectronics.co.in/avrprojects/Images/remote_controlled_fan_regulator_schematic.gif)

it is using an opto coupler and a opto triac driver..

But theoretically how is it controlling the fan speed...??
by switching on and of the fan a number of times and varying that time..??
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Techone on Apr 12, 2012, 01:38 am
First, you need to know how a dimmer switch work so you can understand the principle how to control an AC voltage.

Here a link : http://home.howstuffworks.com/dimmer-switch.htm (http://home.howstuffworks.com/dimmer-switch.htm)

And go to NI$HANT tread. My design use this principle. Bear in mind it is only one device being control. To control multitude devices is no so easy for me at this time. It is going to be "tricky". It is the sychronization is going to be "tricky" part to control different AC devices at differents "dim" levels.

Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: mexomagno on May 16, 2014, 07:29 pm
Thanks for the howstuffworks link! This explains it all!
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Nishant_Sood on May 16, 2014, 08:07 pm
Ya but then it helps!
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: mattsven471 on May 21, 2014, 03:36 pm
Microchip´s Application Notes could help you ;)
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: kathait on Jun 08, 2016, 09:32 am
 hi nishant joy n everyone  arduino is kind of new to me   :smiley-confuse:   i know just a little bit about it.  i want to control my.   ac fan.  ohhh i live in India 220 volt 50 hz
i want to control its speed.    >:(    i have  seen  n read all the posts but i havent  understood any of it. plz plz tell me what hardware  and.  what hardware device i have to learn about.    plz   nishant help me.   any adive would be highly appriciated. ✌✌✌✌✌✌
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: MarkT on Jun 08, 2016, 11:00 am
The simple advice is you can't.  Standard induction motors in domestic appliances cannot
safely be speed-controlled (some can be a little, but its not easy to find out by how much). 
Get a DC fan.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: amsaiyed on Aug 09, 2016, 08:27 pm
Hello All,

This thread has been very useful. I am not sure about one thing - for a 110vAC fan control circuit do I need to use the transformer to get 12V-0V-12V or is there a way I can use the AC supply directly into the optocoupler to drive the MCU. I believe I saw a schematic snap shot which shows AC supply connected directly to OC and then OC talking to the MCU.

Thanks.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: sperera on Aug 28, 2016, 04:59 pm
there is a simple way to do this.you want some 3 triacs(for 3 speed fan)and  hack the speed regulator of the fan.and use digital outputs from arduino to switch triacs.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: MrAl on Aug 28, 2016, 09:47 pm
Hello All,

This thread has been very useful. I am not sure about one thing - for a 110vAC fan control circuit do I need to use the transformer to get 12V-0V-12V or is there a way I can use the AC supply directly into the optocoupler to drive the MCU. I believe I saw a schematic snap shot which shows AC supply connected directly to OC and then OC talking to the MCU.

Thanks.
Hi,

I dont know how much you already know about triggering a triac for dimming or speed control so i'll outline it here.

In order to get away without a transformer, you can use half wave rectification to create the DC supply for the circuit.  That way you can 'ground' one side of the AC.
Note that this can be dangerous.  The pot you use for adjustment should have a plastic shaft not metal so it cant conduct to the hands.

The triac works the same in each half cycle of the line voltage, just with opposite polarity.  The circuit senses the zero cross of the line, then waits a predetermined time, then sends a pulse to the triac gate to turn it on.  So the load only sees part of each half cycle rather than the full half cycle for each half cycle and that is what 'dims' the load.
The predetermined time is set by the user by turning the shaft of the pot, and the circuit detects how many degrees the shaft has been turned and changes the predetermined time delay as required.  The delay can be anything from close to zero to a little less than one half cycle time.  If the delay is close to the half cycle time then the triac never turn on, so that would be for max dimming.

Some dimmer switches you buy at the store work with fans.  Maybe all modern dimmers work with fans but i havent tested them all.

Please note that this kind of circuit can be dangerous because part of the circuit is connected directly to one side of the line voltage.  Two prong plugs are often plugged in backwards, and sometimes the outlet is not wired right either so you cant depend on using the neutral lead of the line wire because it might become live for numerous reasons.

Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: nitrof on Aug 29, 2016, 02:28 am
ok, Make something clear. RPM of AC motor are determine by: 120*f/pole.

So a 4 pole motor that are connected to 60Hz power line (america)= 120*60/4 =1800RPM.

So AC drive doesn't use duty cycle to manage speed, the change the frequency.

aside of creating a lot of harmonics, playing with duty cycle on AC motor can be hazardous for power line because, when powering up, an ac motor can pump until 6 time is nominal current. So switch on and of could be bad.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: MrAl on Aug 29, 2016, 12:19 pm
Hi,

Yes but what is strange is i have seen people do this and it does vary the speed and works for quite some time.  Motors with brushes do work better as far as i know like with power tools.

Good AC drives change the voltage AND the frequency.

I use a DC fan for low speed myself.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Jiggy-Ninja on Aug 29, 2016, 09:31 pm
Hi,

Yes but what is strange is i have seen people do this and it does vary the speed and works for quite some time.  Motors with brushes do work better as far as i know like with power tools.

Good AC drives change the voltage AND the frequency.

I use a DC fan for low speed myself.

AC motors do not have brushes. Those are DC motors.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: nitrof on Aug 29, 2016, 11:14 pm
universal AC motor does. and it is more than likely that a fan will be equip with it.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: MrAl on Aug 30, 2016, 03:41 pm
Hello again,

What seemed strange to me is that i have seen non brushed motors being controlled with dimmer switches.  I have never looked into this very closely, but maybe some day i will break out the scope and do some measurements.

What i think might be happening is they might naturally be selecting a fairly high setting as it does not take too low of a setting to get somewhat lower speeds.  That might be why it seems to work.  If they go too far down it may stall, but again i havent tried this myself in years now.

Back many years ago i looked into controlling a transformer with a triac.  The idea was to use a fairly cheap triac to lower the output of a transformer for some rough voltage regulation.  If the output filter is right, it could work.  But then there is the core of the tranformer which can not stand an asymmetrical current waveform, it should be the same area above zero as below zero.  If not, the core could saturate.
All i remember though from those many years ago was that it did in fact work to some degree.  I was able to lower the output voltage without blowing anything up.
What i dont remember is how well it worked, like did the transformer get hot.  I do remember that i did not test it for that long of a time period, so i do not know if it would have gotten hot or not.
I also took a brief look into inductors with triacs, and it seems that once a certain point is reached the current keeps the triac turned on when it shouldnt be.  But gain that was long ago so i'd have to start all over again with this.
If i get some time i'll do that again.
If anyone else has some experience with this perhaps they can add some comments.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Jiggy-Ninja on Aug 30, 2016, 08:35 pm
universal AC motor does. and it is more than likely that a fan will be equip with it.
I stand corrected: Wiki[edia: Universal Motor (https://en.wikipedia.org/wiki/Universal_motor)

The page contains the following (emphasis mine):
Quote
Speed control[edit]
Continuous speed control of a universal motor running on AC is easily obtained by use of a thyristor circuit, while multiple taps on the field coil provide (imprecise) stepped speed control. Household blenders that advertise many speeds frequently combine a field coil with several taps and a diode that can be inserted in series with the motor (causing the motor to run on half-wave rectified AC).
So if it is a universal motor and not an induction motor, it looks like a standard light dimmer circuit will work.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Trexo on Aug 30, 2016, 10:52 pm
It could be pretty messy if you try to directly interface the Arduino with 110 Volt (or worse 220V) power. There are all kinds of electrical hazards that can be created, and you definitely risk the destruction of your microcontroller.

If I were doing this, I would get a TRIAC fan controller (most hardware stores) which has a circuit similar to one shown in post #2. Then replace the speed control pot (has the knob on it) with a photoconductive cell (Mouser or Digikey) optically tied to an LED (put them in a little tube - one on each end). Apply your PWM signal to this LED to control its brightness and in turn that controls the resistance of the photoconductive cell and the fan speed. There is no direct electrical connection to the 110 or 220 Volts (make sure the two leads to your LED don't touch anything in the fan controller). Size the resistance of your photoconductive cell to the maximum resistance of the speed control pot you remove.

As the value of your PWM variable increases, and so the duty cycle of the LED, the photoconductive cell resistance will decrease and the fan speed will increase. It will act just like the speed control but your microcontroller will be in charge.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: ilak2k on Sep 22, 2016, 07:46 pm
It could be pretty messy if you try to directly interface the Arduino with 110 Volt (or worse 220V) power. There are all kinds of electrical hazards that can be created, and you definitely risk the destruction of your microcontroller.

If I were doing this, I would get a TRIAC fan controller (most hardware stores) which has a circuit similar to one shown in post #2. Then replace the speed control pot (has the knob on it) with a photoconductive cell (Mouser or Digikey) optically tied to an LED (put them in a little tube - one on each end). Apply your PWM signal to this LED to control its brightness and in turn that controls the resistance of the photoconductive cell and the fan speed. There is no direct electrical connection to the 110 or 220 Volts (make sure the two leads to your LED don't touch anything in the fan controller). Size the resistance of your photoconductive cell to the maximum resistance of the speed control pot you remove.

As the value of your PWM variable increases, and so the duty cycle of the LED, the photoconductive cell resistance will decrease and the fan speed will increase. It will act just like the speed control but your microcontroller will be in charge.
Safe and less intrusive...
Brilliant! @Trexo
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Jiggy-Ninja on Sep 22, 2016, 08:12 pm
When you say "photoconductive cell", are you referring to a light-dependent resistor or a photodiode?
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: allanhurst on Sep 23, 2016, 02:18 am
Big single phase  induction motors - those of  significant horsepower - have a magnetic design which makes them nearly synchronous - they typically run at  3% 'slip'.   Some little ones have a much more skewed rotor design, and can be controlled over a large speed range by varying the voltage at a fixed frequency. Small fan motors are often like this 

regards

Allan.

 
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Trexo on Sep 23, 2016, 10:21 pm
When you say "photoconductive cell", are you referring to a light-dependent resistor or a photodiode?
LDR!

Like this one:

http://www.mouser.com/ProductDetail/Adafruit/161/?qs=%2fha2pyFaduixdpM0SJ9tFN%252b0OwU6Abqiej%252bNUGqZ36k%3d
or
http://www.digikey.com/product-detail/en/luna-optoelectronics/NSL-5910/NSL-5910-ND/5436028

I would prefer the latter one in the metal can so it could be inserted in one end of a small tube with the LED being inserted in the opposite end.

This simulates the resistance of a potentiometer that is most often used in these motor speed control units. The response time of a typical LDR is slow enough that it recognizes the PWM LED output as a fixed level and doesn't see the pulsation.

Definitely not a photodiode!
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: farzu on Jul 18, 2017, 08:24 am
i want to make an automatic speed and on/off controlled fan. as an extra feature it will contain human sensing for the fan turned on and off. can anybody help me?? can anybody give me the codes???
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: alpha27 on Mar 03, 2018, 05:41 pm
use 4-5 relay(approx. 250 Rs.) and a fan regulator open it and join its wire with relay and join with Arduino(this will work but not the efficient way to control it.)
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: Zapro on Mar 03, 2018, 07:09 pm
use 4-5 relay(approx. 250 Rs.) and a fan regulator open it and join its wire with relay and join with Arduino(this will work but not the efficient way to control it.)
That's the most stupid idea i have heard in this thread  :o

// Per.
Title: Re: How to control AC 220V fan speed with arduino's PWM output..??
Post by: wilykat on Mar 04, 2018, 12:07 am
Not just stupid, gravedigging as well.  The last post was 6 months ago and someone new goes in with a dumb post like a badly coded spam bot.