Microcontroller Based Automatic Room Temperature Controller Enyew

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

Microcontroller Based Automatic Room

Temperature Controller
A project report
Submitted by
ENYEW EJIGU
TOLAMARIAM LELLISA
ESUBALEW TSEHAY
In partial fulfillment for the award of the degree
Of

BACHELOR OF TECHNOLOGY
IN
ELECTRICAL POWER ENGINEERING
At

DEFFENCE UNIVERSITY, COLLEGE OF ENGINEERING

BISHOFTU
JUNE 2018

i
DECLARATION
We declare that the project titled “microcontroller based automatic room temperature controller”
is submitted to the Department of Electrical power Engineering, DUEC for the fulfillment of
degree in Bachelors of Science in Electrical power Engineering. In addition, we announce that
this is our unique work and has not been submitted anywhere for the honor of any other degree
or any other publication.
Name signature date
Enyew Ejigu _________ ________
Esubalew Tsehay _________ ________
Tolamariam Lellisa _________ ________
Signature of the advisor

Maj. Ashebir kelibe (Lec) ___________

Department of Electrical power Engineering

i
CERTIFICATE
This is to certify that the project report entitled “Microcontroller based automatic room
temperature controller” is a record of work carried out by the following students of B.
Technology at defense University, college of Engineering, Bishoftu, during the year 2018.
1. Enyew Ejigu…………………………...REG 323/06
2. Esubalew Tsehay……………………..REG 324/06
3. Tolamariam Lellisa…………………...REG 336/06
In partial fulfilment of the requirements for the award of bachelor of technology in Electrical
Engineering and the project has not formed the basis for the award previously of any degree,
diploma, fellowship or any other similar rule.

Project advisor: Maj. Ashebir kelibe (Lec). Date_________ Signature__________


Examiners Signature
1.___________________________ ____________________
2.___________________________ ____________________
3.___________________________ ____________________
Department Head_______________ Signature______________
Chair Person ________________ Signature______________

ii
Acknowledgement
Great thanks to God for seeing us through our study. We are definitely grateful to a number of
people for all the help provided in the course of this project. First and foremost we would like to
thank our advisor Major Ashebir Kelibe for taking time to guide us through this project. And
also we would like to thank Capt. Berhe G/Her for his support throughout our work. Our
appreciation also goes to all lectures, assistances and our fellow students of our department.
Finally, we must acknowledge with due respect the constant supports and patience of our
parents.

iii
ABSTRACT
Basically in this project we will be controlling fan speed with respect to the temperature. The
system will get the temperature from the temperature Sensor and it will control the speed
according to the temperature, set by the user. In this project, microcontroller forms the
processing part, which firstly senses the temperature and the controller then compares the data
with the set temperature. If the current temperature is greater than the set temperature, the
controller turns ON the fan and the set speed will be proportional to the difference between the
set temperature & the current temperature. If the current temperature is less than the set
temperature, the fan will be turned OFF and the heater is ON. The fan’s speed will change
according to the temperature.
Keywords: Microcontroller, speed, temperature, Liquid Crystal Display ( LCD), sensor

iv
TABLE OF CONTENT
Contents Page
DECLARATION ........................................................................................................................... i

CERTIFICATE ............................................................................................................................. ii

Acknowledgement ......................................................................................................................... ii

ABSTRACT .................................................................................................................................. iv

CHAPTER ONE ........................................................................................................................... 1

INTRODUCTION ........................................................................................................................ 1

1.1Background ................................................................................................................................ 1

1.2Problem of statement ................................................................................................................. 2

1.3 Objective of the Project ............................................................................................................ 3

1.3.1 General objective ......................................................................................3

1.3.2 Specific objective ......................................................................................3


1.4 Methodology ............................................................................................................................. 3

1.5 Significance of the study........................................................................................................... 3

1.6 Scope of the project .................................................................................................................. 4

1.7 Organization of the project ....................................................................................................... 4

CHAPTER TWO .......................................................................................................................... 5

THEORY AND LITERATURE REVIEW ................................................................................ 5

2.1 Theory of Temperature ............................................................................................................. 5

2.1.1 How to control temperature ......................................................................5


2.2 Literature review ....................................................................................................................... 6

CHAPTER THREE ...................................................................................................................... 7

BLOCK DIAGRAM AND SYSTEM COMPONENT DESCRIPTION .................................. 7

3.1 Block Diagram Of the system ................................................................................................... 7

v
3.2 Block diagram description ........................................................................................................ 7

3.3 SYSTEM COMPONENTS....................................................................................................... 8

3.3.1 LM35 .........................................................................................................8

3.3.2 Lm35d features .........................................................................................9

3.3.3Liquid crystal display (LCD) .....................................................................9

3.3.4 Motor driver ............................................................................................11

3.3.5Arduino UNO revision 3 board ...............................................................14

3.3.6 Power supply ...........................................................................................16

3.3.7 Light Emitting diode ...............................................................................16

3.3.8 Potentiometer ..........................................................................................17

3.3.9 Transistor ................................................................................................17

3.3.10 Relay .....................................................................................................18

3.3.11 Resistors ................................................................................................18

3.3.12 DC Fans.................................................................................................19

3.3.13 Electric Heater ......................................................................................20

3.3.14 GSM Module ........................................................................................21


3.3.14.1 Connecting GSM module to arduino………………………………………….22
CHAPTER FOUR....................................................................................................................... 24

CIRCUIT DIAGRAM AND ITS DESCRIPTION………………………………………..….24

4.1Circuit diagram ........................................................................................................................ 24

4.2 Circuit diagram description .................................................................................................... 24

4.3 Flowchart ................................................................................................................................ 25

4.3.1 Flowchart Description .............................................................................26


4.4 Algorithms .............................................................................................................................. 26
vi
4.5 programs.................................................................................................................................27

CHAPTER FIVE ........................................................................................................................ 32

RESULTS AND DISCUSSIONS ............................................................................................... 32

CHAPTER SIX ........................................................................................................................... 39

FUTURE WORK AND CONCLUSION .................................................................................. 39

6.1 Conclusion .............................................................................................................................. 39

6.2 Future modifications & Recommendations ............................................................................ 39

Reference ..................................................................................................................................... 40

vii
LIST OF FIGURES

Figure 3.1: Block Diagram Of The system ..................................................................................... 7

Figure 3.2: LM 35 Temperature Sensors ........................................................................................ 8

Figure 3.3: Pin diagram of LCD ................................................................................................... 10

Figure 3.4: L293D pin diagram .................................................................................................... 12

Figure 3.5: Ardiuno UNO board ................................................................................................... 15

Figure 3.7: Led symbol ................................................................................................................. 17

Figure 3.8: transistor symbol and pins .......................................................................................... 18

Figure 3.9: 12v Relay.................................................................................................................... 18

Figure 3.10: resistor ...................................................................................................................... 19

