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

MP PROJECT

The project aims to design an Arduino-based fan speed control system that adjusts the fan's speed according to the surrounding temperature using an LM35 temperature sensor. It features an LCD display to show the temperature and fan speed, with an LED indicator for high temperatures. Future enhancements include IoT integration and improved display interfaces.

Uploaded by

afzalrdx1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

MP PROJECT

The project aims to design an Arduino-based fan speed control system that adjusts the fan's speed according to the surrounding temperature using an LM35 temperature sensor. It features an LCD display to show the temperature and fan speed, with an LED indicator for high temperatures. Future enhancements include IoT integration and improved display interfaces.

Uploaded by

afzalrdx1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

MICROPROCESSORS

AND
MICROCONTROLLERS
LAB
PROJECT ABSTRACT
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
ENGINEERING
TKM COLLEGE OF ENGINEERING KOLLAM
SEMESTER:5
CLASS: E5 B
GROUP MEMBERS:
• Afzal Mohammed A S (10)
• Abel M Sajeev(1)
• Hadhi Ismail(35)
• Safwan V(75)
• Gokul Krishna P(33)
PROJECT TOPIC: Arduino Based Fan Speed control
Aim
To design and implement a system that controls and monitors the
speed of an electric fan based on the surrounding temperature using
an Arduino microcontroller and an LM35 temperature sensor. The
system should display the sensed temperature and fan speed on an
LCD screen.
Introduction
Temperature-based fan speed control is essential in various
applications where temperature regulation and energy efficiency are
priorities. This project aims to provide dynamic and automatic
control of a fan's speed based on real-time temperature input. The
Arduino microcontroller plays a pivotal role in interpreting
temperature data and adjusting the fan's speed using pulse-width
modulation (PWM).
Components Required
• Arduino UNO Board (ATmega328)
• LM35 Temperature Sensor
• 2N2222 Transistor (or BD139)
• 1N4007 Diode
• 16x2 LCD Display
• LED Indicator
• Fan (DC motor)
• Resistors and Capacitors
• Connecting wires
• Breadboard or PCB
• Power supply (5V)

Circuit Description
The core of this project is the Arduino UNO microcontroller, which
receives temperature data from the LM35 sensor. The LM35 is
chosen for its precision and linear response to temperature,
producing an output of +10.0mV per degree Celsius. The 2N2222
transistor acts as a switch, modulating the power supplied to the fan
based on temperature readings. A 1N4007 diode is used for back
EMF protection to prevent damage to the fan circuit.
An LED serves as an indicator to show when the temperature
surpasses 60°C. The analog signal from the LM35 is converted to a
digital value within the Arduino, which then adjusts the PWM signal's
duty cycle to control the fan speed. The system is programmed to
start the fan when the temperature exceeds 30°C, and the LCD
display shows both temperature (°C) and fan speed (%).
Working Principle
• The LM35 sensor detects the ambient temperature and outputs
an analog voltage proportional to the temperature.
• This voltage is fed into the Arduino's analog input, where it is
converted to a digital value using an ADC (analog-to-digital
converter).
• The Arduino calculates the temperature in degrees Celsius and
determines the appropriate PWM duty cycle to control the fan
speed.
• A PWM signal is sent to the 2N2222 transistor, which
modulates the fan's speed by switching it on and off at varying
frequencies.
• An LED lights up when the temperature crosses 60°C as a visual
alert.

Software Implementation
The Arduino is programmed using the Arduino IDE, and the code
includes:
• ADC conversion of the temperature sensor's analog output.
• Calculation logic to determine the PWM signal based on the
temperature.
• LCD library to display temperature and fan speed.
• Conditional checks to trigger the LED when the temperature
exceeds 60°C.

Applications
This temperature-based fan control system has applications in:
• Air conditioners
• Water heaters
• Snow-melters
• Ovens and heat exchangers
• Industrial mixers and furnaces
• Incubators and thermal baths
• Veterinary operating tables
Circuit Diagram

The schematic includes:


• Arduino UNO connected to LM35, with analog input from the
temperature sensor.
• 2N2222 transistor connected to the fan's power circuit.
• 1N4007 diode placed parallel to the fan for protection.
• 16x2 LCD display connected to the Arduino for user-friendly
monitoring.
Code
#include <LiquidCrystal.h>
LiquidCrystal lcd(2,3,4,5,6,7);
int tempPin = A5; // the output pin of LM35
int fan = 11; // the pin where fan is
int led = 8; // led pin
int temp;
int tempMin = 32;
; // the temperature to start the fan 0%
int tempMax = 40; // 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.28828125;
}
Conclusion
The temperature-based fan speed control system successfully
demonstrates the use of an Arduino to automate and monitor fan
operation based on temperature changes. This project enhances
efficiency and extends the fan's life while ensuring optimal
temperature management.

Future Scope
• Integrating wireless control and monitoring using IoT.
• Adding more sensors for enhanced precision.
• Implementing a more robust display interface, such as an OLED
screen or smartphone application.

You might also like