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

Wollo University

Kombolcha Institute of Technology


Department of Electrical and Computer Engineering
Industrial Control Stream

TITLE: AUTOMATIC TEMPERATURE MEASUREMENT AND CONTROL


SYSTEM FOR SERVER ROOM.

Submitted by:-

Name IDNO.
1. Medina Ahmed……………………………………………………………WOUR/1066/08
2. Marye Tikuye………………………………………….………………….WOUR/1045/08
3. Gergs Tesfamical……………………………………………….…………WOUR/0725/08
4. Elias Cheklie…………………………………….………………………...WOUR/0561/08
Advisor: Zewde Tolossa

WOLLO

JUNE, 2019
DECLARATION AND COPYRIGHT

We, declare that this project work is our own original work and that it has not been presented
and will not be presented by one of us in-group to any other university for similar or any
other degree award.

Name Signature Date


1. Medina Ahmed
2. Marye Tikuye
3. Gergs Tesfamical
4. Elias Cheklie

Approved by
Name Signature Date

1.
2.
3.
4.

i
ACKNOWLEDGMENT

We have great pleasure to convey our gratitude to DEPARTMENT OF ELECTRICAL AND


COMPUTER ENGINEERING for permitting us to do this semester project. Last but not the
least our special thanks to our friends and our adviser for their support and constant
Encouragement during the project work.

ii
Abstract

Temperature control is a process to maintain the temperature at certain level. This process is
commonly used in all area of the world. Recently in globalization era, this process become
important element because there are many applications in daily life involves this process
especially server room and green house. Server room works continuously in 24 hours every
day. During the process, server room needs to be monitored frequently in order to ensure its
functional and efficiency especially on temperature. It is important to study the level of
temperature recommended in server room. This matter must be considered to make sure no
disturbance occur in server room due to unstable temperature. Automatic temperature control
referred as the best method in any application by controlling the temperature automatically.
This method shows significant improvement in temperature control as the process is
functioning without needed support from the human to control all the process. In addition,
this finding makes human works become easy and system that automatically controlled and
function would be developed.

Keywords:

PIC 18F45K22

Microcontroller

LED

LCD

Relay LM35 temperature sensor and Transistor (2N22)

iii
Table of

Contents
DECLARATION AND COPYRIGHT .......................................................................................................... i
ACKNOWLEDGMENT............................................................................................................................... ii
Abstract ........................................................................................................................................................ iii
CHAPTER 1 ................................................................................................................................................. 1
INTRODUCTION ........................................................................................................................................ 1
1.1. Background ................................................................................................................................... 1
1.2. Statement of problem .................................................................................................................... 1
1.3. Objective ....................................................................................................................................... 1
1.3.1. General objective .................................................................................................................. 1
1.3.2. Specific objectives ................................................................................................................. 1
1.4. Significance of the study ............................................................................................................... 2
1.5. Scope and limitation of the study ................................................................................................. 2
1.5.1. Project Scopes ....................................................................................................................... 2
1.5.2. Limitations of the study ........................................................................................................ 2
1.6. Application area of our project can be applicable for: ................................................................. 2
1.6.1. Project Outline ...................................................................................................................... 3
LITERATURE REVIEW ..................................................................................................................................... 4
2.1. Server Room Overview ................................................................................................................. 4
2.2. Temperature Control System ........................................................................................................ 4
2.3. Relays 5v:...................................................................................................................................... 4
2.4. RESISTORS ..................................................................................................................................... 5
2.5. Transformer .................................................................................................................................. 5
2.6. Rectifier......................................................................................................................................... 6
2.7. CAPACITORS (SMOOTHING) .................................................................................................. 7
2.8. Voltage regulator .......................................................................................................................... 8
2.9. Transistors: .................................................................................................................................... 8
METHODOLOGY AND SYSTEM DESIGN ........................................................................................... 10
3.1. METHODOLOGY ..................................................................................................................... 10
3.2. SYSTEM DESIGN ..................................................................................................................... 10
3.2.1. Circuit diagram developed .................................................................................................. 11
3.2.2. Description of the Circuit .................................................................................................... 11

iv
3.2.3. Working principle of the system ......................................................................................... 12
3.3. General Block diagram .............................................................................................................. 12
3.4. Sestem flow chart ....................................................................................................................... 14
3.5. HARDWARE ............................................................................................................................. 14
3.5.1. Power Supply ...................................................................................................................... 14
3.5.2. Microcontroller ................................................................................................................... 16
3.5.3. Temperature sensor LM35 .................................................................................................. 18
3.5.4. LCD Display ....................................................................................................................... 19
3.5.5. DC Fan motor ..................................................................................................................... 22
CHAPTER 4 ............................................................................................................................................... 23
RESULTS AND DISCUSSION ................................................................................................................. 23
4.1. Software Simulation Results and Discussion .............................................................................. 23
CHAPTER 5 ............................................................................................................................................... 29
CONCLUSION AND RECOMMENDATIONS ........................................................................................ 29
5.1. Conclusion .................................................................................................................................. 29
5.2. Recommendations ....................................................................................................................... 29
REFERENCES ........................................................................................................................................... 30
APPENDIX ................................................................................................................................................. 30