Figure 3.11: 12v dc fan ................................................................................................................. 19

Figure 3.12: sample of heater ....................................................................................................... 20

Figure 3.14: circuit diagram to connect GSM module to Arduino ............................................... 23

Figure 4.1: Circuit diagram of the project .................................................................................... 24

Figure 4.2: Flowchart .................................................................................................................... 25

Figure 5.1: Circuit diagram Condition 1 ....................................................................................... 33

Figure 5.2: Circuit diagram Condition 2 ....................................................................................... 34

Figure 5.3: Circuit diagram Condition 3....................................................................................... 35

Figure 5.4: Circuit diagram Condition 4 ....................................................................................... 36

Figure 5.5: circuit diagram Condition 5........................................................................................ 37

Figure 5.6: Circuit diagram Condition 6 ....................................................................................... 38

viii
LIST OF TABLE

Table 3.1 L293D Logic Table…………………………………………………….15

ix
LIST OF ACRONYMMS

LCD Liquid Crystal Display

LED Light Emitting Diode

μc Microcontroller

RPM Revolution per Minute

IC Integrating circuit

ADC Analog to Digital Convertor

PWM pulse width

°C Degree celicus

DC Direct current

PCB Printed circuit board

RS Register select

R/W Read/Write

EN Enable

H High

IC Integrated circuit

USB Universal serial bus

MHz Mega hearth

KB Kilo byte

SRAM Static random access memory

EEPROM Electrically Erasable Programmable Read Only Memory

NPN Negative-Positive -Negative

COM Common

NC Normally closed

NO Normally open

x
dB decibel

GSM Global System for mobile

SIM subscriber identity module

RX Receiver

TX Transmitter

xi
i
1
CHAPTER ONE
INTRODUCTION
1.1Background
Electric fan is defined as a device used to produce airflow for the purpose of creature comfort,
ventilation, exhaust, or any other gaseous transport. Meanwhile, a ceiling fan is a device
suspended from the ceiling of a room, which employs hub-mounted rotating paddles to circulate
air in order to produce a cooling or desertification effect. The first ceiling fans appeared in the
1860s and 1870s, in the United States. At that time, they were not powered by any form of
electric motor. Instead, a stream of running water was used, in conjunction with a turbine, to
drive a system of belts which would turn the blades of two-blade fan units. Afterwards, the
electrically-powered ceiling fan was invented in 1882 by Philip Diehl. Electric fans are designed
to create a breeze and circulate air in a room. A good fan can make a room feel 10-15 degrees
cooler when used properly. Electric fans are pretty simple in their design and function. An
electric motor spins the blades, which are shaped to move air from the back of the fan out
through the front of the fan. The important parts of a ceiling fan are the electric motor, paddles or
blades, down rod and switches. Since a fan creates its cooling effect by speeding, thus, the most
important part of a fan is its speed controller. Electric fan come in a different ways of operating
method, that is depend on the manufactures and style. The conventional fans are operated by
pull-chain control or capacitor-stepped wall control. In contemporary day nowadays, a luxurious
feature offered on many modern ceiling fans that speed is controlled by the hand-held wireless
remote control. These types of fan are typically has three or five of speed control. Most ceiling
fans sold in recent years have switch for turned the fan on and off operation together with adjust
the speed at which the blades rotate. This invention relates to the field of devices for moving air
in enclosed spaces. More particularly it relates to an automatic microcontroller controlled fan.
The microcontroller based ceiling fan is automatically switching the speed of fan rotating
according to the environment temperature changes. This project is as further step for developing
a smart home technology by fulfilling the requirement of technologies “tomorrow will be more
advanced than today”. [8]
However the concept of this project is to create an Automatic Temperature Control System to
control the temperature of a system. The circuit maintains the temperature of the system in a
particular range. The fan RPM increases with increase in temperature and vice versa. For the

1
circuit, it consists of Temperature Sensing Unit, arduino , LCD Module, Driver, LED, heater
and a fan. It will operate based on the values or ranges of temperature in the system which is
detected by the Temperature Sensor.
The Temperature Sensor detects the temperature of the system. The temperature Sensor consists
of an LM35 IC. The temperature sensor is connected to the ADC input of the μ C. It converts the
analog input to a digital value. The arduino microcontroller generates PWM according to the
temperature sensor value. The PWM generated output control signals are sent to the Motor
Driver IC L293D. Motor Driver ICL293D is fed with the PWM generated output from
microcontroller. By using the L293D, a dc motors can be connected. The speed of the fan is
controlled by the ON time of the PWM generated by the controller. With increasing ON time, the
speed of the fan increases reducing the temperature of the system and when the temperature
becomes bellow the lower limit of normal range of temperature the arduino microcontroller
generates digital signal and sent to the transistor. The transistor amplifies this signal and sent to
relay, then the relay energizes and closes its contact and then the heater turns on. The LCD
module is connected to the microcontroller. The LCD module displays the current temperature.
The LCD display used is a 16x2 Alphanumeric Display with codeLM016L. It is a parallel LCD
which is connected to the microcontroller I/O ports. The Led is also connected to the
microcontroller and used to show the temperature status. [8]

1.2 Problem of statement


Modern electronics has provided the consumer with the ability to remotely control a variety of
household appliances. However, there has not yet been used with automatic control of ventilation
devices, or more particularly to the control of fan’s speed. Furthermore, some disabled people
who are paralyzed and handicapped with no hands find it difficult to monitor the fan speed
manually. And also for rooms where chemical reaction takes place is difficult to control the fan
speed manually all the time when the temperature changes. Microcontroller based fan is as
further step to improve the technology of a fan to control room temperature automatically.

2
1.3 Objective of the Project
1.3.1 General objective
The General objective of this project is to design and simulate microcontroller based automated
room temperature control system.

1.3.2 Specific objective


 To construct or design power supply circuit
 To read data from temperature sensor which will be displayed on LCD
 To integrate LM35D IC,L293D IC,GSM and LCD in the microcontroller
 To control temperature in a room according to our needs.

1.4 Methodology
While performing the project we have followed the following procedures:
 Literature review to understand the concept and functionality of the project.
 Understand the whole system of hardware and software in sequences.
 Design the circuit and develop the programming.
 Testing the system functionality.
 Combining both the circuit and software system.

1.5 Significance of the study


 This project is an innovative prototype design of electric fan and heater with smart
characteristics; these electric fan and heater uses a microcontroller to produce an
automation function. This is to ensure both the cooling and heating process operates more
efficiently and effectively.
 By applying this project, it offers a better life for humanity is really practical for senior
citizens to make their life simpler.
 The circuit is suitable for disabled people who have difficulty to switch on the fan
manually.
 The circuit is also suitable for rooms where chemical reaction takes place which is
difficult to switch on the fan manually according to the change in temperature.
 The advantages of such a system are less energy usage, and provides more convenient to
