Lisleapex Blog
Published © CC BY-NC-ND

Control AC Fan Speed Using Arduino Generated PWM

In this project we will demonstrate AC fan speed control with Arduino using TRIAC.

BeginnerWork in progress2 hours130
Control AC Fan Speed Using Arduino Generated PWM

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
4N25 (zero-crossing detector)
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
MOC3021 0pto coupler
×1
(0-9)V, 500 mA step-down transformer
×1
BT136 thyristor
×1
230 VAC Axial AC Fan
×1
Connecting line
×1
Resistor 10k ohm
Resistor 10k ohm
×1
AC fan control using Arduino
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

circuit_hKkOmgD6Q2.png

Code

Untitled file

Arduino
int TRIAC = 6;
int speed_val = 0;

void setup() {
    pinMode(TRIAC, OUTPUT);
    attachInterrupt(digitalPinToInterrupt(3), zero_crossing, CHANGE);
}

void zero_crossing() {
    int chop_time = (200 * speed_val);
    delayMicroseconds(chop_time);
    digitalWrite(TRIAC, HIGH);
    delayMicroseconds(10);
    digitalWrite(TRIAC, LOW);
}

void loop() {
    int pot = analogRead(A0);
    int data1 = map(pot, 0, 1023, 10, 40);
    speed_val = data1;
}

Credits

Lisleapex Blog

Lisleapex Blog

15 projects • 0 followers
Fast Delivery of High-Quality Electronic Components

Comments