1. Introduction
A Temperature Controlled Fan is an intelligent system that automatically turns ON or adjusts the speed of a fan based on ambient temperature. This project uses an Arduino Uno and an LM35 Temperature Sensor to monitor temperature and control a fan.
This is widely used in:
- Electronic cooling systems
- Smart homes
- Industrial automation
- Computer CPU cooling
2. Components Required
- Arduino Uno
- LM35 Temperature Sensor
- DC Fan (5V or 12V)
- NPN Transistor (TIP122)
- Diode (1N4007)
- Resistor (1kΩ)
- External Power Supply (if needed)
- Breadboard
- Connecting Wires
3. Circuit and Connections
| Pinout Diagram of Arduino Uno |
LM35 Sensor:
- VCC → 5V
- GND → GND
- OUT → A0
Fan Control:
- Fan + → External Supply (+)
- Fan – → Collector of Transistor
- Emitter → GND
- Base → Arduino Pin 9 (via 1kΩ resistor)
Protection:
- Diode across fan (reverse biased)
4. Detailed Step By Step Circuit Working
- LM35 senses temperature and outputs analog voltage
- Arduino reads this voltage from A0
- Converts voltage into temperature (°C)
- Compares temperature with threshold
- If temperature exceeds limit → Fan turns ON
- If temperature is low → Fan remains OFF
Optional:
- Use PWM to control fan speed dynamically
5. Libraries to be Included
No external libraries required ✅
6. Code
#define tempPin A0
#define fanPin 9
float temperature = 0;
void setup() {
pinMode(fanPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
int value = analogRead(tempPin);
float voltage = value * (5.0 / 1023.0);
temperature = voltage * 100;
Serial.print("Temperature: ");
Serial.println(temperature);
if (temperature > 30) {
digitalWrite(fanPin, HIGH);
} else {
digitalWrite(fanPin, LOW);
}
delay(1000);
}
7. Detailed Step By Step Code Working
analogRead(A0)→ Reads sensor value- Converts to voltage
- LM35 gives 10mV per °C
- Temperature = Voltage × 100
- If temperature > 30°C → Fan ON
- Else → Fan OFF
8. Output
- Fan automatically starts when temperature rises
- Stops when temperature drops
- Can be upgraded to variable speed
9. Applications
- CPU Cooling Systems
- Smart Home Automation
- Industrial Machines
- Battery Cooling Systems
- Greenhouses
10. Advantages
- Energy efficient
- Automatic operation
- Low cost
- Easy to build
- Expandable to IoT
11. Disadvantages
- Basic version has fixed threshold
- LM35 limited temperature range
- Fan speed control not included (in basic model)
12. Future Improvements
- Add LCD display
- Use PWM for speed control
- Add IoT monitoring (Blynk)
- Use DHT11 Sensor for humidity + temperature
- Mobile app control