the consumers.

3
1.6 Scope of the project
The scope of this project is to study and design “microcontroller based automatic room
temperature controller”. The components to be studied in this project are temperature sensor,
arduino microcontroller, LCD screen, motor driver, fan, heater and power circuit.

1.7 Organization of the project


This project document consists of six chapters followed by references. The first chapter is an
introduction part that contains background of the area which assures that a number of works are
required in this area, contribution of the project and the scope of the project. The statement of
problem and objective of our project, microcontroller based automated Room Temperature
control system have been explained in this chapter.
Chapter two contains a review of different literature like books, journals, websites, etc. related to
temperature, temperature control is explained.
Block diagram of the system, system components and their operation have been introduced in
chapter three. This system components includes fan, heater, motor driver, relay, transistor,
Arduino platform, resistor, liquid crystal display, Lm 35D temperature sensor, and GSM module.
The fourth chapter consists the circuit diagram of the system and its description.
The fifth chapter explains Result and discussion of the project.
Finally the last chapter concludes what has been done and recommends certain remaining works
to be included by future workers in the related area.

4
CHAPTER TWO
THEORY AND LITERATURE REVIEW
2.1 Theory of Temperature
Temperature is the physical property of a system which underlies the common notions of "hot"
and "cold"; the material with the higher temperature is said to be hotter whereas the material with
the lower temperature is said to be cooler. Temperature is a measure of the average kinetic
energy of the particles in a sample of matter. In other words, temperature is a measure of activity
and the frequency of collisions of molecules. The formal properties of temperature are studied in
thermodynamics. Formally, temperature is that property which governs the transfer of thermal
energy, or heat, between one system and another. When two systems are at the same
temperature, they are in thermal equilibrium and no heat transfer will occur. When a temperature
difference does exist, heat will tend to move from the higher-temperature system to the lower
temperature system, until thermal equilibrium is established. This heat transfer may occur via
conduction, convection or radiation. Temperature is related to the amount of thermal energy or
heat in a system. As more heat is added the temperature rises, similarly a decrease in temperature
corresponds to a loss of heat from the system. On the microscopic scale this heat corresponds to
the random motion of atoms and molecules in the system. Thus, an increase in temperature
corresponds in an increase in the rate of movement of the atoms in the system.

2.1.1 How to control temperature


In brief, temperature controlled fan is an alternative way to deal with the speed of the motor.
Temperature control is a process in which the temperature of an object is measured and the
passage of heat energy into or out of the object is adjusted to achieve a desired temperature.
A thermostat is a simple example for a closed control loop. It constantly measures the current
temperature and controls the heater's valve setting to increase or decrease the room temperature
according to the user-defined setting. A simple method switches the heater or cooler either
completely on, or completely off, and an overshoot and undershoot of the controlled temperature
must be expected.
Fan is widely used in industrial and commercial applications. From shop ventilation to material
handling to boiler applications, fans are critical for process support and human health.

5
In commercial sector, electricity that is needed to operate fan motors composes a large portion of
energy costs for space conditioning. In home application, most of us use fan rather than air
conditioner because it is more economical.

2.2 Literature review


Based on the previous project, it was needed as the references to complete this project
Successfully. It was useful to upgrade and modified the system that has been demonstrate before.
Other than that, according to current developments, the latest technology used in this project to
solve the problems faced at present.
One of the system is about automatic fan speed control System using microcontroller that has a
Similarity with this project (Mustafa Saad 2014).The project uses a LM35 temperature sensor to
measure the temperature and Display it on the LCD. But in this project, they are used
PIC16F877A microcontrollers to apply in this function and differences with our Project that used
an Arduino UNO to control a speed of fan and to switch on/off the heater, Temperature sensor,
LCD display, motor driver, and GSM. This previous Project just controls the speed of fan by
current temperature and shows the speed of fan in RPM at LCD display [9].
The next project is automatic temperature controlled fan using thermistor (Sushm a Verma JULY
2016). The project is use a thermistor as sensor for read the current temperature. The concept is
read the temperature from PC to control the speed of fan respectively increases and decreases by
automatically [10]. That was not used any microcontroller to control the process.
Moreover, from the previous project room temperature based fan speed control system using
Pulse width modulation technique (Vaibhav Bhatia NOVEMBER 2013). This previous project
use the temperature sensor LM35 to detect the room temperature. The process to design also
used the Proteus 8.0. The difference with this project is that, they are used the MATLAB R2013a
v1.8 to authorize the accuracy of the structure and at this project used the Arduino UNO [4].

6
CHAPTER THREE
BLOCK DIAGRAM AND SYSTEM COMPONENT DESCRIPTION

3.1 Block Diagram Of the system

Temperature
Sensor LCD
(LM35) Display

Motor
Microcontroller Driver FAN
(Arduino uno) (L293D)

Power
Supply
5V
HEATER

GSM
Module

Figure3.1: Block Diagram Of The system

3.2 Block diagram description


The basic blocks of the System include the following blocks; Temperature Sensor, arduino μC,
LCD Display, motor driver, heater and Fan. The temperature Sensor detects the temperature of
the system. The temperature sensor consists of an LM35 IC. It has the measuring range of -55°C
to 150 °C. The temperature sensor is connected to an ADC of arduino μC. The LCD module is
also connected to the arduino microcontroller. The LCD module displays the current
temperature. The LCD display used is a 16x2 Alphanumeric Display. The microcontroller
generates PWM signal when the temperature is above the higher limit of the normal temperature
range. The PWM generated output control signals are sent to the Driver IC. Driver IC L293D is
fed with the PWM generated output. The speed of the fan is controlled by the on time of the
PWM generator. With increasing on time, the speed of the fan increases, thus controlling the

7
temperature of the system. The arduino generates digital signal to turn on the heater when the
temperature is below the lower limit of the normal temperature range.
3.3 SYSTEM COMPONENTS
3.3.1LM35
LM35 is a device which converts the physical signal into electrical signal. That’s why this is
known as the transducer. It is calibrated with the environmental temperature and it is linearly
varies with the temperature and its output is in volt. There is no need of external calibration to
provide the accuracy of the LM35 at room temperature which is about ±¼°C. Minimum
temperature that can be measured by the LM35 device is -55°C. And maximum temperature that
can be measured by LM35 is 150°C. Calibration of LM35 is done by trimming at the water level.
To make the interfacing of control circuitry and readout circuitry very easy, low impedance at
output side, output which is linear and precise inherent calibration of LM35 plays an important
role. Temperature sensor takes a very low current of order 60 μA from the input supply. Heat
loss in the LM35 is very less degree of around 0.1°C. LM35 can work in the range of -50°C to
+150° which is the rated value. Another device which is also a temperature sensor of the family
of LM35 known as LM35C which ranges from -40°C to +110°C. LM35 costs around 10 rupees
in India and is easily available in the market which anyone can buy at any convenience store or
electronics store.

