• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Arduino Temperature Controller Circuit using DC Fan

Arduino Temperature Controller Circuit using DC Fan

Last updated on 29 July 2025 by Admin-Lavi Leave a Comment

This article show how to make Arduino Temperature Controller Circuit using DC Fan Arduino UNO, LCD, transistor, DHT11 sensor and with few resistors.

It show temperature and fan speed on LCD and control fan speed based on room temperature in home or office.

Fan turns ON and OFF automatic when temperature goes above or below a set limit.

Coding:

#include <LiquidCrystal.h>
#include <DHT.h>

#define DHTPIN 2     // Digital pin connected to DHT sensor
#define DHTTYPE DHT11 // DHT sensor type

#define FANPIN 3     // Digital pin connected to transistor base

#define LCD_RS 7     // LCD Register Select pin
#define LCD_EN  8     // LCD Enable pin
#define LCD_D4  5     // LCD Data pin 4
#define LCD_D5  6     // LCD Data pin 5
#define LCD_D6  11    // LCD Data pin 6
#define LCD_D7  12    // LCD Data pin 7

#define TEMP_THRESHOLD 25.0 // Temperature threshold in degrees Celsius

LiquidCrystal lcd(LCD_RS, LCD_EN, LCD_D4, LCD_D5, LCD_D6, LCD_D7);
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  lcd.begin(16, 2);
  dht.begin();
  pinMode(FANPIN, OUTPUT);
}

void loop() {
  float temperature = dht.readTemperature();
  float humidity = dht.readHumidity();

  if (isnan(temperature) || isnan(humidity))   
 {
    lcd.setCursor(0, 0);
    lcd.print("Error reading DHT sensor!");
  } else {
    lcd.setCursor(0, 0);
    lcd.print("Temp: ");
    lcd.print(temperature);
    lcd.print(" C  Humidity: ");
    lcd.print(humidity);
    lcd.print("%");

    if (temperature >= TEMP_THRESHOLD) {
      digitalWrite(FANPIN, HIGH);
    } else {
      digitalWrite(FANPIN, LOW);
    }
  }

  delay(1000);
}

Code Explanation:

  • DHT11 sensor read room temperature and humidity.
  • LCD show current temperature and humidity.
  • Transistor control DC fan using temperature.
  • Fan turns ON when temperature cross set limit (threshold).

Code Logic:

  • Read temperature and humidity using DHT11.
  • Check if sensor reading is correct.
  • Show values on LCD.
  • Compare temperature with threshold.
  • If hot then fan turns ON and If not fan turns OFF.

Circuit Working:

Arduino Temperature Controller Circuit Diagram using DC Fan

Parts List:

ComponentQuantity
Resistor
1k 1/4 watt1
470Ω 1/4 watt1
Semiconductors
Arduino UNO1
DHT11 sensor1
DC Fan 9V1
16×2 LCD1
IC 78091
Transistor 2N22221

This circuit project is easy to work and make.

Arduino make PWM at PWM pin and sends to transistor base.

Transistor give voltage based on PWM signal.

PWM control fan speed through transistor.

DHT11 send temperature and humidity to Arduino.

Arduino check if temperature is more than set limit.

If temperature is high then transistor turns ON and fan starts.

If temperature is low then transistor turns OFF and fan stops.

LCD shows current temperature and humidity.

How to Build:

To build a Arduino Temperature Controller Circuit using DC Fan following are the steps for connections:

  • Collect all parts from circuit diagram.
  • Use IC 7809 to give 9V regulated power to Arduino.
  • Connect 470Ω resistor from LCD backlight anode to Arduino 5V.

DC Fan Connection:

  • Fan (+) wire goes to collector of 2N2222 transistor.
  • Fan (–) wire goes to GND.

Transistor 2N2222 Connection:

  • Connect collector to fan (+) wire.
  • Connect base to Arduino pin 13 through 1k resistor.
  • And connect emitter to GND.

DHT11 Sensor Connection:

  • Connect VCC to Arduino 5V.
  • Connect GND to Arduino GND.
  • Connect DATA to Arduino pin 2.

LCD Connection to Arduino:

  • Connect VDD to Arduino 5V.
  • Connect VSS (GND) to Arduino GND.
  • Connect D4 to Arduino pin 5.
  • Connect D5 to Arduino pin 6.
  • Connect D6 to Arduino pin 11.
  • Connect D7 to Arduino pin 12.
  • Connect RS to Arduino pin 7.
  • Connect Enable to Arduino pin 8.
  • Connect R/W to Arduino GND.

Conclusion:

This Arduino Temperature Controller Circuit control DC fan based on room temperature.

Its threshold temperature can be changed.

If we require more features like humidity and alerts it can be added.

References:

Trouble turning on temperature controlled DC fan at the correct value

Filed Under: Arduino Projects, Sensors and Detectors

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « How to Measure Humidity and Temperature using Arduino and DHT11
Next Post: Simple Arduino LED Dimmer Circuit using PWM »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • Alarm Circuits (34)
  • Amplifier Circuits (67)
  • Arduino Projects (50)
  • Audio Circuits (97)
  • Automobile Circuits (19)
  • Battery Charger Circuits (48)
  • Free Energy (13)
  • Heater and Temperature Controllers (10)
  • High Voltage (1)
  • Indicator Circuits (39)
  • Inverter Circuits (13)
  • LDR Circuits (16)
  • LED and Lamps (116)
  • Meters and Testers (28)
  • Motor Controllers (18)
  • Oscillator Circuits (34)
  • Power Supply Circuits (92)
  • Remote Control Circuits (7)
  • Security and Protection (26)
  • Sensors and Detectors (91)
  • Solar Circuits (17)
  • Timer Circuits (30)
  • Transistor Circuits (57)
  • Transmitter Circuit (13)
  • Tutorials (5)
  • Water Level Controller (4)

Recent Posts

  • LDR Light Sensor Circuit with Arduino
  • Arduino Text to Speech Voice Generator Circuit
  • Smart Table to Kitchen Order Circuit with Arduino
  • Interfacing TFT LCD with Arduino
  • Arduino Based Coin Value Identifier Circuit

Recent Comments

  1. Admin-Lavi on Constant Voltage, Constant Current Battery Charger Circuit
  2. Bill on Constant Voltage, Constant Current Battery Charger Circuit
  3. Admin-Lavi on Long Range FM Transmitter Circuit (2km)
  4. Sina on Long Range FM Transmitter Circuit (2km)
  5. Admin-Lavi on Long Range FM Transmitter Circuit (2km)

Copyright © 2025 | New Circuit Ideas