v
List of figure
Figure2.1Relay .............................................................................................................................................. 5
Figur 2.2 Transformer ................................................................................................................................... 6
Figure 2.3 Full Wave Rectifier (Bridge Rectifier) and Wave Form ............................................................ 7
Figure 2. 4 Capacitor charging and discharging ........................................................................................... 7
Figure2.5 Simple circuit showing the labels of a Bi-polar Transistor .......................................................... 8
Figure 2. 6 An NPN Transistor acting as static a switch .............................................................................. 9
Figure 3.1General circuit diagram of the system ........................................................................................ 11
Figure3.2General block diagram of the system .......................................................................................... 12
Figure3.3 system flow chart ........................................................................................................................ 14
Figure 3.4circuit diagram of power supply module .................................................................................... 16
Figure 3.5PIC Microcontroller.................................................................................................................... 17
Figure 3.6pin diagram of PIC18F45K22IC Microcontroller. [7] ............................................................... 18
Figure 3.7Diagram of LCD ......................................................................................................................... 20
Figure 4.1 heater ON................................................................................................................................... 23
Figure 4.2 Heater Fan and LED OFF .......................................................................................................... 24
Figure 4.3 Fan ON ...................................................................................................................................... 25
Figure 4.4 LED ON..................................................................................................................................... 26

List of table
Table 1 LCD pin connection description [4] .............................................................................................. 21

vi
LIST OF ACRONYMS
Ac: alternate current

C: capacitor

DC: direct current

EMF: electromagnetic filed

F: frequency

IC: integrated circuit

ICSP: in circuit serial programming

ICU: intensive care unit

IDE: integrated development environment

I/O: input out put

KBPS: kilobyte per second

LCD: liquid crystal display

LED: light emitting diode

PC: personnel computer

SPI: serial peripheral interface

TTL: transistor transistor logic

vii
CHAPTER 1

INTRODUCTION

1.1. Background

Nowadays, in globalization era there are always the invention of the new technologies features
every year. Automatic temperature control system become the most popular features which
rapidly gaining its popularity due to its importance to certain applications. This system utilizes in
a room that lack of air conditioning system such as in server room and green house. The system
is designed that is supposed to monitor the temperature inside a server room. In server room, the
temperature is always high and unstable and human will not able to control the temperature
manually. The automatic system required to control the temperature within the server room is
measured by using a temperature sensor, the server room is cooled using a fan and heated using
heater. When the current temperature is within the desired range, no control action is needed. In
addition the controller should use LEDs to indicate the fault if the temperature in the server room
is higher than the desired range. [5]

1.2. Statement of problem

Previously, the control mechanism of temperature in the server room is manual operated. In this
operation, however it can be maintained at some extent, it is difficult to withstand the
temperature variation as soon as it happened. In that case electronic devices such as computers
found in that room will be damaged with temperature variation. Therefore, we are intended to
solve such problem and keeping a uniform temperature range for the server room in automatic
system.

1.3. Objective

1.3.1. General objective

The main objective of our project is to design an automated temperature control system for the
server room.

1.3.2. Specific objectives

To study how to control temperature

1
To configure or fault announcement for the concerned person

To control temperature of server room within a desired range

1.4. Significance of the study


This project is about automatic temperature controller using pic microcontroller. Automatic
temperature control is a microcontroller based circuit which is used to maintain a temperature
specified by the user. This is to ensure the cooling and warming process operates more
efficiently and effectively, especially for a large space Application. By applying this project, it
offers a better life for humanity to make their life simpler. The circuit is also suitable for disabled
people who have difficulty to switch on the fan and heater manually. The advantages of such a
system are less energy usage, and provides more convenient to the consumers.

1.5. Scope and limitation of the study

1.5.1. Project Scopes

There are two scopes in this project:

1. Temperature sensor monitoring the recent value of temperature within the range

2. Fan functioning at certain level of temperature

3. Heater functioning when the room too cool

1.5.2. Limitations of the study

Recently, automatic temperature control system is rapidly gaining in popularity. This system is
designed which is supposed to keep the temperature inside a server room within the required
range.

Some of the problems identified in the present system include:

a. The processing speed of data is slow and prone to errors.

b. There are no guarantee that the information sent via SMS will get to its destination on time

1.6. Application area of our project can be applicable for:

Server room, Research lab and Green house