Fig. 3.2: LM 35 Temperature Sensor [8]

8
3.3.2 Lm35d features:-
 Low cost
 Accuracy is about ±¼°C
 It can measure the temperature from -55°C to 150°C
 The current drawn from the supply is very less about 60 μA
 There is negligible heat in LM35
 Low impedance output; for a load of 1 mA about 0.1 ohm.
 Calibrated linearly with Celsius.
 Input voltage can vary from 4 volts to 30 volt
 It has an output voltage that is proportional to the Celsius temperature.
 The scale factor is .01V/ .
 The output voltage is converted to temperature by a simple conversion factor.
 The sensor has a sensitivity of 10mV / .
 Use a conversion factor that is the reciprocal that is 100o /V.
 The general equation used to convert output voltage to temperature is:
 Temperature ( ) = V out * (100 /V)
 So if V out is 1V , then, Temperature = 100
 The output voltage varies linearly with temperature

3.3.3Liquid crystal display (LCD)


LCD is a type of display used in digital watches and many portable computers. LCD displays
utilize to sheets of polarizing material with a liquid crystal solution between them. An electric
current passed through the liquid causes the crystals to align so that light cannot pass through
them. LCD technology has advanced very rapidly since its initial inception over a decade ago for
use in lap top computers. Technical achievements has resulted in brighter displace, higher
resolutions, reduce response times and cheaper manufacturing process. The liquid crystals can be
manipulated through an applied electric voltage so that light is allowed to pass or is blocked. By
carefully controlling where and what wavelength (color) of light is allowed to pass, the LCD
monitor is able to display images. A backlight provides LCD monitor’s brightness. Over the
years many improvements have been made to LCD to help enhance resolution, image, sharpness
and response times. One of the latest such advancement is applied to glass during acts as switch

9
allowing control of light at the pixel level, greatly improving LCD’s ability to display small-
sized fonts and image clearly. Other advances have allowed LCD’s to greatly reduce liquid
crystal cell response times. Response time is basically the amount of time it takes for a pixel to
“change colors”, in reality response time is the amount of time it takes a liquid crystal cell to go
from being active to inactive. This is due to the following reasons: The declining prices of LCDs.
The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are
limited to numbers and a few characters.
An intelligent LCD display of two lines, 20 characters per line that is interfaced to the
microcontroller. Incorporation of a refreshing controller in to the LCD, there by relieving the
CPU to keep displaying the data. Ease of programming for characters and graphics.
Most of the LCD modules conform to a standard interface specification. A 14-pin access is
provided having eight data lines, three control lines and three power lines. The connections are
laid out in one of the two common configurations, either two rows of seven pins, or a single row
of 14 pins. One of these pins is numbered on the LCD’s printed circuit board (PCB), but if not, it
is quite easy to locate pin1. Since this pin is connected to ground, it often has a thicker PCB
track, connected to it, and it is generally connected to metal work at same point.

Figure 3.3: Pin diagram of LCD [11]

3.3.3.1 Pin description of LCD


VDD, VSS and VEE: -While VDD and VSS provide +5V and ground respectively, VEE is used
for controlling LCD contrast.

10
RS (Register Select): -There are two very important registers inside the LCD. The RS pin is used
for their selection as follows. If RS=0, the instruction command code register is selected,
allowing the user to send a command such as clear display, cursor at home, etc. if RS=1, the data
register is selected, allowing the user to send data to be displayed on the LCD.
R/W, read/write: -R/W input allows the user to write information to the LCD or read information
from it.
R/W = 1 for reading.
R/W= 0 for writing.
EN, enable: -The LCD to latch information presented to its data pins uses the enable pin. When
data is supplied to data pins, a high–to-low pulse must be applied to this pin in order for the LCD
to latch in the data present at the data pins. This pulse must be a minimum of 450 ns wide.
D0 – D7: -The 8–bit data pins, DO – D7, are used to send information to the LCD or read the
contents of the LCD’s internal registers. To display letters and numbers, we send ASCII codes
for the letters A–Z, a-z numbers 0-9 to these pins while making RS=1.There are also instruction
command codes that can be sent to the LCD to clear the display or force the cursor to home
position or blink the instruction command codes. We also use RS = 0 to check the busy flag bit
to see if the LCD is ready to receive information.
The busy flag is D7 and can be read when R/W=1 and RS=0, as follows: if R/W = 1, RS = 0.
When D7= 1 (busy flag = 1), the LCD is busy taking care of internal operations and will not
accept any information [8].
3.3.4 Motor driver
Motor driver IC is used to control motors through a microcontroller. L293D IC is used as a
motor driver IC. It provides different logic to control the direction of the motor.
L293D is a typical motor driver or motor driver IC which allows dc motor to drive on either
direction. L293D is a 16-pin IC which can control a set of two dc motors simultaneously in any
direction. It means that you can control two dc motor with a single L293D IC. Dual H-bridge
motor driver integrated circuit(IC).It works on the concept of H-bridge. H-bridge is a circuit
which allows the voltage to be flown in either direction. As you know voltage need to change its
direction for being able to rotate the motor in clockwise or anticlockwise direction, hence h-
bridge IC are ideal for driving a dc motor. In a single L293D chip there are two h-bridge circuit
inside the IC which can rotate two dc motor independently. Due its size it is very much used in

11
robotic application for controlling DC motors. Given above is the pin diagram of a L293D motor
controller. There are two enable pins on l293D. Pin 1 and pin 9, for being able to drive the
motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to
enable pin 1 to high. And for right H-bridge you need to make the pin 9 to high. If anyone of the
either pin1 or pin9 goes low then the motor in the corresponding section will suspend working.
Simply connect the pin16 VCC (5v) to pin 1 and pin 9 to make them high [8].

3.3.4.1 L293D pin out


The L293D is a 16 pin IC, with eight pins, on each side, to controlling of two DC motor
simultaneously. There are 4 Input pins, 4 Output pins and 2 Enable pin for each motor.

Figure 3.4: L293D pin diagram [8]

3.3.4.2 Pin description of L293D IC

Pin 1: When Enable1/2 is high, Left part of IC will work, i.e motor connected with pin 3 and pin
6 will rotate.

Pin 2: Input 1, when this pin is high the current will flow though output 1.

Pin 3: Output 1, this pin is connected with one terminal of motor.

12
Pin 4/5: GND pins

Pin 6: Output 2, this pin is connected with one terminal of motor.

Pin 7: Input 2, when this pin is high the current will flow though output 2.

Pin 8: VSS, this pin is used to give power supply to connected motors from 5V to 36V maximum
depends on Motor connected.

Pin 9: When enable 3/4 is high, right part of IC will work, i.e motor connected with pin 11 and
pin 14 will rotate.

Pin 10: Input 4, when this pin is high the current will flow though output 4.

