0% found this document useful (0 votes)
8 views

Temperature Based Fan Speed Controller using Arduino

The document describes a Temperature Based Fan Speed Control and Monitoring system using Arduino and an LM35 Temperature Sensor, which adjusts fan speed based on the sensed temperature. It includes a bill of materials, circuit diagram, and source code for implementation. The system displays temperature and fan speed on an LCD, making it suitable for various applications like air-conditioners and ovens.

Uploaded by

sgta58779
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Temperature Based Fan Speed Controller using Arduino

The document describes a Temperature Based Fan Speed Control and Monitoring system using Arduino and an LM35 Temperature Sensor, which adjusts fan speed based on the sensed temperature. It includes a bill of materials, circuit diagram, and source code for implementation. The system displays temperature and fan speed on an LCD, making it suitable for various applications like air-conditioners and ovens.

Uploaded by

sgta58779
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Temperature Based Fan Speed

Controller using Arduino

Temperature Based Fan Speed Control & Monitoring with


Arduino:
In this post, we have described how to design Temperature Based Fan
Speed Control & Monitoring With Arduino and LM35 Temperature Sensor.
The microcontroller controls the speed of an electric fan according to the
requirement & allows dynamic and faster control and the LCD makes the
system user-friendly. Sensed temperature in Celsius Scale and fan speed
in percentage are simultaneously displayed on the LCD panel.

The applications areas of this project are air-conditioners, water-heaters,


snow-melters, ovens, heat-exchangers, mixers, furnaces, incubators,
thermal baths, and veterinary operating tables.

Bill of Materials
S.N. Components Name Quantity Purchase Links
1 Arduino UNO Board 1 Amazon | AliExpress
2 LM35 Temperature Sensor 1 Amazon | AliExpress
3 12V DC Fan 1 Amazon | AliExpress
4 16x2 LCD Display 1 Amazon | AliExpress
5 Potentiometer 10K 1 Amazon | AliExpress
6 Transistor 2N2222 1 Amazon | AliExpress
S.N. Components Name Quantity Purchase Links

7 Resistor 1K 1 Amazon | AliExpress


8 Diode 1N4007 1 Amazon | AliExpress
9 Capacitor 10uF 1 Amazon | AliExpress
10 LED 5mm Any Color 1 Amazon | AliExpress
11 12V Power Supply/Adapter 1 Amazon | AliExpress
12 Connecting Wires 20 Amazon | AliExpress
13 Breadboard 1 Amazon | AliExpress
Circuit Diagram & Connections:

Circuit diagram of the Temperature Based Fan Speed Control & Monitoring
With Arduino & LM35 is shown above. Arduino is at the heart of the circuit
as it controls all functions. LM35 is a precision integrated-circuit whose
output voltage is linearly proportional to Celsius (Centigrade)
temperature. It is rated to operate over a -55°C to 150°C temperature
range. It has +10.0mV/Celsius linear-scale factor.
The 2N2222 transistor acts as a switch and controls the fan speed
depending upon temperature. 1N4007 diode controls the fan from being
damaged. The LED glows whenever the temperature exceeds 60°C.

Working of the Circuit:


Temperature sensor LM35 senses the temperature and converts it into an
electrical (analog) signal, which is applied to the ATmega328
microcontroller of the Arduino UNO Board. The analog value is converted
into a digital value. Thus the sensed values of the temperature and speed
of the fan are displayed on the LCD. When the temperature exceeds 30°C
the fan starts rotating.

A low-frequency pulse-width modulation (PWM) signal, whose duty cycle is


varied to adjust the fan’s speed is used. An inexpensive, single, small pass
transistor-like 2N222 or BD139 can be used here. It is efficient because
the pass transistor is used as a switch.
Source Code/Program:
The program for Temperature Based Fan Speed Control & Monitoring With
Arduino is given below. Simply copy this code and paste it in your Arduino
IDE. Then compile the code and then upload it.

#include <LiquidCrystal.h>
56 LiquidCrystal lcd(2,3,4,5,6,7);
57 int tempPin = A0; // the output pin of LM35
58 int fan = 11; // the pin where fan is
59 int led = 8; // led pin
60 int temp;
61 int tempMin = 30; // the temperature to start the fan 0%
62 int tempMax = 60; // the maximum temperature when fan is at 100%
int fanSpeed;
int fanLCD;

void setup() {
pinMode(fan, OUTPUT);
pinMode(led, OUTPUT);
pinMode(tempPin, INPUT);
lcd.begin(16,2);
Serial.begin(9600);
}

void loop()
{
temp = readTemp(); // get the temperature
Serial.print( temp );
if(temp < tempMin) // if temp is lower than minimum temp
{
fanSpeed = 0; // fan is not spinning
analogWrite(fan, fanSpeed);
fanLCD=0;
digitalWrite(fan, LOW);
}
if((temp >= tempMin) && (temp <= tempMax)) // if temperature is higher than
minimum temp
{
fanSpeed = temp;//map(temp, tempMin, tempMax, 0, 100); // the actual speed of
fan//map(temp, tempMin, tempMax, 32, 255);
fanSpeed=1.5*fanSpeed;
fanLCD = map(temp, tempMin, tempMax, 0, 100); // speed of fan to display on
LCD100
analogWrite(fan, fanSpeed); // spin the fan at the fanSpeed speed
}

if(temp > tempMax) // if temp is higher than tempMax


{
digitalWrite(led, HIGH); // turn on led
}
else // else turn of led
{
digitalWrite(led, LOW);
}
lcd.print("TEMP: ");
lcd.print(temp); // display the temperature
lcd.print("C ");
lcd.setCursor(0,1); // move cursor to next line
lcd.print("FANS: ");
lcd.print(fanLCD); // display the fan speed
lcd.print("%");
delay(200);
lcd.clear();
}

int readTemp() { // get the temperature and convert it to celsius


temp = analogRead(tempPin);
return temp * 0.48828125;
}
Link: https://how2electronics.com/temperature-based-fan-speed-controller-using-arduino/

You might also like