You are on page 1of 9

1

1 COMSATS UNIVERSITY ISLAMABAD


WAH CAMPUS

Department of Electrical & Computer Engineering


COMSATS University Islamabad
Wah Campus
Name M.Hamza Rauf (FA17-BEE-119)
Rao Nouman Tahir (FA17-BEE-012)
Usama Bin Zahid (FA17-BEE-146)
Ahmed Abdullah (FA17-BEE-194)
Date 27,December,2020

Submitted To

‘ Sir Saad Hassan’


2

2
‘Temperature Controlled Fan using Arduino’

Introduction: -
Major Features of Arduino Based Temperature Controlled Fan is to

Automatic control of fan speed according to temperature. Temperature and speed

are displayed over LCD.


1. Make a fan turn on automatically when the room temperature reaches a
certain degree. Automatic fan speed control according to temperature.
2. Temperature and speed are displayed over LCD.
3. Control Circuit and Load circuit is isolated using opto-isolator 4N35 i.e.
more protection.
4. High Power drive circuit i.e. can drive high power high voltage DC fan.
5. Maximum temperature indication using glowing LED.

Components: -
 Arduino Uno
 LM35 Sensor
 16×2 LCD Display
 DC Fan/motor
 9V Battery
 10KΩ Potentiometer
 220Ω Resistor
 Breadboard
 opto-isolator 4N35
  IGBT FGA25N120
3

 Circuit Diagram: -

HARDWARE DIAGRAM: -
4

Working: -
Temperature sensors detect the temperature and generate voltage according to
temperature it senses. Arduino nano compare output voltage of temperature sensor
and operate the fan. As we are using PWM pin, the speed of fan is variable
according to temperature. According to the software code fan start to rotate at 30 0C
and at 600C speed of fan become 100%. LCD shows the value of temperature and
fan speed. LED1 indicate the temperature status i.e. glowing LED indicate
temperature is maximum.

Explanation / Circuit Connection: -


Arduino and LM35 Interfacing: -

LM35 is a temperature sensor which sense temperature and generate voltage


according to temperature According to datasheet of LM35 it produces 10mV per
degree change in temperature. Arduino read this value using its internal analog to
digital converter (ADC). Arduino have inbuilt 10-bit ADC i.e. 1024 steps.

Arduino and LCD Interfacing: -


5

5 LCD is connected to Arduino in higher order data mode i.e. only higher order data
pin D4 to D7 of LCD is connected to Arduino nano for data displaying. Enable and
Set/Reset pin is connected to Arduino as shown in circuit diagram. Pin 1, Pin 5 and
pin 16 of Arduino is connected to ground where Pin 2 is connected to power
supply. Pin 15 of LCD (LED+) is connected to +5V through a current limiting
resistor. At Pin 3 of LCD we have to supply voltage between Vcc and Vss, so a
variable resistor is connected as shown in circuit diagram.

Switching Circuit: -

Arduino alone cannot drive the IGBT because it requires more voltage then the
Arduino output voltage. So, in order drive the IGBT an opto-coupler 4N35 is used.
This opto-isolator also isolate control circuit and load circuit. PWM output of
Arduino drive opto-isolator 4N35 which further drive IGBT.

Gate of IGBT is connected to pin 4 of opto-coupler. One resistor is connected


between gate of TGBT and ground of power supply in order to avoid false
triggering. DC fan is connected between power supply and collector of IGBT as
shown in circuit diagram. One fly back diode is connected across DC fan in order
protect the circuit from transient volt produced in inductor. Power supply is used
according to power rating of DC fan.

Code /Program: -

LiquidCrystal lcd(7,6,5,4,3,2);
int tempPin = A1;   // the output pin of LM35
int fan = 11;       // the pin where fan is
int led = 8;        // led pin
int vout,temp;
int tempMin = 25;   // the temperature to start the fan 0%
int tempMax = 60;   // the maximum temperature when fan is at 100%
int fanSpeed;
int fanLCD;
 
void setup() {
  pinMode(fan, OUTPUT);
6

6   pinMode(led, OUTPUT);
  pinMode(tempPin, INPUT);
  lcd.begin(16,2);  
  Serial.begin(9600);
}
 
void loop()
{  
    vout = analogRead(tempPin);
  temp = vout * 0.48828125;
   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 =map(temp, tempMin, tempMax, 32, 255);
       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
7

7    lcd.print("FANS: ");
   lcd.print(fanLCD);    // display the fan speed
   lcd.print("%");
   delay(1000);
   lcd.clear(); 
}

Simulation Diagram: -
8

Advantage: -

1. This project can be used in Home.


9

9
2. This project can be used in Industry.

3. This will help in saving the energy / electricity.

4. To monitor the environments that is not comfortable, or possible, for humans to


monitor, especially for extended periods of time.

5. Prevents waste of energy when it’s not hot enough for a fan to be needed.

6. To assist people who are disabled to adjust the fan speed automatically.

Disadvantage: -
1. It can only be maintained by technical person. Thus, it becomes difficult to be
maintained.

2. Due to temperature variation, after sometimes its efficiency may decrease.

You might also like