Pin 11: Output 4, this pin is connected with one terminal of motor.

Pin 12/13: GND pins

Pin 14: Output 3, this pin is connected with one terminal of motor.

Pin 15: Input 3, when this pin is high the current will flow though output 3.

Pin 16: VCC, for supply power to IC i.e 5V.

3.3.4.3 Function of L293D


Four input pins come from microcontroller and enable pins are high. Now the rotation of motor
depend on the input signal. If left side inputs 2, 7, both any one is low and other one is high
motor will run. Same conditions are applicable for right side input pins 10, 15.

3.3.4.4 Voltage Specification of L293D


VCC is the voltage that it needs for its own internal operation 5v; L293D will not use this
voltage for driving the motor. For driving the motors it has a separate provision to provide motor
supply VSS (V supply). L293d will use this to drive the motor. It means if you want to operate a
motor at 9V then you need to provide a supply of 9V across VSS motor supply. The maximum
voltage for VSS motor supply is 36V. It can supply a max current of 600mA per channel. Since

13
it can drive motors Up to 36v hence you can drive pretty big motors with this l293d.VCC pin 16
is the voltage for its own internal Operation. The maximum voltage ranges from 5v and up to
36v.

3.3.4.5 L293D Logic Table


Left side motor is connected to output pin 3 and 6 and it rotation is tabulated below according to
the input signal value of driver IC. High and low values are indicated by 1 or 0 respectively. This
table is also applicable for right side.
Table 3.1: L293D Logic Table [8]
Pin 2 Pin 7 Rotation of motor
1 0 Clockwise
0 1 Anticlockwise
0 0 No rotation
1 1 No rotation

3.3.5 Arduino UNO revision 3 board


Arduino is an open source electronics prototyping platform based on flexible hardware and
software. The Arduino is a simple yet sophisticated device which is based on Atmel’s AT mega
microcontrollers. There are various types of Arduino microcontroller board available in the
market including the Arduino kits and Arduino shields.
Arduino Uno is one of the microcontroller boards manufactured by the Arduino and it is a
microcontroller board based on Atmel’s AT mega 328P microcontroller. “Uno” means one in
Italian and the Uno board is the latest in a series of USB (Universal Serial Bus) Arduino boards
which is the reference model for the Arduino platform. The Arduino Uno board has a 16 MHz
ceramic resonator, a USB connection, a power jack, a reset button, 6 analog inputs and 14 digital
input/output pins (of which 6 can be used as PWM outputs).
The board has 32 KB flash memory of which 0.5 KB is used by boot-loader, 2 KB of SRAM, 1
KB of EEPROM and 16 MHz clock speed [1].

14
Figure 3.5: Ardiuno UNO board [1]

3.3.5.1 Arduino UNO revision 3 Specifications


 Microcontroller: ATmega328
 Operating Voltage: 5V
 Uno Board Recommended Input Voltage: 7 – 12 V
 Uno Board Input Voltage Limits: 6 – 20 V
 Digital I/O Pins: 14 total – 6 of which can be PWM
 Analog Input Pins: 6
 Maximum DC Current per I/O pin at 5V DC: 40mA
 Maximum DC Current per I/O pin at 3.3V DC: 50mA
 Flash Memory: 32KB (0.5KB used by boot loader)
 SRAM Memory: 2KB
 EEPROM: 1KB
 Clock Speed: 16 MHZ

15
3.3.6 Power supply
Five volts power supply with respect to ground is needed for the operation of the
microcontroller. Fig 4 shows the schematic of the power supply used by the microcontroller

TR1
BR1
U1
7805

1 3
VI VO Vout
C1 D
N
100u G
C2
2W005G 2 220u
230/12V, 50Hz v1=230v
v2=12v

Figure 3.6: Power Supply Schematic

The power supply consists of a step down transformer which is used to convert 230 V, 50 Hz AC
voltages to 12 V AC, 50 Hz. This 12 V AC voltage is given to the bridge rectifier, which
converts it into 12 V dc. A voltage regulator 7805 is used to convert the 12 V dc into 5 V dc
which is needed by the microcontroller. Capacitors are used for smoothening the output voltage.
This five volts dc thus produced is given to the microcontroller for its operation.

3.3.7 Light Emitting diode


Light emitting diodes (LEDs) are the most widely used semiconductor diodes among all the
different types of semiconductor diodes available today. Light emitting diodes emit either visible
light or invisible infrared light when forward biased. The LEDs which emit invisible infrared
light are used for remote controls. A light emitting diode (LED) is an optical semiconductor
device that emits light when voltage is applied. In other words, LED is an optical semiconductor
device that converts electrical energy into light energy. When light emitting diode (LED) is
forward biased, free electrons in the conduction band recombines with the holes in the valence
band and releases energy in the form of light. We use this led to show temperature status. Green
16
led turns on when the temperature is greater than or equal to 10 and less than 30 , Yellow led
turns on when the temperature is greater than or equal to 30 and less than 40 , Red led turns
on for greater than or equal to 40 .

Figure 3.7: Led symbol [11]

3.3.8 Potentiometer
A potentiometer is a three-terminal resistor with a sliding or rotating contact that forms an
adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a
variable resistor or rheostat. The measuring instrument called a potentiometer is essentially a
voltage divider used for measuring electric potential (voltage).here we use this component as
rheostat to a component value of 1K ohm.

3.3.9 Transistor
A transistor is a negative-positive-negative (NPN) junction semiconductor device that is used for
many purposes. Together with other electronic components, such as resistors, coils, and
capacitors, it can be used as the active component for switches and amplifiers. Like all other
NPN transistors, this type has an emitter terminal, a base or control terminal, and a collector
terminal. In a typical configuration, the current flowing from the base to the emitter controls the
collector current. A short vertical line, which is the base, can indicate the transistor schematic for
an NPN transistor, and the emitter, which is a diagonal line connecting to the base, is an
arrowhead pointing away from the base.

17
Figure 3.8: transistor symbol and pins [3]

3.3.10 Relay
A relay is an electromagnetic operated switch. Current flowing through the coil of the relay
creates a magnetic field, which attracts a lever and changes the switch contacts. The coil current
can be ON or OFF so relays have two switch positions and they are double throw switches.
It uses to control the heater by making it turn on and off. That is when there is high output signal
from the transistor, the relay will be closed and makes the heater ON. When the temperature is
above the lower limit of the normal temperature range of the room, the relay gets no signal and
the heater is turned OFF. The relay’s switch connections are usually labeled COM, NC and NO.

Figure 3.9: 12v Relay [6]

3.3.11 Resistors
A resistor is a linear component that implements electrical resistance as a circuit element. It is
used to bias the switching transistor that energizes the relay. It also used to limit the amount of
current flowing. The current through a resistor is in direct proportion to the voltage across the

