Professional Documents
Culture Documents
Project Report Subbmitted By: Automatic Temperature Control For High Performance Computer Room
Project Report Subbmitted By: Automatic Temperature Control For High Performance Computer Room
Project Report Subbmitted By: Automatic Temperature Control For High Performance Computer Room
Signature……………………. Signature………………………….
Date…………………………. Date……………………………….
Examiners Signature
1.______________________ ____________________
2.______________________ ____________________
3.______________________ ____________________
i|Page
ACKNOWLEDGEMENT
First of all, we would like to thanks God the Almighty, for His blessings throughout our research
work to complete the work successfully. and we also want to express our deepest gratitude to
our advisors Dr. EristuYgzaw for the unwavering support and guidance throughout this Project.
We would also like to forward our heartfelt gratitude to our department for cooperation in giving
lab service and share ideas. We are also grateful to Cpl.Awot Dereje (Lecturer in Computer
Department Engineering,) and Cpl.Solomon Gezehagn (Lecturer in Electronics, Department
Engineering,) for they valuable supporting during our project simulations. And finally we would
like to express our sincere gratitude to everyone who supported the conduct of this project by
providing us benchmark information, direction, and insights to fulfill this project.
ii | P a g e
ABSTRACT
This project presents control of the temperature for the computer room based on automatic
temperature sensor. This is automatic system which controls the room temperature and controls
the circulation of temperature inside the room without human intervention. Automatic
temperature control is a microcontroller based circuit which is used to maintain a temperature
specified by the user. This project will be most helpful for data which store in the computer room
if the room temperature is higher than the set temperature. In this project of an automatic high
power computer room temperature Control system allows the user to set a reference
temperature which is then compared to the room temperature measured by a temperature
sensor. The temperature sensor will then sense the room temperature and communicates with
the microcontroller. With the help of a microcontroller, the system responds by turning ON and
OFF the air conditioner (AC) automatically depending on the temperature difference. So the air
conditioner is triggered ON when the room temperature is higher than the set temperature and
OFF when the room temperature is lower than the set temperature. The system was designed
and simulated using Proteus 8, PIC Microcontroller, and circuit building software used for building
electronics system. And MikroC hex file was loaded on the Proteus schematic design.
Keywords: PIC Microcontroller, LM35 temperature sensor, Liquid Crystal Display (LCD)
iii | P a g e
Table of Contents Page
Certification ....................................................................................................................................i
Acknowledgment............................................................................................................................ii
Abstract..........................................................................................................................................iii
Table of contents .......................................................................................................................... iv
List of Tables ................................................................................................................................. vi
1. INTRODUCTION ................................................................................................................1
1.1 Back Ground .............................................................................................................................1
iv | P a g e
CHAPTER THREE.................................................................................................................... 9
4.1.2Micro C ........................................................................................................... 21
4.2 System Block Diagram ........................................................................................................... 22
v|Page
4.3.6 Buzzer .................................................................................................................... 32
4.3.7 Crystal Oscillator ................................................................................................... 33
4.4 Flow Chart Diagram ............................................................................................................... 34
4.5 Interfacing of Pic16F877A with External Device.................................................................. 34
4.5.1 Pin Description of Pic16F877A ............................................................................ 34
4.6 Circuit Diagram of A System ................................................................................................. 36
4.6.1 General Operation of the Circuit.......................................................................... 36
Appendix ......................................................................................................................................41
List of Tables
vi | P a g e
List of figures
Figure 1.1: Shows Generalize Block Diagram of Feedback Control System ................................. 3
Figure 3.1: Shows block diagram of physical system model designing ......................................... 9
Figure 3.2: Shows Ideal Element ..................................................................................................11
Figure 3.3: Shows Parallel RLC Circuit excited by a Current Source. ....................................... ….11
Figure 3.4: Shows Defense Engineering College Server Room Model. ..................................... .14
Figure 3.5: Shows Thermal System Feedback Block Diagram of D.E.C Server Room Model. … …17
Figure 4.1: Shows Proteus design suite version 8.........................................................................20
Figure 4.2: Shows Block Diagram of Automatic Computer Room Temperature Control ........... 22
Figure 4.3: Shows PIC Microcontroller ........................................................................................ 23
Figure 4.4: Shows PIC16F877A Microcontroller Chip. ............................................................... 24
Figure 4.5: Shows LM35 Temperature Sensor .............................................................................28
Figure 4.6: Shows LM35 Interfacing with PIC Microcontroller .................................................. 28
Figure 4.7: Shows 16×2 LCD Display. ......................................................................................... 30
Figure 4.8: Shows Brushless Dc Motor. ....................................................................................... 31
Figure 4.9: Shows Motor Driver L293DIC................................................................................... 32
Figure 4.10: Shows Symbol of Crystal Oscillator ........................................................................ 33
Figure 4.11: Shows Flow Chart Diagram ..................................................................................... 34
Figure 4.12: Shows Pin Description of PIC16F877A Microcontroller ........................................ 35
Figure 4.13: Shows Circuit Diagram of A System. ...................................................................... 36
Figure 5.1: Shows snap Shoot Result of Simulation When Temperature is Greater than 16‟c. .38
vii | P a g e
List of Acronyms
IC…………………………...Integrated circuit
MCLR……………………...Master Clear
OSC………………………. Oscillator
viii | P a g e
CHAPTER ONE
INTRODUCTION
Generally, some electronic systems produce heat, while operating. The heat should be reduced
in order to keep the system performance, so the automatic temperature control is certified as
the best method in any application because the temperature is usually controlled automatically
(no human intervention involved) throughout the process. As the human civilization is being
modernized day by day the demand of automatic is increasing accordingly, because weather is
forever varying and changes on short intervals, and as a result, the external conditions always
have an influence on the room conditions, so the automatic control of many days to day tasks
relieves the human beings from performing repetitive manual operations.
The principle of automatic control is not a human being, executes the control action. Where a
control system is a system of devices or set of devices, that manages commands, directs or
regulates the behavior of other device(s) or system(s) to achieve desire results. The reason one
wishes to control a process is to have it behave in a desired way. Now the same operation of
measuring the temperature and estimating the error between the desired temperature and the
actual temperature, or error between the actual temperature and the desired temperature is
continuously obtained and used to activate the controller. This may involve the process becoming
more accurate, more reliable or more economic. In some cases, the uncontrolled process is
unstable and good control is necessary in order not to damage it (which sometimes can cause
extensive damage). Hence, good control can mean different things in different applications. The
control signal is adjusted automatically, by the controller, until the difference between the
references or set point (desired) value and the actual, measured value of the process variable is
sufficiently small. This difference is denoted the control error. Hence, automatic control is
obtained with error-driven control. [1]
This project uses a microcontroller to automatically control the temperature of an area. This area
could be research area, small plant, a house or any place or devices that require a controlled
temperature like an incubator (egg) system.
1|Page
1.2 Automatic control theory
An automatic controller compares the actual value of the plant output with the reference input
(set value), determines the deviation, and produces a control signal that will reduce the deviation
to zero or to a small value. Control systems can be classified as either open loop or closed loop.
1.2.1Open loop control system
In an open loop system, (a non-feedback control system) there is no means by which the output
is monitored by the system, or a system in which the output has no effect on the control action,
or control system. That mean no measurements are made at the output. For a given input the
system produces a certain output. If there are any disturbances, the output changes and there is
no adjustment of the input to bring back the output to the original value. A traffic control system
is a good example of an open loop system. The signals change according to a preset time and are
not affected by the density of traffic on any road. This control type is simple and easy to build,
cheaper, as they use, less number of components to build and usually stable. But this open loop
control system is less accurate, if external disturbances are present, output differs significantly
from the desired value. [2]
1.2.2 Closed Loop Control Systems
A closed loop system has a feedback path from the output of the controlled process to the input
of the control system allowing the output to be monitored. These are also called feedback control
systems. A system which maintains a prescribed relationship between the controlled variable and
the reference input, and uses the difference between them as a signal to activate the control.
The output or the controlled variable is measured and compared with the reference input and an
error signal is generated. This is the activating signal to the controller which, by its action, tries to
reduce the error. Thus the controlled variable is continuously feedback and compared with the
input signal. If the error is reduced to zero, the output is the desired output and is equal to the
reference input signal. A feedback control system is represented as an interconnection of blocks
characterized by an input output relation.
2|Page
Fig1.1 Shows Generalize Block Diagram of feedback Control System
The input to the entire system is called as a reference input or a command input, r (t). An error
detector senses the difference between the reference input and the feedback signal equal to or
proportional to the controlled output. The feedback elements measure the controlled output and
convert or transform it to a suitable value so that it can be compared with the reference input. If
the feedback signal, b (t), is equal to the controlled output, c (t), the feedback system is called as
unity feedback system. The difference between the reference input and the feedback signal is
known as the error signal or actuating signal e (t), this signal is the input to the control elements
which produce a signal known as manipulated variable, u (t). This signal manipulates the system
or plant dynamics so that the desired output is obtained. The controller acts until the error
between the output variable and the reference input is zero. The major advantage of feedback
system is that it is insensitive to external disturbances and variations in parameters.
Comparatively cheaper components can be used to build these systems, as accuracy and
tolerance, and do not affect the performance. [3]
3|Page
I. Reference input or a command input, r(t)
It is the actual signal input to the control system is an external signal applied to a
feedback control system in order to command a specified action of the plant; it
often represents ideal plant output behavior.
II. And Summing Point
Isa circle with a cross is the symbol that indicates a summing operation. The plus
or minus sign at each arrow head indicates whether that signal is to be added or
subtracted.
III. Actuating signal (error signal) e(t)
The difference between the reference input and the feedback signal is called as
the error signal or actuating signals.
IV. Controller
An automatic controller compares the actual value of the plant output with the
reference input, determines the deviation, and produces a control signal that will
reduce the deviation to zero or to a small value. And the manipulated variable is
the quantity of the condition that is varied by the controller so as to affect the
value of controlled variable
V. Plant or system
The Plant or system is the device, process, or system that needs to be controlled,
controlled system of which a particular quantity or condition is to be controlled.
1.4 Objective
1.4.1 General objective
The main objective of this project is to control the temperature in the high power computer
room using PIC -microcontroller.
5|Page
1.5 Scope of the project
To design and develop an automatic temperature control for computer room using pic
microcontroller, project scopes need to be defined for assist and guide the development of the
project. The main scopes for this project are:
Data collection: Collect necessary data through literature review on existing control systems,
microcontroller, sensor, driven motor and circuit design.
Design electronics system: Design a circuit diagram.
Programming and Testing: Build the complete set of program for pic microcontroller unit and run the
testing for the complete automatic control temperature for computer room.
1.6 Methodology
For successful completion of this project some steps have been followed to carry out different
tasks. We started with the problem, and we tried to identify and view previous works on
automatic controls. After that we made our specification and proposed the automatic
temperature control for high power computer room. And we have to design the software
prototype.
6|Page
CHAPTER TWO
LITERATURE REVIEW
7|Page
3. Abu-Bakr Muhammad Auwal (2017), Microcontroller Based Automatic Temperature
Controller. This project presents, a microcontroller based automatic temperature controller. The
system is based on PIC16F877A microcontroller interfaced with LM35 temperature sensor, LCD,
switching transistors and relays. This aim is used to control using microcontroller in turns
automatically switches on/off a heater or a fan based on the result of the comparison. But it not
control for the high power computer room specifically, because, in the high power computer
room, the heater is generated heat at any time. [7]
4. Gaurav S. Ashara, Dipesh S.Vyas, design and simulation of temperature control of chamber
based on automatic fun speed control. This project aim is to create an automatic fan system that
can monitor the box temperature and compare with set value using a temperature sensor.
Where, electric fan automatically switches the speed according to change inner temperature of
the box. The system uses LM35 temperature sensor, 89C51 microcontroller, fan interface circuit
and the box model, to apply in this function. But in our project we have used server room model
system and PIC microcontroller to control the temperature. [8]
8|Page
CHAPTER THREE
PHYSICAL SYSTEMS OF MATHEMATICAL MODELING
Whenever a task is to be performed, a set of physical objects are connected together and a suitable input is
given to them, to obtain the desired output. This group of objects is usually termed as the system. In order
to analyses, design or synthesize a complex system, a physical model has to be obtained, no physical system
can be represented in its full physical intricacies and therefore idealizing assumption are always made for
the purpose of analysis and synthesis of a system. A physical system can be modeled in number of ways
depending up on the specific problem to be dealt with and the desired accuracy. For example, an electronic
amplifier may be modeled as interconnection of linear lumped elements, or some of these may be pictured
as nonlinear elements in case the stress is on the distortion analysis. A communication satellite may be
modeled as a point, a rigid body or a flexible body depending up on the type of the study to be carried out.
As idealizing assumption are gradually removed for obtaining a more accurate model. Once a physical model
of a physical system is obtained, the next step is to obtain a mathematical model which is the mathematical
representation of the physical model through use of appropriate physical laws. Depending upon the choice
of variable and the coordinate system, accurate model. Once a physical model of a physical system is
obtained, he next step is to obtain a mathematical model which is the mathematical accurate model. Once
a physical model of a physical system is obtained, the next step is to obtain a mathematical model which is
the mathematical representation of the physical model through use of appropriate physical laws. Depending
upon the choice of variable and the coordinate system, a given physical model may lead to different
mathematical model.
9|Page
And this physical model may be a simplified version of the more complex system. The behavior of
this physical model is then described in terms of a mathematical model so that known techniques
of mathematical analysis can be applied to the given system. [9]
This is the method of obtaining differential equation models of physical systems by utilizing the
physical laws of process. Depending up on the system well-known physical laws like Newton’s
laws, Kirchhoff’s laws, etc. will be used to build mathematical models. Mathematical models of
most physical elements are characterized by differential equations. And a mathematical model is
linear, if the deferential equation describing it has coefficients, which are either function only of
the independent variable or are constant. On the other hand, if the coefficients of the describing
differential equations are constant, the model is linear time-invariant. We shall in first step build
the physical model of the system as interconnection of idealized system elements and describe
these in form of elemental laws. These idealized elements are sort of building blocks of the
system. An ideal elements result by making basic assumptions.
I. Spatial distribution of the element is ignored and it is regarded as a point phenomenal.
Thus mass which has physically dimensions, is considered concentrated at a point and
temperature in a room which is distributed out into the whole room space is replaced by
a representative temperature as if a single point in the room. The process of ignoring the
spatial dependence by choosing a representative value is called lumping and the
corresponding modeling is known as lumped-parameter modeling as distinguished from
the distributed parameter modeling which accounts for space distribution.
II. We shall assume that the variable associated with elements lie in the range the element
can be described by simple linear law of (1) a constant of proportionality or (2) a first
order derivative or (3) a first-order integration, to begin with we shall consider ideal
elements which have a single-port or two terminal representations and so have two
variables associated with it as shown below.
10 | P a g e
1. Through variable VT: - which sort of passes through the element and so has the same
value in at one port and out at the other. Example current through an electrical resistance.
2. Across Variable VA: - which appears across the two terminals of the element, for
11 | P a g e
(a)Applying Kirchhoff's current law at the node,
(1)
(2)
(3)
If the voltage is taken as the output, taking Laplace transform of eqn. (1), we get
Analogous systems have the same type of equations even though they have different physical
appearance. Mechanical systems, fluid systems, temperature systems etc. may be governed by
the same types of equations as that of electrical circuits. In such cases we call these systems as
analogous systems. A set of convenient symbols are already developed in electrical engineering
which permits a complex system to be represented by a circuit diagram. The equations can be
12 | P a g e
written down easily for these circuits and the behavior of these circuits obtained. Thus if an
analogous electrical circuit is visualized for a given mechanical system, it is easy to predict the
behavior of the system using the well-developed mathematical tools of electrical engineering.
Designing and constructing a model is easier in electrical systems. The system can be built up with
cheap elements, the values of the elements can be changed with ease and experimentation is
easy with electrical circuits. Once a circuit is designed with the required characteristics, it can be
readily translated into a mechanical system. It is not only true for mechanical systems but also
several other systems like acoustical, thermal, and fluid and even economic systems.
13 | P a g e
system. But for simplicity of analysis, the system is assumed to be linear and is represented by Lumped
parameters model. Thermal systems may be analyzed in terms of resistance and capacitance, although the
thermal capacitance and thermal resistance may not be represented accurately as lumped parameters.
Substances that are characterized by resistance to heat flow have negligible heat capacitance, and that
substances that are characterized by heat capacitance have negligible resistance
to heat flow. [10]
Consider from the thermal system shown fig 3.4 assume that the room is insulated to eliminate
heat loss to the surrounding air, there is no heat storage in the insulation and the computer in
the room is kept at uniform temperature. Thus single temperature may be used to describe the
thermal state of the entire temperature. If there is high temperature present so, there is a
complex temperature distribution through the computer and the problem becomes one of the
distributed parameters, requiring the use of partial differential equations. Assume that the
steady-state temperature of the reference (set-point) is , and that of the output from
computers room temperature is the steady-state heat input rate from the heater is H. To obtain
a linear model we shall use small-signal analysis.
14 | P a g e
Let ) be a small increase in the heat input rate from its steady-state value. This increase
in heat input rate will result in increase of heat output rate by an amount and a heat stroge
rate of the computer in the room by an amount . Consequently the temperature of the
computer in the room and therefore of output temperature rises by . Since the insulation
has been regarded as perfect, the increase in output rate is only due to the rise in temperature
of the output rate temperature is given by
= /R (1)
Where R =1/Qs, is defined as the thermal resistance and has units of /J/min.So the rate of heat
storage in the room is given by
Where C =MS, is defined as the thermal capacitance and has the units of J . From the differential
equations the heat flow balance is
+
= /R + C
R( ) =RC
Equation (3) describes the dynamic of the thermal system with the assumption that the
temperature rate temperature inflowing to the room is constant. The along with a heat input
signal from the Computers, there is an additional signal due to changing in the temperature of
the room which is known as disturbance signal.
Let i be change in the temperature of the room from the steady-state value. Now in addition
to the change in heat input from the Computers, there is a change in heat carried by the rate
temperature in the room. Therefore the heat flow equation becomes
+ /R= /R+ C
RC
Let as now relax the assumption that the room insulation is perfect. As the set temperature
increases by , the rate of heat flow through the room to the ambient medium increases by
15 | P a g e
Where Rt is the thermal resistance of the room, so the equation (4) is modified to
Or
R’C ) (6)
Where R’ = - is the effective thermal resistance due to temperature outflow and room
(Its parallel combination of R and Rt’)
3.4 Transfer Functions
The transfer function of a linear time-invariant system is defined to be the ratio of the Laplace
transform of the output variable to the transform of the input variable under that initial
conditions are zero. It describes the input output behavior of the system and does give any
information concerning the internal structure of the system. Thus when the transfer function of
a physical system is determined, the system can be represented by a block, which is a short-band
pictorial representation of the cause and effect relationship between input and output of the
system. The functional operation of the system can be more readily visualized by examination of
a block diagram rather than by the examination of the equation describing the physical system.
Therefore when working with a linear-time-invariant system, we can think of system or its sub-
system simply as interconnected block with block described by a transfer functions. So the
Laplace transforming, and the transfer function of the thermal system is:
The highest power of the complex variable s in the denominator of the transfer function determines the
order of the system. So the block diagram representation of the system is shown in the fig. 3.5a below
when the system is subjected to a disturbance, the dynamic is describes by equation (4) taking the Laplace
transformation of this equation, we get
(RCs + 1) = +R (8)
16 | P a g e
The corresponding block diagram representation is given in the fig 3.5b
Fig.3.5 shows the thermal system feedback block Diagram of D.E.C server room model
17 | P a g e
3.5 Analysis of Controller using Mat lab
R C Step response
TF
num = [0 0.3 ]; 0.5 3 Settling time
% Numerator: s is 8 seconds
den = [1.5 1 ]; %
Denominator: s^2 +
2 s + 10
H = tf(num, den)
>> TFT
H=
0.3
---------
1.5 s + 1
Continuous-time
transfer function.
>> step(H);
>> grid
num = [0 1 ]; % 1 6 30 seconds
Numerator: s
den = [6 1 ]; %
Denominator: s^2 +
2 s + 10
H = tf(num,den)
>> TFT
H=
1
-------
6s+1
Continuous-time
transfer function.
>>step(H)
18 | P a g e
num = [0 2 ]; % 2 4 42 seconds
Numerator: s
den = [8 1 ]; %
Denominator: s^2 +
2 s + 10
H = tf(num,den)
>> TFT
H=
2
-------
8s+1
Continuous-time
transfer function.
>> step(H);
>> grid
>>
>>num = [0 3 ]; 3 4 60 seconds
den = [12 1 ];
H = tf(num,den)
H=
3
--------
12 s + 1
Continuous-time
transfer function.
19 | P a g e
CHAPTER FOUR
SIMULATION USING SOFTWARE
4.1 Software Tools
Benefits
Production-proven performance and superior quality of results
Fully pipelined tape out flow to efficiently utilize expensive hardware resources
The most accurate, easy to use and flexible modeling environment
Senators Lithography rigorous simulation interfaces within Proteus
manufacturing tools
Best cost of ownership through the use of optimized general purpose hardware
Core technology uniquely connects manufacturing information to design
20 | P a g e
Features of Proteus design suit v 8.0
A new application framework lets you view models of Proteus as tabs a single window
or, via drag and drop, as separate windows for a side-by-side view.
A new common parts database enables sharing of information between schematic and
PCB so that changes to data is instantly reflected across the software.
A new live net list means changes to connectivity in the schematic can be instantly
reflected on the PCB, the bill of materials and the design explorer.
4.1.2 MikroC
Software tools Micro C compiler is used to edit and compile C code for PIC16F877A.It is designed
to provide the programmer with the easiest possible solution to developing application for
embedded system. Also help to testing the code. MikroC is a powerful, feature rich development
tool for PIC microcontrollers. The software is written in C‟‟ language using mikroC compiler. The
source program is converted into hex code by the compiler.PIC and C fit together well.PIC is the
most popular 8-bit chip in the world used in a wide variety of application, and C prize for its
efficiency, is the natural choice for developing embedded system. [12]
Features of MikroC
Write C source code using the highly advanced code editor.
Use the included MikroC libraries to dramatically speed up the development, data
acquisition, memory, displays, conversions & communications
Monitor program structure, variables, and functions in the Code Explorer.
Generate commented, human-readable assembly and standard hex Compatible with all
programmers.
Inspect program flow and debug executable logic with the integrated
21 | P a g e
4.2 System Block Diagram
The name PIC initially referred to "Peripheral Interface Controller". A programmable Interface
Controller (PIC) microcontroller is a single chip computer. A programmable interface controller
is also a solid state control system that continuously monitors the status of devices connected as
inputs. Based upon a user written program, stored in memory, it controls the status of devices
connected as outputs. It has the functions of reading the data available at the sensor output, send
the data to the LCD display and operate the other motor in case of any faults in the belt. The
PIC16F877A is one of the PIC Micro families of microcontrollers which are currently popular
among professionals and hobbyists alike. This is because the PIC16F877A is easily programmed
and with the flash memory technology allows up to a thousand re-writes. The superiority of this
22 | P a g e
microcontroller compared with others within its peer group show that the PIC has the speed and
flexibility for many uses, from automotive industries and controlling home appliances to
industrial instruments, remote sensors, electrical door locks and safety devices. It is also ideal for
smart cards as well as for battery supplied devices because of its low consumption. [13]
23 | P a g e
4.3.1.1 General Organization of PIC16F877A Microcontrollers
The PIC16F877A microcontroller is the heart of the entire system. It takes the inputs from the
LM35 temperature sensor to measure the current computer room temperature. This controller
is widely used for experimental and modern applications because of its low price, wide range of
applications, high quality, and ease of availability. and the Microcontroller (PIC16F877A) is a low
power, high performance CMOS 8-bit micro controller with 8kbytes of flash programmable and
256byte of read only memory data (EEPROM). The on-chip flash allows the program memory to
be reprogrammed in-system or by a conventional non-volatile memory programmer. By
combining a versatile 8-bit CPU with flash on a monolithic chip, the PIC16F877A is a powerful
microcomputer, which provides a highly flexible and cost-effective solution to many embedded
control applications. PIC16F877A have 40-pin with each pin has been assigned a number of
functions.
The specific function of a pin is selected by configuring various bits of internal registers.
Microcontroller has a number of input/output pins which are used for connection with external
devices. It has total 40 pins. Out of these 40 pins, 33 pins can be used as input output pins. PIC
16F877 has 5 basic input/output ports. They are usually denoted by PORT A, PORT B, PORT C,
PORT D, and PORT E. these ports are used for input/output interfacing.
24 | P a g e
Where, the figure of chip is shown fig.4.4. By using this controller, the data inputs from the
temperature sensor is passed to the parallel port of the microcontroller and accordingly the
program responds. This microcontroller could be used in controlling the temperature according
to the computer room temperature sensor. Some pins of the I/O ports are multiplexed with an
alternate function from the peripheral features on the device. If a pin is used as any other
function, then it may not be used as a general purpose I/O pin. Here we will just restrict with the
input output features of ports. [14]
Table 2: PIC16F877A port description,
Port Pin number Bit wide(bit)
Port a RA-0 to RA-5 6
Port b RB-0 to RB-7 8
Port c RC-0 to RC-7 8
Port d RD-0 to RD-7 8
Port e RE-0 to RE-2 3
25 | P a g e
input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRIS C bit
(= 0) will make the corresponding PORTC pin an output PORTC is also multiplexed with several
peripheral functions. PORTC pins have Schmitt trigger input buffers.
PORTE has only three pins which are individually configurable as inputs or outputs. These pins
controllable by using its corresponding data direction register “TRISE” and have Schmitt Trigger
input buffers. TRISE register which also controls the Parallel Slave PORT operation. PORTE pins
are multiplexed with analogue inputs. When selected for analogue input, these pins will read as
„0‟s. TRISE controls the direction of the RE pins, even when they are being used as analog inputs.
The user must make sure to keep the pins configured as inputs when using them as analog inputs.
6. MCLR
Master clear (reset) input is connected to pin 1. This pin is an active low to the device. This pin is used to
erase the memory locations inside the PIC (i.e. when we want to re-program it).In normal use it is
connected to the positive supply rail.
26 | P a g e
Features of PIC16f877
Maximum operating frequency is 20MHz
Flash program memory (14 bit words), 8KB
Data memory (bytes) is 368
EEPROM data memory (bytes) is 256
5 input/output ports
3 timers
2 serial communication ports (MSSP, USART)
PSP parallel communication port
10bit A/D module (8 channels) Special features:
27 | P a g e
Fig.4.5 Shows LM35 Temperature Sensor
It is a 3- pin analog temperature sensor which has high precision than mostly available sensors.
The Pin-1 senses the temperature in the surroundings and gives output as a Voltage through Pin2.
The main advantage of using this sensor is that it can be operated at any harsh and extremely hot
climatic conditions. 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. For the calibration of
the temperature sensor, we use the linear modeling approach. As it was used as a basic
temperature sensor, any change in temperature by 1 °C is converted to 10 mV. The maximum
voltage readout of the temperature sensor was 1 V corresponding to 100 °C. This was then used
as a reference in programming the microcontroller. Hence for every 1-degree increase in
temperature there will be a increment of 10m volt in output voltage of LM35 sensor.
PIC16F877A microcontroller is used to measure analog voltage value. [15]
PIC16F877A
LM3 5 Analog signal MC U
sensor
s sensor ADC C chan
h
S nel l
Temperature
28 | P a g e
PIC16F877A microcontroller built in ADC (analog to digital converter) is used to measure analog
voltage. The figure above shows the interfacing between the LM35 sensor and the pic
microcontroller devices. PIC16F877A PORTA has six built in ADC channels. The general equation
used to convert output voltage to temperature is:
Or
Where VT is the supply voltage and Vout, is the output voltage of the LM35 temperature sensor.
Though, from our code, we have declared how this temperature is going to be read and
converted.
In choosing a temperature sensor the following factors are taken into account
30 | P a g e
The LCD has many advantages, such as low consumption, small Volume, rich contents displayed,
delicate and thin etc. It has been widely used in many kinds of meters and other low consumption
systems. It is integrated with PIC16F877A MCU. A liquid crystal display or LCD is combination of
two states of matter, the solid and the liquid. LCD uses a liquid crystal to produce a visible image.
[16] Advantage of LCD‟s:
LCD‟s consumes less amount of power compared to CRT and LED
LCD‟s are consist of some microwatts for display in comparison to some mill
4.3.5 DC motor
It is used to reduce temperature to our desire temperature; the dc motor used in this project is
a Brushless DC motor. The cooling fan starts to operate whenever there is abnormal or a high
temperature is present in the computer room. The operating voltage of the Brushless DC motor
is 8V to 12V. It operates when the LM 35 senses high temperature and initiates the PIC
microcontroller to act accordingly.
31 | P a g e
4.3.6 Motor driver L293D IC
A motor driver is an electrical switch that uses an electromagnet to move the switch from the off
to on position instead of a person moving the switch. Motor drivers are either current amplifiers
or pulse sequencers or both. They are used to drive the motors and prevent the microcontroller
from getting burnt. of that current that’s why we are selected L293D driver IC. We could reduce
the voltage needed to turn off the transistors from12V.The L293D is a 16 pin IC which is known
for their efficiency in controlling DC motors.
4.3.7 Buzzer
Buzzer is an electrical device, which is similar to a bell that makes a buzzing when the room
temperature is above the reference value the buzzer is ON. To interface a buzzer the standard
transistor interfacing circuit is used; because the transistor is used as a switch to control the
buzzer. And power supply must be connected to provide a common reference. If a battery is used
as the power supply, it is worth remembering that Pezos sounders draw much less current than
buzzers. Buzzers also just have one tone, where as a Pezos sounder is able to create sounds of
many different tones.
32 | P a g e
4.3.7 Crystal Oscillators
A quartz crystal determines the frequency at which an oscillator works. When a direct current is
applied, these crystals vibrate at a frequency that depends on its thickness value and on the
manner in which it is cut from the original mineral rock. To determine the frequency, some
oscillators employ combinations of inductors, resistors, and capacitors. But, the use of quartz
crystals gives the best stability (constancy of frequency) in oscillators. In a computer the clock
serves as a sort of pacemaker for the microcontroller. The clock is nothing but a specialized
oscillator. The clock frequency (also called as clock speed) is usually specified in megahertz (MHz)
frequency.
33 | P a g e
4.4 Flow Chart Diagram of the System
34 | P a g e
bidirectional port. That is, it can be configured as an input or an output. The number following
RA is the bit number (0 to 5). So, we have one 5-bit directional port where each bit can be
configured as Input or Output. [17]
Special function register RB0-RB7, and the RB is a second bidirectional port. It behaves in exactly
the same way as RA, except there are 8- bits involved. RC0-RC7 & RD0-RD7, RC & RD are
bidirectional ports. They are 8-bit wide pins. RE0-RE2, 3-bit wide, bidirectional, VSS and VDD,
These are the power supply pins. VDD is the positive supply, and VSS is the negative supply. And
the OSC1/CLK IN and OSC2/CLKOUT, these pins are where we connect an external clock, so that
the microcontroller has some kind of timing. MCLR, this pin is used to erase the memory locations
inside the PIC (i.e. when we want to re-program it). In normal use it is connected to the positive
supply rail. T0CK1, this is another clock input, which operates an internal timer. It operates in
isolation to the main clock.
35 | P a g e
4.6 Circuit Diagram of a system
37 | P a g e
Fig.5.1 Shows Snap Shoot Result of Simulation when temperature is greater than 16‟c
According to our project the fun is driven by DC motor. And this DC Motor is used as a fun to the
purpose of reducing the temperature, if the temperature in the high power computer room is
greater than (16‟C). The heater shows heat generates the heat continuously from the computer
room. The pic microcontroller compared the two temperatures and switches the fun ON since
the room temperature was higher than the reference temperature; and this pic microcontroller
reads the temperature every second and compares it with the reference value. In this case the
reference temperature (16‟C) is first set in the embedded programs. It was observed that when
the room temperature is 16‟C and above, the fan switches on automatically. However, when the
room temperature is below, the fun automatically switches off. And the Liquid Crystal Display
(LCD) is interfaced topic microcontroller to display the temperature value.
38 | P a g e
5.2 Conclusion and Recommendation
5.2.1 Conclusion
The overall aim of this project was to developed automatic temperature control system, for the
high power computer room which consists of thermal systems. When the thermal system was
constructed by observing a real server room at DEC. A mathematical model of the closed-loop
The system uses PIC16F877A microcontroller for the control unit, and LM35 as the temperature
sensor. The output was varied by setting the temperature at various levels and it was discovered
that the Fan was triggered ON when the room temperature was higher than the reference
temperature (160c). And the fun was triggered OFF when the room temperature was lower than
the reference temperature. The system was designed using Proteus 8 and Micro C Software. And
the system was simulated and working according to the design specifications analysis of mat lab.
So this system is very marketable because of its simplicity, low cost, low power consumption.
Limitations
All projects have their own limitations. We have tried our best to achieve the goal but our
project also has some limitations which cannot read negative temperature.
5.2.2 Recommendation
The goal of this project was purposely kept within what was believed to be attainable within the
allotted timeline. As such many improvements can be made upon this initially design the
following recommendations are provided as ideas for future expansion of this project.
39 | P a g e
REFERENCE
[1]. Ogu Emmanuel C., Temperature Control System, department of computer science and
Mathematics school of science and technology Babcock University, Ilishan-Remo, Nigeria ,April,
2011.
[2]. A text book of Richard C. Dorf, Modern Control Systems, University of California, Davis
Twelfth edition
[3]. A text book of Katsuhiko Ogata, Modern Control Engineering Fifth Edition.
[4]. MustafaSaad, Hossam, Automatic Fan Speed Control System Using Microcontroller,
November 2014, Electronics and Civil Engineering, At Cape Town (South Africa)
[5]. Arun Bera, and Sonal Kumar, automatic temperature control with cooling system using
Microcontroller, Department of Electronics and Communication Engineering May, 2011
[6]. Okpagu, P.E. &Nwosu, A.W. Development and temperature control of smart egg incubator
System for various types of egg, University Uli Anambra State, NIGERIA)
[7]. Abubakar Muhammad Auwal, Microcontroller Based Automatic Temperature Controller,
Department of Computer Engineering, Federal Polytechnic Ede, Osun state, Nigeria.2017
[8]. Gaurav S. Ashara1, Dipesh S.Vyas, design and simulation of temperature control of chamber
[9]. A text book of Dr. N.C. Jagan, Control Systems, Second Edition, Retd Professor in Electrical
Engineering University College of Engineering Osmania University, Hyderabad.[10] Control
systems Engineering. J.Nagrath and M.Gopal,third edition,1999,
[11]. Muhammed Ali Mazidi, J. G. (1990). The 8051 Microcontroller and Embedded Systems
[12]. MikroC, “mikroCusermanual” availableatwww.mikroe.com/pdfMikroc/mikroc_manual.pf
[13]. Iovine John- “PIC Microcontroller Project Book”, 2nd Edition, Singapore: McGraw Hill [14].
Muhammad Ali Mazidi- “PIC Microcontroller and Embedded systems”, 3rd edition:
Pearsons Education; 2007
[15]. Ghana ShyamSoren, Temperature Controlled DC Fan using Microcontroller, Department
Of Electrical Engineering National Institute of Technology Rourkela Rourkela – 769008, India
[16]. http://www.embetronicx.com/tutorials/microcontrollers/pic/lcd-interfacing-with-
16F877A/microcontroller
[17]. Embedded systems programming with the PIC16F877 Second Edition by Timothy D.
Green2008 England London
40 | P a g e
APPENDIX
Source code for the PIC16F877A Microcontroller,
//
===================================================================== =====
// Project name: AUTOMATIC TEMPRATURE CONTROL FOR HIGH POWER COMPUTER ROOM
// pin Direction
SbitLCD_RS_Direction at TRISC4_bit;
SbitLCD_EN_Direction at TRISC5_bit;
41 | P a g e
#define HEATER PORTB.RB0
#define ON 1
#define OFF 0
Void main ()
Unsignedinttemp, i;
42 | P a g e
// LOOP OF THE PROGRAME
//
===================================================================== ====
//
=====================================================================
=
// COMPARATION BTWEEN REFERANCE TEMPRATURE AND ROOM TEMPRATURE
//
=====================================================================
=
{
HEATER = OFF;
Fun = ON;
//buzzer=ON;
43 | P a g e
buzz=ON;
If (ActualTemp<16) // If Temp of the Room Industry is less than 14 the room heater is ON
HEATER = ON;
Fun = OFF;
//
===================================================================== ====
//
===================================================================== ====
// Moving Text
Lcd_cmd (_LCD_SHIFT_LEFT);
Delay_ms (50);
} */
}
44 | P a g e