Arduino Fan Speed Control

Welcome to the enchanting realm of Fan Speed Control, where Robotshapers unveils the secrets of harnessing the perfect breeze. In this captivating blog, we delve into the mesmerizing world of Arduino-based fan speed control, empowering you to command the winds at your fingertips.

Arduino Fan Speed Control

Fan Speed Controller is all about the ability to adjust the fan speed according to specific needs. This control can be done using different methods including hardware control or software based control with the help of a microcontroller such as Arduino. One method of fan speed control is to use pulse width modulation (PWM). PWM includes fast fan on and off with multitasking cycles. By adjusting the duty cycle (percentage of time the power is on) you can control the average power sent to the fan and thus change the fan speed. To use fan speed control with Arduino, you usually need to perform the following steps:

  1. Checking the appropriate fan: Make sure the fan you are using is compatible with the PWM control. Look for fans specifically designed for this purpose.
  2. ConnectFan: Connect the fan to the appropriate power source and connect the PWM control pin of the fan to the PWM enabled pin on the Arduino board.
  3. Write Code: Write code to control fan speed using Arduino IDE. Use the analogWrite() function to generate a PWM signal on the specified pin.
  4. Adjust the duty cycle value (range 0 to 255) to change the fan speed: A higher duty cycle will increase the fan speed, while a lower duty cycle will decrease the speed.
  5. Upload and Test: Upload the code to the Arduino board and test the fan speed control. See the behavior of the fan when you change the duty cycle value in the code. By setting theduty cycle correctly, you can control the fan speed to meet cooling needs, noise reduction, or energy-saving goals.Fan speed control is used in many applications including computer cooling systems, fans and electrical appliances, fan speed control is good.

Components required:

  1. ArduinoUno
  2. 16X2 LCD
  3. 10K Resistor (3 pcs), 1k (1 pcs)
  4. BC547 Transistor
  5. PC Fan
  6. 2-Button Switches
  7. 10K Potentiometer

Circuit Diagram:

Code:

#include 
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
#define F 2// fan pin
#define S1 3//count plus
#define S2 4//count minus
int count =0;

void setup() {
  lcd.begin(16,2);
  pinMode(F,OUTPUT);
  pinMode(S1,INPUT);
  pinMode(S2,INPUT);
  lcd.setCursor(0,0);
  lcd.print("FAN SPEED");
  lcd.setCursor(0,1);
  lcd.print("CONTROL");
  delay(1500);
  lcd.clear();

}

void loop() {
  if (count <5 && digitalRead(S1)==0)// max count is 5
  {
    count=count+1;
    delay(1500);
  }
  if (count >1 &&digitalRead(S2)==0)// min count is 0
  {
    count=count-1;
    delay(1500);
  }
  lcd.setCursor(0,0);
  lcd.print("FAN SPEED:");
if (count ==1)
{
  analogWrite(F,51);// 20% speed
  lcd.setCursor(10,0);
  lcd.print("20% ");
}
if (count ==2)
{
  analogWrite(F,102);//40% speed
  lcd.setCursor(10,0);
  lcd.print("40% ");
}
if (count ==3)
{
  analogWrite(F,153);//60% speed
  lcd.setCursor(10,0);
  lcd.print("60% ");
}
if (count ==4)
{
  analogWrite(F,204);//80% speed
  lcd.setCursor(10,0);
  lcd.print("80% ");
}
if (count ==5)
{
  analogWrite(F,255);//full 100% speed
  lcd.setCursor(10,0);
  lcd.print("100%");
}
}

Other Applications of PWM:

  1. Motor Speed: PWM is widely used to control the speed of motors, including DC motors, servo motors. brushless DC
  2. Fan Speed Control: PWM is used to control the fan speed in air conditioners, HVAC (Heating, Ventilation and Air Conditioning) systems and air conditioners.
  3. LED dimming: PWM is used to dim the LED lights by changing the duty cycle of the PWM signal. 
  4. Power regulation: PWM is used to control the output voltage level in a Switched Mode Power Supply (SMPS). 
  5. Audio amplification: PWM is used in audio amplifiers, especially Class D amplifiers. 
  6. Solar Charge Controller: PWM-based charge controllers are used to control the charge of the battery in solar power generation systems.
  7. Robotics and Automation: PWM is used in robotic systems to control servo motors, robotic arm movement, and various automation tasks that require high speed and position control.
  8. Heating Control: PWM is used in heating such as electric heating to control the heat produced.
  9. Automotive Applications: PWM speed control is used in automotive systems to control engine cooling fans, fuel injection systems and powertrain components.
  10. Battery Charge: The battery charger uses a PWM-based charger to provide the correct charging current and voltage to ensure safe and efficient use.

Best projects development in Bhilai, Chhattisgarh, India. Contact : 7067150002