2
1.6.1. Project Outline
This project contains 5 chapters. Chapter 1 explains the introduction that includes concept of
temperature control system. Chapter 2 describes the literature review from recent issue and gives
review about the past project. Chapter 3 provides description of block diagrams and discussion
on the components we use in software systems. These are microcontroller, sensor, LCD displays,
and driver circuit and output devices. This chapter also includes the flowchart of the system and
methodologies. Chapter 4 explains the development of the software and system operation.
Chapter 5 summarizes the overall conclusion for this project and a few future recommendations.

3
CHAPTER TWO

LITERATURE REVIEW

2.1. Server Room Overview

A server room is a room that houses mainly computer servers. The term is generally used for
smaller arrangements of servers. Larger groups of servers are housed in data centers.
Environmental monitoring is essential in the server rooms and data centers. Environmental
conditions have a huge impact on how reliable and long lived the servers, switches and routers
will be. Bad environmental conditions can reduce the life of components, decrease reliability,
and cause us untold problems and expense. Computer equipment ages faster when it gets hot. In
fact equipment manufacturers use this property to help eliminate faulty components batches are
’baked’ to test for failing units. The idea is that if a component survives this process then it
stands a good chance of being reliable in service. In general computers operate more reliably and
have a longer life in cooler conditions. The effects of prolonged running at high temperatures can
be unpredictable and are not always characterized by catastrophic failures. Computer and
networking equipment is designed to operate within a fairly narrow temperature range. To ensure
reliable operation and the longest possible life from components we need to ensure that the
temperature stays within that band. Purpose built server rooms are well insulated for fire
precaution reasons and air conditioning is essential. General recommendations suggest that
temperature range in server room should not go below 10°C or above 28°C. [3]

2.2. Temperature Control System

This project use PIC18F45K22 microcontroller and NPN power transistor (2N2222) further
drive fans, heater and LEDs as well as temperature is detected by temperature sensor that placed
at a server room. The actual temperature is displayed on the LCD screen. This project uses LM35
temperature sensors that can be measured environmental temperature value.

2.3. Relays 5v:

Relay is an electromagnetic device used to switch on and off devices which used high voltages.
In our project relay is used to switch on and off the heater.

4
\

Figure2.1Relay

In above figure 1 and 2 shows contacts which are open while 3 and 4 shows coil. When coil
become energized it become closed and change its state.

2.4. RESISTORS

A resistor is a two terminal electronic component which produces a voltage across its terminals
that is proportional to the electric current through it in accordance with Ohm’s law:

𝑽 = 𝑰𝑹

Resistors are elements of electrical network and electronic circuits and are ubiquitous in most
electronic equipment. Practical resistors can be made with various compounds and films as well
as resistance wires (wire made of high resistivity alloy, such as nickel-chrome).

The primary characteristics of a resistor are the resistance, the tolerance, the maximum working
voltage and the power rating. The ohm (symbol: Ω) is the SI unit of electrical resistance, named
after George Smith Ohm.

2.5. Transformer

The transformer is a device used for reducing or increasing the voltage of an electric power
supply, usually to apply a particular piece of equipment to be used. Transformers work only with
AC and this is one of the reasons why mains electricity is AC. Step-up transformer increase
voltage, step-down transformers reduce voltage. Most power supplies use step-down
transformers to reduce the dangerously high mains voltage (220V in Nigeria) to a safer low

5
voltage. The input coil is called the primary and the output coil is called the secondary. There is
no electrical connection between the two coils; instead they are linked by an alternating magnetic
field created in the soft-iron core of the transformer. The two lines in the middle of the circuit
symbol represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down current is stepped up. The ratio of the
number of turns on each coil, called the turn ratio determines the ratio of the voltages. A step-
down transformer has a large number of turns on its primary (input) coil which is connected to
the high voltage mains supply, and a small number of turns on its secondary (output) coil to give
a low output voltage.

Figur 2.2 Transformer

2.6. Rectifier