18
resistor's terminals. Thus, the ratio of the voltage applied across a resistor's terminals to the
intensity of current through the resistor is called resistance.

Figure 3.10: resistor [3]


3.3.12 DC Fans
Brushless dc fans tend to be the solution of choice for most electronic enclosures. These fans
couple high reliability with ease of use. The basic dc brushless fan is a 2-wire device over which
a dc voltage is applied. That is all it takes. The simplest approach to system cooling is to connect
a fan to a dc power supply and let it run. A quick glance at fan catalogs reveals that fans
operating at a nominal 5V, 12V, 24V, or 48V are available. Currently, 12V fans seem to be the
most widely used. Brushless DC fans are called "brushless" because the electric motor within the
fan is commutated electronically. A 12V dc fan was used to demonstrate the output of the control
system. After it receiving input signal from the Arduino microcontroller, it give the output to the
cooling fan. The fan start automatically at rise in temperature greater than the maximum room
temperature range but for showing the software implementation we use 850 rpm rated fan dc
motor.

Figure 3.11: 12v dc fan [jiuzhao.en.alibaba.com]

19
3.3.12.1 12V DC Fan Specification
Type: Axial Flow Fan
Electric Current Type: DC
Blade Material: Plastic
Model Number: DC7025L12
Voltage: 12V
Current: 0.14A
Power: 1.68W
Speed: 2500RPM
Noise Level: 28dB
Weight: 52g

3.3.13 Electric Heater


A heater is a piece of equipment or a machine which is used to raise the temperature of
something, especially of the air inside a room. Electric heaters have been around for decades as a
source of heat in homes to provide warmth to us. One of the reason for their popularity is
because of lower cost to purchase and easy maintenance compared to other sources of heat. They
are usually powered by electricity though a small percentage are still using propane or kerosene
as fuel.

They work by converting electricity into heat using metals as heating elements. The metals have
high resistance that permit a certain amount of current to flow though to provide the required
heat. Electrical energy is changed into heat energy. But for software implementation we use lamp
as a heater.

Figure 3.12: sample of heater [7]

20
3.3.14 GSM Module
A GSM modem is a device which can be either a mobile phone or a modem device which can be
used to make a computer or any other processor communicate over a network. A GSM modem
requires a SIM card to be operated and operates over a network range subscribed by the network
operator. It can be connected to a computer through serial, USB or Bluetooth connection.
A GSM modem can also be a standard GSM mobile phone with the appropriate cable and
software driver to connect to a serial port or USB port on your computer. GSM modem is usually
preferable to a GSM mobile phone. The GSM modem has wide range of applications in
transaction terminals, supply chain management, security applications and weather.
It has a communication that can be programmed using AT commands. The signal names for the
GSM modem communication port include the following; audio input and output pins (for
connecting external hands free audio devices), mute control pin, flash programming signal pins,
external power pins, and receiver and transmitter pins.
Here the RX and TX pins are used for the serial communication with the microcontroller. There
are various AT commands to check the signal strength and connection and SIM status etc. Here
the Hyper Terminal is used to initially interface with the computer to check the module. It also
has an antenna to receive the GSM signal from the user’s phone. The basic AT commands are
loaded into the program of microcontroller for it to interface with the GSM module. The figure
given below shows a GSM module.

Figure 3.13: GSM Module [5]

21
3.3.14.1 Connecting GSM module to arduino
There are two ways of connecting GSM module to arduino. In any case, the communication
between Arduino and GSM module is serial. So we are supposed to use serial pins of Arduino
(Rx and TX). So if you are going with this method, you may connect the TX pin of GSM module
to Rx pin of Arduino and Rx pin of GSM module to TX pin of Arduino. You read it right. GSM
TX to Arduino Rx and GSM Rx to Arduino TX. Now connect the ground pin of arduino to
ground pin of GSM module. We made 3 connections and the wiring is over. Now you can load
different programs to communicate with GSM module and make it work. The problem with this
connection is that, while programming Arduino uses serial ports to load program from the
Arduino RX and TX If these pins are used in wiring, the program will not be loaded Successfully
to Arduino. So you have to disconnect wiring in Rx and TX each time you burn the program to
arduino. Once the program is loaded successfully, you can reconnect these pins and have the
system working. To avoid this difficulty, we can use an alternate method in which two digital
pins of arduino are used for serial communication. We need to select two PWM enabled pins of
arduino for this method. So we choose pins 9 and 10 (which are PWM enabled pins). This
method is made possible with the Software Serial library of Ardunio. Software Serial is a library
of Arduino which enables serial data communication through other digital pins of Arduino. To
avoid this difficulty, we can use an alternate method in which two digital pins of arduino are
used for serial communication. We need to select two PWM enabled pins of arduino for this
method. So we choose pins 9 and 10 (which are PWM enabled pins). To avoid this difficulty, we
can use an alternate method in which two digital pins of arduino are used for serial
communication. We need to select two PWM enabled pins of arduino for this method. So we
choose pins 9 and 10 (which are PWM enabled pins). To avoid this difficulty, we can use an
alternate method in which two digital pins of arduino are used for serial communication. We
need to select two PWM enabled pins of arduino for this method. So we choose
pins 9 and 10 (which are PWM enabled pins). The library replicates hardware functions and
handles the task of serial communication. The library replicates hardware functions and handles
the task of serial communication. To avoid this difficulty, we can use an alternate method in
which two digital pins of arduino are used for serial communication. We need to select
two PWM enabled pins of arduino for this method. So we choose pins 9 and 10 . The library

22
replicates hardware functions and handles the task of serial communication.

+5V +12v

+ Power
Usb jack jack

GND
~10 Rx

~9 Tx GSM
Ardiuno Module
UNO

o o GND

Figure 3.14: circuit diagram to connect GSM module to Arduino [5].

23
CHAPTER FOUR
CIRCUIT DIAGRAM AND ITS DESCRIPTION

4.1 Circuit diagram

LCD1
LM016L
VDD
VSS

VEE

RW
RS

D0
D1
D2
D3
D4
D5
D6
D7
E

ARD1
1
2
3

4
5
6

7
8
9
10
11
12
13
14

D3 D2
U1(VS) D1 LED-YELLOW LED-RED
LED-GREEN
ON
Reset BTN

www.TheEngineeringProjects.com
AREF 16 8 U1
13
PB5/SCK
12 2 3
PB4/MISO IN1 VSS VS OUT1
RESET 11 7 6
IN2 OUT2
~ PB3/MOSI/OC2A
10 1
EN1
U2(+VS) ~ PB2/OC1B
9
~ PB1/OC1A
8
1 U2 PB0/ICP1/CLKO 9
EN2
ATMEGA328P-PU

10 11
1121

7 IN3 OUT3
ANALOG IN

