1

I'm trying to control my ~230 V fan from the Arduino.

Can anyone say the best possible ways to design a fan regulator that can be controlled by the Arduino using a low cost design.

  • Use TRIAC Circut. In this you can control the current flow to the FAN – Vaibhav Apr 19 at 11:47
  • How many relays needed to make 5 level regulator? I think it is not effective design. – Sivamani V Apr 19 at 11:51
  • Do you want a variable speed controller or single-speed? And is this a 3 phase motor? – Duncan C Apr 19 at 12:02
  • Single phase motor and variable speed controller for my home automation. – Sivamani V Apr 19 at 12:05
  • 1
    I use Kemo module to regulate a heater. They can regulate an inductive load too. For MCU control they have a digital pot module M150 controlled by PWM. kemo-electronic.de/en/Light-Sound/Effects/Modules/… – Juraj Apr 19 at 12:59
3

To control AC power for inductive load (motor) MOSFET capable of switching 230 V is used. The concept is called phase cutting. It works for a resistive load (heater) too.

This module is designed for phase cutting. It contains a zero crossing detector and a MOSFET. The control is done in MCU. The zero crossing detector is wired to an interrupt pin. The control signal for the MOSFET is wired to an output pin. In external interrupt function you turn off the MOSFET and set a timer interrupt to turn it back on after some microseconds. Longer off time results in less power for the motor.

enter image description here

At 50 Hz AC, one pulse is 10 milliseconds. To cut a part of AC wave out, turn the MOSFET off for 0 to 10 milliseconds.

Robotdyn has a library for the module.

EDIT:

I bought the Robotdyn AC dimmer module to use it in my AC heater regulation project and I tested it with a incandescent light bulb and a fan. (video on youtube)

The module uses a triac to open and close the AC line. Triac turns-off self at zero-crossing. We can only turn it on with a HIGH signal.

The library by Robotdyn works, but it is designed to control many dimmers and uses a timer interrupt every 12 microseconds (yes, micros). The library sets the interrupts over MCU registers.

I wrote an adrduino fade-in/out sketch using TimerOne library to demonstrate phase cutting with this module.

#include <TimerOne.h>

const byte INTERRUPT_PIN = 2;
const byte TRIAC_PIN = 4;
const byte TRIAC_PULSE_MICROS = 30;

const int FADE_MAX = 9800;
const int FADE_MIN = 2000;

volatile bool triacOn;
volatile int period = FADE_MIN; // microseconds cut out from AC pulse

int fadeAmount = 10;

void zeroCrossing() {
  triacOn = false; // triac tuns off self at zero crossing
  Timer1.setPeriod(period); // to call triacPulse() after off period
}

void triacPulse() {
  if (triacOn) { // stop pulse
    digitalWrite(TRIAC_PIN, LOW);
    Timer1.stop();
  } else { // start pulse
    digitalWrite(TRIAC_PIN, HIGH);
    triacOn = true;
    Timer1.setPeriod(TRIAC_PULSE_MICROS);
  }
}

void setup() {
  pinMode(TRIAC_PIN, OUTPUT);
  attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), zeroCrossing, RISING);
  Timer1.initialize();
  Timer1.attachInterrupt(triacPulse);
}

void loop() {
  period = period + fadeAmount;
  if (period <= FADE_MIN || period >= FADE_MAX) {
    fadeAmount = -fadeAmount;
  }
  delay(25);
}
  • the modules and component I linked in comments use this method. they work as 'pwm to phase cutting adapters' – Juraj Apr 21 at 8:50
  • +1 Nice answer :-) – Greenonline Apr 21 at 19:52
0

It depends on the motor.

To quote MarkT from this post:

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

To quote dc42, from this post:

What sort of motors do the fans have? If they use induction motors, then you won't be able to control the speed much using phase angle switching - the speed is tied to the supply frequency. If they are series-wound motors with brushes, then phase angle switching should work.

The results you reported when you tried to use the velleman kit suggests to me that the fans may have induction motors.


For more information, read:

  • Thanks Greenonline. But how fan regulators do this. From the blog, if I done with PWM signal with normal fan regulator circuit, the output pulse signal will affect the 50 Hz (Indian standard AC frequency) both home main supply box and connected devices. – Sivamani V Apr 19 at 13:04
  • Blog? What blog? Link? – Greenonline Apr 19 at 13:09
  • that's arduino forum forum.arduino.cc/index.php?topic=100899.0 from the joy reply – Sivamani V Apr 19 at 13:13
  • As this reply to Joy's post states, you need to use zero-crossing detection, which Juraj's answer correctly demonstrates. – Greenonline Apr 21 at 9:24
0

Finally i found it as a product available here with the thyristor circuit and electrical-contactless servo (PWM or ANALOG input) motor ( to drive the input) will helps to drive the output from 0 to 220V. smooth fan regulator can also do this with servo motor and without any external electrical component requirement . If it is not efficient way with low cost design command or answer your way. :-).

  • If your design is more efficient than mine your design is considered as answer. :-). Thanks in advance. – Sivamani V Apr 20 at 7:10
  • 1
    this is for manual regulation. you want to turn that pot with a motor? – Juraj Apr 20 at 13:34
  • @Juraj Thank you. That can be done by arduino PWM input. So we don't need to work for that. – Sivamani V Apr 20 at 14:35
  • the board I linked in my aliexpress comment looks better. labels and description swapped input/output (like you do: PWM input ?!), but the electronics should work – Juraj Apr 20 at 14:44
  • You are correct Juraj. That will perfectly match to this circuit ♥. But in question I asked to bring it in low cost design. Your answer is highly acceptable rather than cost. That's why I'm not mentioned my design also correct. – Sivamani V Apr 20 at 14:49
0

There is also the issue of isolation here, to keep the controller side from being connected to the mains for reasons of noise and safety. The previous posters' comments about doing this with triacs or mosfets, and phase angle control are all true. It is nearly impossible to control the speed of a single phase induction motor. Anyway, the most elegant solution is to get a 3 phase fan motor and a variable frequency drive with low-voltage DC control input. Run the pwm output from the Arduino through an opto-isolator (drive the internal led). Use the DC reference on the speed control to power the output of the opto-isolator. Run that through an rc lowpass filter to the speed control voltage input. I think you could get out of this for around 200$US. Check surpluscenter.com. there are many motors and drives out there. -Hugh

-1

Its not exactly what you are looking for but it will help Arduino-controlled-light-dimmer-The-circuit.

Here is the sample project in which TRIAC is used with arduino for controlling the flow of current to the light. In your case Light or better we can say load is FAN. This will help you in controlling the FAN Speed. Relay only act as switch and it won't control FAN Speed.

  • 1
    Link only answer? We are looking for comprehensive answers that provide some explanation and context. Very short answers cannot do this, so please edit your answer to explain why it is right. Additionally, we prefer answers to be self contained where possible. link only answers are frowned upon (as links tend to rot) & will be rendered useless if the linked-to content disappears. If you add more context and detail from the link, it is more likely that people will find your answer useful. – Greenonline Apr 19 at 12:37
  • Thanks Vaibhav, My thought is TRIAC's AC phase may affect arduino board which will affect my analog sensor readings in arduino and their is chance to death too :-/. – Sivamani V Apr 19 at 12:40
  • Now I think I am better clear about what I want to say. – Vaibhav Apr 19 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.