Back to Basic Projects

🌀 Smart Fan Speed Controller

Automatically increase fan speed as temperature rises — build a real thermal management system using DHT11 and PWM.

📋 Overview

Thermal management is critical in electronics, computers, and industry. This project creates a closed-loop temperature controller that automatically spins a fan faster when things get hot — exactly like your laptop's cooling system.

Technical Insight: This is a proportional controller: fan speed scales linearly with temperature above a threshold. For a fully automatic on/off fan: below 25°C → fan OFF, 25–35°C → fan mapped 0–255 PWM, above 35°C → fan 100%. A BC547 transistor or L298N drives the fan from a separate 5V supply.

In simple terms: The DHT11 tells the Arduino how hot it is. The Arduino calculates how hard the fan should blow and adjusts the PWM motor signal in real time. The LCD shows current temperature and fan speed percentage.

What you'll learn: DHT11 sensor interfacing, proportional control algorithms, PWM motor speed mapping, LCD integration, and practical thermal engineering concepts.

Estimated time: 45-60 minutes. Difficulty: ⭐⭐ Easy — a complete real-world embedded system.

🧩 Components Needed

ComponentSpecificationQtyNotes
Arduino Uno R35V1
DHT11 Temperature Sensor0–50°C, ±2°C1
Small DC Fan (5V)5V DC, <200mA1CPU fan or small hobby fan
BC547 TransistorNPN, 100mA1Drives the fan from PWM pin
1kΩ Resistor (base)1
1N4007 Flyback Diode1Across fan motor
10kΩ ResistorPull-up for DHT111
16x2 LCD with I2C1Optional display

🗺️ Component Pin Mapping

Smart Fan Speed Controller Component Pin Mapping Infographic

📖 Step-by-Step Tutorial

1

Wire DHT11

VCC → 5V, GND → GND, DATA → pin 2 with 10kΩ pull-up to 5V.
2

Wire Fan Driver

Arduino pin 9 → 1kΩ → BC547 Base. BC547 Collector → Fan (-). Fan (+) → 5V. BC547 Emitter → GND. Flyback diode across fan terminals (cathode to +).
3

Connect LCD

I2C LCD: SDA → A4, SCL → A5, VCC → 5V, GND → GND.
4

Install Libraries

Install DHT sensor library (Adafruit) and LiquidCrystal_I2C from Library Manager.
5

Upload and Test

Upload code. Breathe warm air on the sensor or cup it in your hand — watch fan speed increase on LCD!
💡
To test without increasing room temperature, simply hold your warm hand around the DHT11 sensor for 10 seconds. Your body heat (~37°C) will push the reading above the threshold and spin the fan to full speed.

💻 Arduino Code

fan_pwm_controller.ino
INO
// Smart Fan Speed Controller — Volt X
#include <DHT.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define DHTPIN  2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);

const int FAN_PIN   = 9; // PWM pin → BC547 base via 1kΩ
const float T_LOW   = 25.0; // Below: fan OFF
const float T_HIGH  = 35.0; // Above: fan 100%

void setup() {
  pinMode(FAN_PIN, OUTPUT);
  dht.begin();
  lcd.init(); lcd.backlight();
  Serial.begin(9600);
}

void loop() {
  float temp = dht.readTemperature();
  if (isnan(temp)) { delay(2000); return; }

Reviews & Ratings

0 reviews
5★
0
4★
0
3★
0
2★
0
1★
0
...

Loading reviews...