PD7/AIN1
6 15 14
IN4 GND GND OUT4
A0 ~ PD7/AIN1
5
38.0 PC0/ADC0
A1 ~ PD5/T1/OC0B
4
PC1/ADC1
A2 PD4/T0/XCK
3 L293D
PC2/ADC2
2 A3 ~ PD3/INT1/OC2B
2
VOUT PC3/ADC3 PD2/INT0
A4 1
PC4/ADC4/SDA PD1/TXD
A5 0
PC5/ADC5/SCL PD0/RXD
RXD
3 LM35
ARDUINO UNO TXD

RTS
RV1
CTS

L1(1)

1k
L1
12V

+12v

R1 Q1
NPN RL1
10k 12V

Figure 4.1: Circuit diagram of the project

4.2 Circuit diagram description


The circuit maintains the temperature of the system in a particular range. Both heater and fan is
used for controlling the temperature of the system. The fan RPM increases with increase in
temperature and vice versa. The current temperature within the room is measured by using a
temperature sensor. When the current temperature is below the lower limit of the desired range,
the heater on. When the current temperature is above the lower limit of the desired range, the
system must be cooled by using a fan. When the current temperature is within or successfully

24
turned back to the required range, no control action is needed. The current temperature of the
room must be continuously displayed on the LCD .This makes user is easily to know current
temperature of the system. The Temperature Sensor detects the temperature of the system .the
temperature Sensor consists of an LM35 IC. The temperature sensor is connected to the analog
input of the arduino μC. It converts the analog input to a digital value. The arduino generates
PWM according to the temperature sensor value. The PWM generated Output control signals are
sent to the Motor Driver IC L293D. Motor Driver IC L293D is fed with the PWM generated
output from arduino. By using the L293D, two dc Motors can be connected. The speed of the fan
is controlled by the ON time of the PWM generated by the controller. With increasing ON time,
the speed of the fan increases reducing the temperature of the system. And also the arduino
generates digital signal and feds to the heater. The LCD module is also connected to the arduino
microcontroller. The LCD module displays the current temperature
4.3 Flowchart
start

Read
Temperatur NO
e

Is NO
Temp<=10

NO YES YES
Is Is Is Fan
Temp<=35 Temp<=30 Temp>=27 Off
Heater
off

NO YES
NO
Is Fan speed slow Fan
Temp<=40 Heater Off
YES NO OFF Heater
YES on

Fan speed Fan speed Fan


Fan speed fast
medium very fast Off
Heater
Heater Heater Heater
off
off off off

end

Figure 4.2: Flowchart

25
4.3.1 Flowchart Description
The logical representation of the software code has been presented in the flowchart form. Fig
shows the flowchart of the logic implemented in the modeled system. The temperature is read
from the temperature sensor and the condition is checked and the following processes are done:
1. When temperature is greater than 27 and less than 30degree Celsius, the fan speed is slow and
heater is off.
2. When temperature is greater than 30 and less than 35 degree Celsius, the fan speed is medium
and heater is off.
3. When temperature is greater than 35 and less than 40 degree Celsius, the fan speed is fast and
heater is off.
4. When temperature is greater than 45 degree Celsius, the fan speed is very fast and heater is
off.
5. When temperature is less than 27 and greater than10 degree Celsius, both fan and heater are
off.
6. When temperature is less than 10 degree Celsius, the fan is off and heater is on.

4.4 Algorithms
1. Initialize analog temp pin, heater input pin, LCD and Motor Driver IC Input.
2. Clear LCD.
3. Display set temperature range on LCD.
4. Read Analog Voltage Value from Temperature Sensor on A5 of arduino pin.
5. Temperature = Voltage *100
6. Now compare the value of T with range of temperatures and set the fan Speed according to
that
a) If T <=10
Fan off
Green led off
Yellow led off
Red led off
Heater on
b) If T >= 10 and T <=27
Fan off
26
Green led on
Yellow led off
Red led off
Heater off
c) If T >= 27 and T <=30
Fan Speed = 25%
Green led on
Yellow led off
Red led off
Heater off
d) If T >30 and T <=35
Fan Speed = 50%
Green led off
Yellow led on
Red led off
Heater off
e) If T>35 and T <=40
Fan Speed = 75%
Green led off
Yellow led on
Red led off
Heater off
f) If T >40
Green led off
Yellow led off
Red led on
Fan Speed = 100%
Heater off
7. End