There are several ways of connecting diodes to make a rectifier (convert AC to DC). The bridge
rectifier is the most important and it produces full-wave varying DC. A full-wave rectifier can
also be made from just two diodes if a center-tap transformer is used, but this method is rarely
used now that diodes are cheaper. A single diode can be used as a rectifier but it only uses the
positive (+) parts of the AC wave to produce half-wave varying DC. A bridge rectifier can be
made using four individual diodes, but it is also available in special packages containing the four
diodes required. It is called a full-wave rectifier because it uses the entire AC wave (both
positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses
0.7V when conducting and there are always two diodes conducting, as shown in the diagram
below. Bridge rectifiers are rated by the maximum current they can pass and the maximum
reverse voltage they can withstand

6
Figure 2.3 Full Wave Rectifier (Bridge Rectifier) and Wave Form

2.7. CAPACITORS (SMOOTHING)

A capacitor is a component used to store electrical charges temporarily, which consists of two
conducting surfaces separated by a non-conductor dielectric. Smoothing is performed by a large
value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying
current to the output when the varying DC voltage from the rectifier is falling. The diagram
shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The capacitor
charges quickly near the peak of the varying DC, and then discharges as it supplies current to the
out put.

Figure 2. 4 Capacitor charging and discharging

7
2.8. Voltage regulator

A voltage regulator (7805&7812) are used to convert the DC output to a regulated (+12&+5)v
DC

2.9. Transistors:

The transistor is one of the fundamental building blocks of modern electronic devices, and is
ubiquitous in modern electronic systems. Following its release in the early 1950s the transistor
revolutionized the field of electronics and paved way for smaller and cheaper radios, calculators
and computers amongst other thing. A transistor is a semiconductor device used to amplify and
switch electronic signals. It is made of a solid piece of semiconductor material with at least three
terminals for connection to an external circuit. A voltage or current applied to one pair of the
transistor’s terminals, changes the current flowing through another pair of terminals. Since the
controlled (output) power can be much more than the controlling (input) power, the transistor
provides amplification of a signal. Today, some transistors are packed individually but many
more are found embedded in integrated circuit. [4]

Figure2.5 Simple circuit showing the labels of a Bi-polar Transistor


Physical Description of Transistors:
The two types of transistors have slight differences in how they are used in a circuit. A bi-polar
transistor has terminals labeled base, collector and emitter. A small current at the base terminal
(i.e. flowing from the base to the emitter) can control or switch a much larger current between
the collector and emitter terminals. For a field effect transistor (FET), the terminals are labeled
gate, source and drain; a voltage at the gate can control current between source and drain.

Principle of Operation

8
Transistors are commonly used as electronic switches for both high power applications including
switched mode power supplies and low power applications such as logic gates. In grounded
emitter transistor circuit, as the voltage raises, the base and collector current rises exponentially
and the collector voltage drops because of the collector load resistor. For the transistor to act as a
switch, the values of the input voltage can be chosen such that the output is completely on (at
saturation) or completely off. This type of operation is common in digital circuits where only
“on” and “off” values are relevant. When the switch is closed, current flows through the resistor
to the base of the transistor. The transistor then allows current to flow from the +9v to the 0v and
the lamp comes on. The transistor has to receive a voltage at its base for the lamp to light up. The
presence of the resistor is to protect the transistor as they can be damaged easily by very high
voltage/current

Figure 2. 6 An NPN Transistor acting as static a switch

9
CHAPTER 3

METHODOLOGY AND SYSTEM DESIGN

3.1. METHODOLOGY

Initial approach to project designing and execution is to gather enough information in order to
help speed up the operation once the actual work commences. Methodology is the study of how
to perform scientific research. It is the part of that is used to find out what type of data is
maintained, what fact to find and look for, how to find them and how to record them for usage.
The microcontroller based temperature control system controls the temperature of any device
according to its requirement for any applications. At the heart of the circuit is the PIC 18F45K22
microcontroller which controls all its functions. The circuit presents the automatic switching the
fan and heater within the desired range. The idea is based on the problem occurs in human’s life
nowadays by improving the existing technology. The Peripheral Interface Controller (PIC) based
automatic temperature control system is applied to upgrade the functionality to embed
automation feature. The heater will automatically switch on according to the temperature falls
below the specified limit. While LED switch on when the temperature reaches above the
specified limit. The system monitors the temperature from the LM35 temperature sensor, where
it will control the heater and cooler according to the setting values in the programming. Hence
the fan, heater and LED are automatically switch on or off according to the setting values in the
programming.

3.2. SYSTEM DESIGN

This is the phase of system designing. It is a most crucial phase in the development of a system.
The approach to a design is considered; else failure and incomplete project will be its outcome.

10
3.2.1. Circuit diagram developed

Figure 3.1General circuit diagram of the system


3.2.2. Description of the Circuit

We made this project because we wanted a way to automatically control and measure
temperature through sensor and fun and heater are doing according to the temperature read by a
LM35 sensor. We used an LCD shield to display the current temperature of the room .We also
need to select the transistor by the type of fan that we use. In our case we used the well-known
2N2222 transistor with collector current of 200mA, DC gain (hfe) of 10~30 and base-emitter
voltage (V) of 1V that we find from the data sheet and a 12V DC to provide power to the fan and
Heater. The LM35 temperature sensor, relay and red LED is powered with 5V.A motor is an
electromagnet and it has a magnetic field whilst power is supplied to it. When the power is
removed, the magnetic field collapses and this collapsing field can produce a reverse voltage to
go back up its wiring. This could seriously damage your micro controller and that is why the

11
diode has been placed around the circuit. The diode in our circuit is therefore put in place to
protect our micro controller.

3.2.3. Working principle of the system

We set the pins for the sensor, LED, LCD, Heater and Fan. The most important part is to set the
variables tempMin and tempMax with our desired values. tempMin is the temperature at which
the heater starts to ON and tempMax is the temperature at which the fan to be ON, the heater is
only ON when temperature of the room is less than 15 °C. We store the temperature value in the
temp variable and then use some if statements (return one value if the condition is met, and
another value if the condition is not met) to check if temperature lower than 15 °C or greater than
25 °C and in between 20 °C and 25 °C, to make it easy and the heater and coolers are functioning
within the required ranges of temperature. But after some negotiation of temperature increased
.That is the temperature greater than 25 °C , the red LED lights giving warning that the current
reading is exceeds maximum temp and the system assume that the fan is not properly operating
in this temperature region for the purpose of some fault occurred on fan.

3.3. General Block diagram


POWER
FAN
HEATER SUPPLY
Figu

LCD

DISPLAY
PIC

18F45K2
TEMPER 2 LED

ATURE

SENSOR

Figure3.2General block diagram of the system

12
Block diagram description

The basic blocks of the System include the following blocks; Temperature Sensing circuit, PIC
microcontroller, LED, LCD Display, Fan and Heater. The temperature Sensor detects the
temperature of the environment. 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 analogue input
of microcontroller. The LCD module is also connected to the analogue or digital input-output of
the microcontroller. The LCD module displays the actual temperature of the room. The LCD
display used is a 16x2 Alphanumeric Display.

13
3.4. Sestem flow chart
Sart

Yes heater ON
tempMin<15
°C

15<=temp < Yes Fan, heater and led


20°C OFF

Yes

20<=temp< FAN ON
25°C

Yes

temp> 25°C LED ON

Intimation to
authorized person

Stop

Figure3.3 system flow chart

3.5. HARDWARE

3.5.1. Power Supply

This circuit consists of the following component:-

Transformer
14
Rectifier

Capacitor

Voltage regulator (7805&7812)

This module is basically designed to achieve regulated power supply 12V for fan motor and 5V
for other components that we have used in our thesis. It mainly consists of a transformer which is
used to step down the AC voltage, IN4007 diodes used to form a full wave bridge rectifier to
convert AC to DC, capacitor used as a filter circuit, 7812 and 7805 voltage regulators IC’s that
are used to obtain 12V and 5V respectively at the output of the regulators. In most of our
electronic products we need a power supply for converting mains AC voltage to a regulated DC
voltage. For making a power supply designing, each and every component is essential to be
considered. Starting with very basic things of choosing of components are:-

Step down transformer

Voltage regulator to maintain constant output voltage

Capacitors for the purpose of smoothing DC output of rectifier Diodes to construct a bridge
rectifier. 230V AC is converted into 12V AC using a step-down transformer. 12V output of step
down transformer is an RMS value and its peak value is given by the product of square root of
two with RMS value, which is approximately 17V.This is a simple approach to obtain a 12V and
5VDC power supply using a single circuit. The circuit uses two ICs 7812(IC1) and 7805 (IC2)
for obtaining the required voltages. The AC mains voltage will be stepped down by the
transformer, rectified by bridge and filtered by capacitor C1 to obtain a steady DC level .The IC1
regulates this voltage to obtain a steady 12V DC. The output of the IC1 will be regulated by the
IC2 to obtain a steady 5V DC at its output. In this way both 12V and 5V DC are obtained. Such
Circuits is very useful in cases when we need two DC voltages for the operation of a circuit.

15
Figure 3.4circuit diagram of power supply module
As we require a 12V or 5V we need LM7805/12 Voltage regulator ICs are characterized by:-
Input voltage range 7V~ 35V for IC2 while 14.5V~40V with respect to temperature for IC1.
Current ratingIc = 1A for both. Output voltage range 𝑉𝑚𝑎𝑥 = 5.2𝑣, = 4.8𝑣 for IC2 while for
IC1is from11.5𝑣 𝑡𝑜 12.5𝑣 Typical capacitance values range from about 1 pF (10−12 F) to about
1 mF (10−3 F).Datasheet of7812 prescribes to use a 0.01μF capacitor at the output side to avoid
transient changes in the voltages due to changes in load and a 0.33μF at the input side of
regulator to avoid ripples.

3.5.2. Microcontroller

A microcontroller (or MCU) is a computer-on-a-chip used to control electronic devices. It is a


type of microprocessor emphasizing self-sufficiency and cost-effectiveness, in contrast to a
general-purpose microprocessor (the kind used in a PC). A typical microcontroller contains all
the memory and interfaces needed for a simple application, whereas a general purpose
microprocessor requires additional chips to provide these functions. The microcontroller acts like
the brain of the control systems available in the system. The microcontroller chip that has been
selected for the purpose of controlling the control systems is PIC18F45K22 manufactured by
Microchip. This chip is selected based on several reasons. [10] The PIC18F45K22 is a low
power, high-performance microcontroller. The device is manufactured by microchip’s high-
density non-volatile memory technology. The on-chip Flash allows the program memory to be
reprogrammed in-system or by a conventional non-volatile memory programmer. The microchip
.PIC18F45K22 is a powerful microcontroller which provides a highly-flexible and cost effective
solution to many embedded control applications.

16
Figure 3.5PIC Microcontroller
A microcontroller is a single integrated circuit with the following key features:

central processing unit - ranging from small and simple 8-bit processors to sophisticated 32- or
64-bit processors

output interfaces such as serial ports

Peripherals such as timers.

RAM for data storage.

ROM, EEPROM or Flash memory for program storage.

Clock generator - often an oscillator for a quartz timing crystal, resonator or RC circuit

High performance Wide operating voltage range (2.0-5.56)volts High sink or source current
(25mA) Commercial, industrial and extended temperature range. [6]

17
Figure 3.6pin diagram of PIC18F45K22IC Microcontroller. [7]

3.5.3. Temperature sensor LM35

The LM35 series are precision integrated-circuit temperature sensors, with an output voltage
linearly proportional to the Centigrade temperature. It is small in size and very cheap as compare
to other temperature sensors. Low cost is assured by trimming and calibration. The low output
impedance, linear output, and precise inherent calibration of the LM35 make interfacing to read
out or control circuitry especially easy. The device is used with single power supplies. As the
LM35 draws only 60 µA from the supply, it has very low self-heating of less than 0.1°C in still

18
air. The LM35 is rated to operate over a −55°C to +150°C temperature range. Its output is linear
and each degree Celsius is equal to 10mve.g like150 ° C = 1500mV and -40 ° C =-400mV.LM35
Temperature range. It can be easily useable for single supplies of power and it has also comfort
level at minus supplies. Values that the LM35 sensor returns are 10mV/°C degree. This means
that first we have to multiply it with 100 to reach 1 °C. So, if we need to set a specific
temperature, we use this: [2] 𝑐𝑒𝑙𝑠𝑖𝑢𝑠 = 𝑝𝑜𝑤𝑒𝑟 𝑠𝑢𝑝𝑝𝑙𝑦 𝑣𝑜𝑙𝑡𝑎𝑔𝑒 ∗ 𝑖𝑛𝑝𝑢𝑡 𝑓𝑟𝑜𝑚 𝑠𝑒𝑛𝑠𝑜𝑟 ∗100/
2^10

Applications of LM35

LM35 is applicable in many ways like other temperature sensors. Its temperature will be 0.01°C
of the surface temperature. It has assumed that air temperature and surface is approximately
equal.Ifthe air temperature is lower or higher than the surface temperature it will be die in
between the air temperature and surface temperature. To solve this problem it is held at that
temperature at which surface satisfies their interest. The simplest way to minimize this issue it
cover up with wires and make it possible that wires are all at same temperature as surface then
LM35 die’s temperature will not be affected by air temperature. Temperature sensor LM35 does
not need for any additional circuit. Due to its low output impedance, its output and its linear
calibration it is possible that it will install easily and integrated in a control circuit. Due to low
supply of current it has an effect of very low self-heating.

Advantages of LM35

LM35 can measure temperature more accurately than a thermistor.LM35 is sealed sensor circuit
and there is no subject of oxidation. The LM35 generates a higher out put voltage than
thermocouples and does not require that output voltage is amplified.

3.5.4. LCD Display

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

19
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. 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. Since the data
from the microcontroller needs to be displayed a Liquid Crystal Display is used.The display
section consists of 16*2 LCD, which is used to display the temperature status and speed of the
motor to fix the problem automatically. [6]

Figure 3.7Diagram of LCD


The screens of LCD are limited to text and are generally used in laser printers, copiers and fax
machines and in networking equipment such as data storage and in routers. The screens are in
small number of configuration, mostly16x2, 20x2 and 20x4. With a standard use of16 pins
interface generally using pins on 0.1 inch / 2.54mm centers. Those LCD they do not have
backlights used 14pins, basically two pins used for to power the lights. The LCD defines two
modes of interfacing one for 4 bits and other one is 8 bits. By using the 4 bit mode is complex,
but it reduces the number of active connections that we needed. In 8 bit mode instruction set are

20
designed to allow switching without requiring the lower four data pins. If it is in4 bit mode,
character and control data is transferred as pairs of 4 bit "nibbles" on the upper data pins, D4-D

Table 1 LCD pin connection description [4]

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

ii. 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.

21
iii. 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.

iv. E (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.

v. 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.

3.5.5. DC Fan motor


Before we get into the subject of regulating and monitoring fans, we first need to understand the
fans themselves. 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 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. [3]

22
CHAPTER 4

RESULTS AND DISCUSSION

4.1. Software Simulation Results and Discussion

We have three cases in our Circuit diagram to obtain:

Case1: when temp (current reading temperature) is less than 15 °C heater ON (a)

Figure 4.1 heater ON

23
Case2: when temp (current reading temperature) is grater than15 °C less than 20 °C all are OFF (b)

Figure 4.2 Heater Fan and LED OFF

24
Case3: when temp (current reading temperature) is grater than20 °C <= 25°C fan ON (c)

Figure 4.3 Fan ON

25
Case4: when temp (current reading temperature) is grater than25°C red LED on (d)

Figure 4.4 LED ON


In this system, if the temperature read is in between 15-20 degree celcius, it is considered normal
state. In this condition both fan and heater are off but the temperature is displayed in LCD. if the
temperature read is in between 20-25 degree celcius, it is considered to be a situation to turn on
fan and turn off heater. If the temperature of the room is greater than 25 degree celcius it is
considered to be a situation to turn on the red LED to notify the fault in the system. If the
temperature of the room is less that 15 degree celcius it is considered to be a situation to turn on
Heater and turn off fan. Generally the fan, heater and LED are automatically switch on or off
according to the setting values in the programming.

Components that we use:

 PIC 18F45K22 microcontroller


 LM35 temperature sensor

26
 DC fan motor (12V DC )
 LCD (16× 2)
 LED (2.2V,10mA)
 Transistor (2N2222)
 Relay (5V)
 Resistors (200Ω, 330Ω)
 Diode (1N4007)

Software’s used for the system designed were:

Proteus

MicroC PRO for PIC

Software Design

In this part we will show the steps and procedures we followed to develop the programs for the systems
that we are going to develop. For software implementation, we have used MikroC to program
microcontroller in C language. Besides, proteus 8.1 professional is used for software design to monitoring
the controlling algorithms of the system.

Programming process

MikroC PRO IDE

The MikroC PRO for PIC is a powerful, feature-rich development tool for PIC microcontrollers. It is
designed to provide the programmer with the easiest possible solution to developing applications for
embedded systems, without compromising performance or control. PIC and C fit together well: PIC is
the most popular 8-bit chip in the world, used in a wide variety of applications, and C, prized for its
efficiency, is the natural choice for developing embedded systems. MikroC PRO for PIC provides a
successful match featuring highly advanced IDE, ANSI compliant compiler, broad set of hardware
libraries, comprehensive documentation, and plenty of ready-to-run examples.MikroC is a full-featured
ANSI C compiler for 5 different microcontroller architectures. It is the best solution for developing code
for your favorite microcontroller. It features intuitive IDE, powerful compiler with advanced SSA
optimizations, lots of hardware and software libraries, and additional tools that will help you in your
work. Each compiler comes with comprehensive help file and lots of ready-to-use examples designed to
get you started in no time. [6] We use the following steps to compile our program on MikroC PRO IDE

27
Step1: Determine the system sequence of operation.

Step2: Assignment of Inputs and outputs

Step3: Writing of the program

Step4: Programming into Memory

Step5: Running the system and simulate

An algorithm has to be developed to make the microcontroller to read the input and respond accordingly.
Therefore, the algorithm is established and represented by a flowchart. These flowcharts are then
translated into C language and compiled using MikroC Pro C IDE and compiler.

28
CHAPTER 5

CONCLUSION AND RECOMMENDATIONS

5.1. Conclusion

At the end of our project, we deduce that it is realized to maintain the temperature of a given
server room in certain region by incorporating the fan and heater with respect to temperature
sensor. In this case if every fault occurred on the fan, there will be notifications about that error
for the authorized person. The actual temperature of the room is expected to be displayed on the
LCD continuously. The system developed was successfully automatic to control the temperature
in server room in .in what there is no need of human intervention. The system can also be used
for not only server room by initializing the temperature that is suitable for our work or allowed
for that purpose. Therefore, besides the world global warming and unexpected and expected
rising of temperature around the world is being series trouble, we can use the system developed
here for other application like home automation and in medical case.This project can be achieved
its objectives and provides solution in the form a system that can monitor temperature of a given
room if it is implemented.

5.2. Recommendations

Adding updated technologies like GPRS to feature of the system it can be developed for
ONLINE maintenance and gives related functions. Increasing a number of fan in the given room
will reliable the durability of the fans life with proper utilization and cooling activities inefficient
and effective way. We recommend the user to have a multiple number of fans with respect to
area of that room to keep the life expectance of the devices and for effective and efficient
application to be for utilized. One can improve the system not only for hot area but also for cold
area where the temperature may be below the minimum set value by considering heater to be
used in the system instead of fan.

29
REFERENCES

[1] A.K .SAWHNEY “A course in electrical and electronic measurements and

Instrumentation, 4thed”

[2] Texas Instruments. LM35 Precision Centigrade Temperature Sensors. USA: Texas

Instruments; 2013.

[3] NikluqmanulhakimBinnikariffin,“TEMPERATURE CONTROLLED FAN

FOR HOME APPLICATION”

[4] Comus Europe Ltd. Datasheet of 7805 and 7812. U.K: Comus Europe Ltd; 2009.

[5] Vetelino J. and Raghu A. Introduction to Sensors. USA: CRC Press; 2011

[6] A. Sachan, “Microcontroller based Based Substation Monitoring and Control

System with Gsm Modem” IOSR Journal of Electrical and Electronics Engineering, vol.

1, no. 6, (2012).

[7] John B. Peatman, “Design with PIC Microcontrollers”,2nd Edition, Pearson Education,

2005.

APPENDIX

CODE

/*Project name: Automatic Temperature Control

*/

30
// LCD module connections

Sbit LCD_RS at LATC4_bit;

Sbit LCD_EN at LATC5_bit;

sbit LCD_D4 at LATC0_bit;

sbit LCD_D5 at LATC1_bit;

sbit LCD_D6 at LATC2_bit;

sbit LCD_D7 at LATC3_bit;

sbit LCD_RS_Direction at TRISD4_bit;

sbit LCD_EN_Direction at TRISD5_bit;

sbit LCD_D4_Direction at TRISD0_bit;

sbit LCD_D5_Direction at TRISD1_bit;

sbit LCD_D6_Direction at TRISD2_bit;

sbit LCD_D7_Direction at TRISD3_bit;

// End LCD module connections

#define FAN PORTD.RD0

#define HEATER PORTD.RD1

#define LED PORTD.RD3

#define VIRTUAL PORTD.RD(5,6)

#define ENTER 15

#define CLEAR 13

#define ON 1

#define OFF 0

31
void main () {

unsigned short Txt[14];

unsigned short Temp; //referance Temperature

unsigned char inTemp,inTem;

double mV;

ANSELC = 0; //Configure PORTC as digital I/O

ANSELB = 0; //Configure PORTB as digital I/O

ANSELD = 0; //Configure PORTD as digital I/O

TRISA0_bit = 1; //Configure AN0 (RA0) as input

TRISC = 0; // PORT C pins are configured as outputs (LCD)

TRISD0_bit = 0; // RD0 as output (Burner)

Lcd_Init(); // Initialize LCD

Lcd_cmd(_LCD_CLEAR); // clear display

Lcd_cmd(_LCD_CURSOR_OFF); // cursor off

Lcd_Out(1,4, "Automatic");

Lcd_Out(2,2, "Temp control");

delay_ms(200); //2s delay

FAN = OFF;

Lcd_cmd(_LCD_CLEAR); // clear display

Lcd_Out(2,1, "Temp:");

Lcd_cmd(_LCD_CLEAR); // clear display

Lcd_Out(1,1, "Temp :");

32
intTostr(Temp,Txt); //convert to string

inTemp = Ltrim(Txt);

Lcd_Out_Cp(inTemp); // Display Tem_Ref

// wait until # is pressed

Lcd_cmd(_LCD_CLEAR); // clear display

Lcd_Out(1,1, "Temp: ");

Lcd_Chr(1,15,223); // differant LCD displays have differant

// char code for degree

Lcd_Chr(1,16,'c');// Display "c" for celsius

//program loop

while(1) {

//Display Referance Temperature and Actual Temperature

temp = ADC_Read(0); // Read temperature from ANO

mV = temp*5000.0/1024.0; //convert to mv

Temp = mV/10.0; //convert to degree celcius

intToStr(Temp,Txt); // convert to string

Txt[4] = 0;

Lcd_Out(2,1, Temp);

Lcd_Out(2,1, "Temp=");

Lcd_Out(2,12, "");

intToStr(Temp,Txt); // convert to string

inTemp = Ltrim(Txt);

33
Lcd_Out(1,1, "Temp Max: ");

Lcd_Out(1,11, inTemp);

if (Temp<=25) {

FAN = ON;

LED = OFF;

HEATER = OFF;

if (Temp>25) {

FAN = OFF;

LED = ON;

HEATER = OFF; }

if (Temp<20){

FAN = OFF;

LED = OFF;

HEATER = OFF;}

if(Temp<15){

FAN = OFF;

LED = OFF;

HEATER = ON;}

Delay_ms (1000); //wait 10 s then repeat

34

You might also like