27
4.5 programs
#include <LiquidCrystal.h>
#include<SoftwareSerial.h>
float temp;
#define tempPin A5
#define m11 11
#define m12 10
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
void setup()
{
pinMode(A5,INPUT);
pinMode(m11,OUTPUT);
pinMode(m12,OUTPUT);
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
pinMode(9,OUTPUT);
pinMode(8,OUTPUT);

lcd.begin(16, 2);
Serial.begin(9600);
}
void loop()
{
lcd.print("TEMPER. IN ^C ");
lcd.setCursor(0,1);
temp = analogRead(A5);
float mv = (temp/1024.0)*5;
float C = mv*100;
lcd.print("==> ");
lcd.print(C);
lcd.setCursor(10,1);

28
lcd.print(" ");
Serial.println("Temprature in ^C:");
Serial.print(C);
Serial.print(" ^C");

if (C<10)
{
analogWrite(m11,0);
analogWrite(m12,0);
digitalWrite(12,0);
digitalWrite(13,0);
digitalWrite(9,0);
digitalWrite(8,HIGH); //Heater ON
Serial.println("AT+CMGF=1");// to send sms in text mode
delay(20);
Serial.println("AT+CMGS=\"+251925992313\"\r");// change to the phone number that we use
delay(20);
Serial.println("FAN is OFF and Heater is ON:");
delay(20);

}
if (C>=10&&C<27)
{
analogWrite(m11,0);
analogWrite(m12,0);//Fan OFF
digitalWrite(13,0);//Yellow led off
digitalWrite(9,0);//red led off
digitalWrite(8,LOW); //Heater OFF
digitalWrite(12,HIGH); // green led on
Serial.println("AT+CMGF=1");// to send sms in text mode

29
delay(20);
Serial.println("AT+CMGS=\"+251925992313\"\r");// change to the phone number that we use
delay(20);
Serial.println("Normal Temprature both FAN and Heater OFF:");
Serial.println("wawww it is Good weather:");
delay(20);

}
if(C>=27&&C<30)
{
digitalWrite(12,HIGH); // green led on
digitalWrite(13,LOW); // yellow led off
digitalWrite(9,LOW); //red led off
digitalWrite(8,LOW); //Heater OFF
analogWrite(m11,64);//fan ON
analogWrite(m12,0);
Serial.println("AT+CMGF=1");// to send sms in text mode
delay(20);
Serial.println("AT+CMGS=\"+251925992313\"\r");// change to the phone number that we use
delay(20);
Serial.println("Temprature somewhat Hot:");
Serial.println("Heater OFF And FAN runs at slow RPM:25%:");
delay(20);

if(C>=30&&C<35)
{
digitalWrite(12,LOW);
digitalWrite(13,HIGH);
digitalWrite(9,LOW);

30
analogWrite(m11,127);
analogWrite(m12,0);
digitalWrite(8,LOW); //Heater OFF
Serial.println("AT+CMGF=1");// to send sms in text mode
delay(20);
Serial.println("AT+CMGS=\"+251925992313\"\r");// change to the phone number that we use
delay(20);
Serial.println("My Room Temprature is HOT:");
Serial.println("Heater OFF And FAN runs at medium RPM :50%:");
delay(20);

}
if(C>=35&&C<40)
{
digitalWrite(12,LOW);
digitalWrite(13,HIGH);
digitalWrite(9,LOW);
analogWrite(m11,191);
analogWrite(m12,0);
digitalWrite(8,LOW); //Heater OFF
Serial.println("AT+CMGF=1");// to send sms in text mode
delay(20);
Serial.println("AT+CMGS=\"+251925992313\"\r");// change to the phone number that we use
delay(20);
Serial.println("My Room Temprature is Too Hot:");
Serial.println("Heater OFF And FAN runs at fast RPM :75%:");
delay(20);

}
if(C>=40)
{

31
digitalWrite(12,LOW);
digitalWrite(13,LOW);
digitalWrite(9,HIGH);
analogWrite(m11,255);
analogWrite(m12,0);
digitalWrite(8,LOW); //Heater OFF
Serial.println("AT+CMGF=1");// to send sms in text mode
delay(20);
Serial.println("AT+CMGS=\"+251925992313\"\r");// change to the phone number that we use
delay(20);
Serial.println("My Room Temprature reaches maximum:");
Serial.println("Heater OFF And FAN runs at very fast RPM :100%:");
delay(20);

Serial.println();

//delay(30);

32
CHAPTER FIVE
RESULTS AND DISCUSSIONS
The speed of the fan has been controlled using PWM technique when the temperature is above
the higher limit of the normal room temperature.The simulation of the system has been done on
Proteus ISIS7 Professional software packages and it is running in good agreement .The logic
used in the system is verified and shown in the flowchart form. The duty cycle is varied
according to room temperature and speed of the fan is controlled accordingly and heater is on
when the temperature is below the lower limit of the normal range of room temperature.
Accordingly to our project the fan is driven by DC motor. After we simulate we gained the
following results in three conditions. Those condition are stated as follows:
Condition 1: When the temperature is less than 10ºC. In this case microcontroller generates
digital signal to heater. This implies that the temperature is below the lower limit of the normal
room temperature range. Due to this all Led and motor is off accordingly and the heater is on.

Figure 5.1: Circuit diagram Condition 1

33
Condition 2: When the temperature is greater than10ºC and less than 27ºC. In this condition the
microcontroller does not generate any signal to the yellow led, red led, fan and to heater but it
feds digital signal to green led and it becomes on . This implies that the room is at normal
temperature.

Figure 5.2: Circuit diagram Condition 2

Condition 3: when temperature is in between 27ºCand30ºC.


In this condition the microcontroller generates 25% PWM to the motor and digital signal to
green led only. As temperature increases the motor speed also increase to minimum rated speed.
Duty cycle=25% at temperature in between 27ºCand30ºC
From the simulation result the rated speed at 25% is 212.5 rpm.

34
Figure 5.3: Circuit diagram Condition 3

Condition 4: when temperature is in between 30ºC and 35ºC.


In this condition the microcontroller generates 50% PWM to the motor and digital signal to
yellow led only. As temperature increases the motor speed also increase to its medium rated
speed.
Duty cycle=50% at temperature in between 30ºCand35ºC
From the simulation result the rated speed at 50% is 425 rpm.

35
Figure 5.4: Circuit diagram Condition 4

Condition 5: when temperature is in between 35C and 40ºC.


In this condition the microcontroller generates 75% PWM to the motor and digital signal to
yellow led only. As temperature increases the motor speed also increase to its medium rated
speed.
Duty cycle=75% at temperature in between 35ºCand40ºC
From the simulation result the rated speed at 75% is 637.5 rpm.

36
Figure 5.5: circuit diagram Condition 5

Condition 6: when temperature is greater than 40ºC.


In this condition the microcontroller generates 75% PWM to the motor and digital signal to red
led only. As temperature increases the motor speed also increase its speed very fast.
Duty cycle=100% at temperature greater than 40ºC.
From the simulation result the rated speed at 100% is 850rpm.

37
Figure 5.6: Circuit diagram Condition 6

38
CHAPTER SIX
CONCLUSION AND FUTURE WORK
6.1 Conclusion
Generally in this project the temperature of a system is controlled automatically using ardiuno
microcontroller. The LM35DZ temperature sensor senses the temperature of a given room and
feed it to the arduino microcontroller which then decodes it and compared it to a predetermined
temperature value stored in it. The microcontroller in turn automatically switches on/off a heater
or a fan based on the result of the comparison. If the temperature is above the predetermined
value the fan runs at different speed based on change in environment temperature. This design is
considered on a predetermined temperature value of 10ºC as minimum and 27ºC as the
maximum. The system was tested and the result show that the switching occurs at temperature of
below 10ºC and above 27ºC .This system helps to maintain the temperature within a limit. This
system is very marketable because of its simplicity, low cost and small size. It can be used in
various industrial applications such as to control the temperature in living room, Computers
room, chemical reaction room, furnace room and Laboratories.
6.2 Future modifications & Recommendations
The goals of this project were purposely kept within what was believed to be attainable within
the allotted timeline. As such, many improvements can be made upon this initial design the
recommendation provided as idea for future expansion of this project is:
 Changeable temperature limits can be applied by adding a matrix keypad

39
Reference
[1]. Arduino Uno, https://www.arduino.cc/en/Main/ArduinoBoardUno
[2]. Measuring Room temperature using LM 35 Temperature Sensor with Arduino by
Microcontroller Projects.
[3]. Automation https://en.wikipedia.org/wiki/Automation.
[4]. Vaibhav Bhatia “room temperature based fan speed control system using pulse width
modulation technique”, NOVEMBER 2013.
[5]. http://www.circuitstoday.com/interface-gsm-module-with-arduino.
[6]. Temperature Controlled Relay with Arduino – Tutorial #6 by electroschematics.com.
[7]. /Electric heating - Wikipedia.htm.
[8]. Ghana Shyam Soren and Ram Ashish Gupta “Temperature Controlled DC Fan usin
Microcontroller”.
[9]. Mustafa Saad “automatic fan speed control system using microcontroller”, 2014.
[10]. Sushma Verma “automatic temperature controlled fan using thermistor”, JULY 2016.
[11]. J.P Introduction to Sensors, LCD and LED. http://wwwfars.nhtsa.dot.gov/Main/index.aspx.

40
41
42

You might also like