You are on page 1of 48

AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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 ingroup to any other university for similar or any other degree
award.

Name Signature Date

1. _________________ _____/____/_____

2. _________________ _____/____/_____

3. _________________ _____/____/_____

4. _________________ _____/____/_____

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page i


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

ACKNOWLEDGMENT
We have great pleasure to convey our gratitude to DEPARTMENT OF ELECTRICAL AND
COMPUTER ENGINEERING for permitting us to do this final project. We express our
profound sense of gratitude to our internal guide ASH P for his valuable Guidance. Last but not
the least our special thanks to our friends for their support and constant Encouragement during
the project work.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page ii


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Table of content

DECLARATION AND COPYRIGHT..........................................................i


ACKNOWLEDGMENT ........................................................................................ ii

Table of content ...................................................................................................... iii

LIST OF FIGURE ................................................................................................. vi

LIST OF TABLES ................................................................................................ vii

ABSTRACT ........................................................................................................... viii

CHAPTER 1 ........................................................................................................1

INTRODUCTION1
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 ....................................................................................................................... 2
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 Methodologies..................................................................................................................................... 3
1.6.1 Source of data .............................................................................................................................. 3
1.6.2 Data collection instruments .......................................................................................................... 3
1.7 Application area .................................................................................................................................. 4
1.7.1 Thesis Outline .............................................................................................................................. 4

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

LITERATURE REVIEW ..................................................................................5


2.1 Server Room Overview....................................................................................................................... 5

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page iii


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

2.2 Temperature Control System .............................................................................................................. 5


2.3 PWM (Pulse Width Modulation) ........................................................................................................ 6
2.3.1 Using PWM on a micro controller ............................................................................................... 7
2.4 RESISTORS ....................................................................................................................................... 8
2.5 Transformer......................................................................................................................................... 8
2.6 Rectifier............................................................................................................................................... 9
2.7 CAPACITORS (SMOOTHING) ...................................................................................................... 10
2.8 Voltage regulator .............................................................................................................................. 10
2.9 Transistors ......................................................................................................................................... 11

CHAPTER 3 ......................................................................................................13

METHODOLOGY AND SYSTEM DESIGN................................................13


3.1 METHODOLOGY ........................................................................................................................... 13
3.2 SYSTEM DESIGN ........................................................................................................................... 13
3.2.2 Description of the Circuit ........................................................................................................... 14
3.2.3 Working principle of the system ................................................................................................ 14
3.3 General Block diagram ..................................................................................................................... 15
3.3.1 Power Supply ............................................................................................................................. 16
3.3.3 Temperature sensor LM35 ......................................................................................................... 19
3.3.4 LCD Display .............................................................................................................................. 21
3.3.5 DC Fan motor ............................................................................................................................ 24
3.3.7 KEYPAD ................................................................................................................................... 24

CHAPTER 4 ......................................................................................................26

RESULTS AND DISCUSSION .......................................................................26


4.1 Flow Chart ........................................................................................................................................ 27
4.2 Software Simulation Results and Discussions .................................................................................. 28

CHAPTER 5 ......................................................................................................33

CONCLUSION AND RECOMMENDATIONS............................................33


5.1 Conclusion ........................................................................................................................................ 33

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page iv


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

REFERENCES..................................................................................................34

APPENDIX ........................................................................................................35

CODE .................................................................................................................35

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page v


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

LIST OF FIGURE
Figure2.3.1: Variable width pulse train ........................................................................................7
Figure2.5.1:transformer ...............................................................................................................14
Figure 2.6.1: Full Wave Rectifier (Bridge Rectifier) and Wave Form........................................14
Figure 2.7.1: Capacitor charging and discharging.......................................................................15

Fig.2.9.1: Simple circuit showing the labels of a Bi-polar Transistor .........................................16

Fig 2.9.2 An NPN Transistor acting as static a switch..................................................................17

Figure 3.2.1.1 General circuit diagram of the system...................................................................18

Figure 3.3.1 general block diagram of the system........................................................................19

Figure3.3.1.1 circuit diagram of power supply module................................................................21

Figure.3.3.2.1: PIC Microcontroller..............................................................................................22

Figure.3.3.2.2: pin diagram of PIC18F45K22IC Microcontroller...............................................22

Figure3.3.4.1: Diagram of LCD.................................................................................................26

Figure 4.1.1 System flow char......................................................................................................33


Figure 4.3 Circuit diagram of the simulation…….....................................................................38

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page vi


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

LIST OF TABLES
Table3.3.4.1: LCD pin connection description ......................................................................27

LIST OF ACRONYMS

Ac: alternate current


ADC: analog to digital converter
AT: attention
C: capacitor
D: duty cycle
DC: direct current
EMF: electromagnetic filed
F: frequency
GPRS: global positioning remote service
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
PWM: pulse width modulation
RF: ripple factor
RX: receiver
SIM: subscriber identification module
SMS: short message service
SPI: serial peripheral interface
TTL: transistor transistor logic

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page vii


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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 will be
developed.
The output from the Microcontroller is a PWM digital output; there by connected to a transistor
to control the Fan speed. Simply it turns the motor on and off to saturate the calculated duty
cycle.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page viii


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 1


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

CHAPTER 1
INTRODUCTION
1.1Background
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. When the current temperature is below the lower limit
of the desired if it is in the first upper limit 25°C to 40°C, the server room is cooled using a
fan.When the current temperature is within the desired range, no control action is needed. The
current temperature of the room must be continuously displayed on the LCD. In addition the
controller should use LEDs to indicate the current state of temperature in the server room. [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 mainobjective of our project is to design and implement an automated temperature control
system for the server room.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 1


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

1.3.2 Specific objectives


To design DC power supply for the components that we used

To configure or fault announcement for the concerned person

To design PWM for fan motor control using programming

1.4 Significance of the study


This project is an innovative prototype integrates of electric fan with smart characteristics; this
system uses a microcontroller to produce an automation function. 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 is really practical for
senior citizens 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.5Scope and limitation of the study


1.5.1Project 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

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

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 2


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

1.6 Methodologies
We use different methods for doing our final thesis project. These are:-

Different websites

Asking our friends

Reading different textbook

Asking our advisor

1.6.1 Source of data


Textbook

Websites

1.6.2 Data collection instruments


Some of the information used was obtained from the sources below, which are all secondary
form of data collection.

The Internet: when gathering information on control system, the internet played a very
important role. This is because one can get the latest and up to date information on almost
anything at all on the network. I was able to get almost all the relevant information needed on the
internet. Surfing the internet for this topic gave me data on things like the origin of
microprocessor, microcontrollers and how they have improved our technology and our lives over
the years.

Libraries: information on this topic was also gotten in different kinds of books on different
topics. Some of the kinds of books which we used in our research were books on electronics,
magazines on the latest kind of technologies. Etc.

System Analysis

Analysis involves a detailed study of the current system, leading to specifications of a new
system. Analysis is a detailed study of various operations performed by a system and their
relationships within and outside the system. This is the total analysis given to all the data
obtained during the cause of this project design. The reason for this analysis is to have the best

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 3


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

possible design or the close adaptive designed principle for achieving my own project. These
analyses have been done to ascertain correct and best design. This system analysis was employed
in selecting the best design module and in calculating the component for the system. Because of
the nature of country we are in, system analysis will help in order to engage the available
component in our design.

1.7 Application area


Our project can be applicable for:

Server room

Research lab

Green house

1.7.1 Thesis Outline


This thesis 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 indesign systems. These are microcontroller, sensor, LCD displays,
and drivercircuit and output devices. Chapter 4 explains the development of the software and
system operation. This chapter also includes the flowchart of the system. Chapter 5 summarizes
the overall conclusion for this thesis and a few future recommendations.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 4


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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. Although this seems
a wide range these are the extremes and it is far more common to keep the ambient temperature
around 20- 21°C. [3]

2.2 Temperature Control System


This project use PIC18F45K22 microcontroller to control NPN power transistor (2N2222)
further drive fans and LEDs as well as control the speed of the fan when the certain temperature
was detected by temperature sensor that placed at a server room. The value of temperature
always displayed on a LCD screen. The speed controlling method of fan is mainly based on
PWM technique which is generated by PIC micro controller. This project uses LM35
temperature sensors that can be measured environmental temperature value.The system uses the

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 5


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

modern way of fault notification on fan operation based on the modem application through
phone number of concerned person to do so.

2.3 PWM (Pulse Width Modulation)


There are different methods of speed control for DC fan motor. Among these we select the PWM
method. Pulse-width modulating (PWM) the fan directly involves turning the fan's power supply
on and off at a fixed frequency. Fan speed control is useful for increasing the reliability,
increasing lifetime of fan reducing the power consumption, and decreasing the noise of systems.
Duty-cycle adjustments are made to control the speed of the fan. The larger the duty cycle, the
faster the fan spins. Choosing the appropriate frequency for this method can be somewhat tricky.
If the frequency of the PWM signal is too slow, the fan's speed will noticeably oscillate within
aPWM cycle. Using PWM with the fan and therefore the internal commutation electronics too
quickly can cause the internal commutation electronics to cease functioning correctly. As with all
things, applying PWM directly has its advantages and disadvantages. The advantages include a
very simple drive circuit, good startup characteristics, and minimal heat dissipation in the pass
transistor. The disadvantages involve increased stress on the fan. But even with these
negatives,PWM control can be the appropriate solution in low-cost noncritical applications.
PWM is a very powerful technique that reduces the cost and time by digitalizing the analog
signals means either on or off, where PWM is monitoring by encoding the input and decoding
the output of the system, to manage analog device/devices. The duty cycle represents a ratio
between the ON time and the Total time. This could be simplified to the following equations.

𝑇𝑜𝑛
𝐷= ; 𝑇 = 𝑇𝑜𝑛 + 𝑇𝑜𝑓𝑓 ............................................................... (2.1)
𝑇

Where D is duty cycle

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 6


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Figure2.3.1: Variable width pulse train

PWM is a mechanism for generating an output signal that repeats periods between logic high and
low. We can control the duration of the high and low signal in accordance with what we
want.Duty cycle is the percentage of high signal period and the period of the signal and this
percentage will be directly proportional to the average voltage generated.

2.3.1 Using PWM on a micro controller


Pulse Width Modulation or PWM is a technique for supplying electrical power to a load that has
a relatively slow response. The supply signal consists of a train of voltages pulses such that the
width of individual pulses controls the effective voltage level to the load. Both AC and DC
signals can be simulated with PWM. The PWM pulse train acts like a DC signal when devices
that receive the signal have an electromechanical response time that is slower than the frequency
of the pulses. For a DC fan motor, the energy storage in the motor windings effectively smooth’s
out the energy bursts delivered by the input pulses so that the motor experiences a lesser or
greater electrical power input depending on the widths of the pulses. The formula below shows
the voltage signal comprised of pulses of duration Ton that repeat every units of time. The output
of a PWM channel is either Vs volt during the pulse or zero volts otherwise. If this signal is
supplied as input to a device that has a response time much larger than, the device will
experience the signal as an approximately DC input with an effective voltage of

𝑉𝑒𝑓𝑓 = 𝑉𝑠 𝑇𝑜𝑛 /𝑇 .............................. (2.2)

The ratio Ton/Tis called the duty cycle of the square wave pulses. The effective DC voltage
supplied to the load is controlled by adjusting the duty cycle. On a PIC micro controller, PWM
output is possible on digital I/O pins 3, 5, 6, 9, 10 and 11. On these pins the analog Write
function is used to set the duty cycle of a PWM pulse train that operates at approximately 500
Hz. Thus, with a frequency fc = 500 Hz, the period is T = 1/fc ~2ms. As with conventional
HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 7
AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

digital I/O, the pin Mode function must be called first to configure the digital pin for output. The
digital output voltage of a micro controller is either 0 V or 5 V. Thus, in Equation (1), Vs = 5 V.
The PWM output level with the analog Write is an 8-bit value that corresponds to an effective
voltage range of 0 to 5 V. The special pins on the on micro controller like pin3.5, 6,9,10 and 11
are for the PWM operation. Equation (2.3) depicts the relationships between the PWM output
parameters. Thus,

𝑃𝑊𝑀 − 𝑜𝑢𝑡 − 𝑙𝑒𝑣𝑒𝑙 = 255 × 𝑇𝑜𝑛 /(𝑇𝑜𝑛 + 𝑇𝑜𝑓𝑓 ) ................................................... (2.3)

Therefore,

𝑃𝑊𝑀 − 𝑜𝑢𝑡 − 𝑙𝑒𝑣𝑒𝑙 = 255 × 𝑉𝑒𝑓𝑓 /𝑉𝑠 ................................................................ (2.4)

Since VS = 5V always for routine calculation

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 SIunit 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 transformers 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
voltage. The input coil is called the primary and the output coil is called the secondary. There is
HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 8
AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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

Figure2.5.1Trannsformer

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

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 9


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Figure 2.6.1 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
output.

Figure 2.7.1Capacitor charging and discharging.

2.8 Voltage regulator


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

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 10


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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. Avoltage 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]

Fig.2.9.1Simple 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 labeledbase, collector and emitter. A small current at the base terminal

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 11


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

(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

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 rises, 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.

Fig 2.9.2 An NPN Transistor acting as static a switch

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.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 12


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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.

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.3.2.1 Circuit diagram developed

Figure 3.2.1.1 General circuit diagram of the system

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 13


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

3.2.2 Description of the Circuit


We made this project because we wanted a way to automatically control and measure
temperature through fan and sensor and controls speed of a DC fan according to the temperature
read by a LM35 sensor. We used an LCD shield to display the current temperature and speed of
the fan, but we can use the circuit without the LCD display. 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 (Vbe) of 1V that
we find from the data sheet and a 12V DC to provide power to the fan and transistor. The LM35
temperature sensor 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 diode has been placed the
wrong way around on the circuit. The white stripe on the diode normally goes to ground. Power
will flow from the positive side to the negative side. As we have it the wrong way around no
power will flow down it at all. As we have it across the C and E legs of the transistor this will not
impede current flow at all. However, if the motor were to produce a “back EMF” and send
current back down the wire, the diode will act as a valve and prevent it from doing so. The diode
in our circuit is therefore put in place to protect your micro controller.

3.2.3 Working principle of the system


We set the pins for the sensor, LED, LCD, 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 fan starts to spin and tempMax is the temperature at which the fan reaches its maximum
speed. For example if we set tempMin at 20 and tempMax at 40 then the fan will start spinning at
20°C and reach its maximum speed at 40°C.We store the temperature value in the temp variable
and then use some if() functions to check if temp is lower than tempMin and if so let the fan OFF
(LOW). The next if () is to check if temperature is higher than the minTemp and lower than the
tempMax and if so then use the map() function to re-map the temp value from one value to
another. In our case fan Speed will have a value of 32 at tempMin and 255 at tempMax. These
values are used to control the speed of the fan using PWM and the analog Write().The fan LCD
re-maps the temp to allow the display of fan Speed in a 0 to 100% range so we can say that the
speed of the fan is directly dependent of the LM35′s temperature. When the temperature reaches
HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 14
AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

the value set in tempMax the fan will be at its maximum spinning velocity and the LCD will
display FANS: 100% even though the temperature might increase above tempMax. But after
some negotiation of temperature increased set the variable gab which is the difference between
current reading temperature and the maximum set temperature. Then we some if() functions to
check is greater than 2 units of temperature, 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

TEMPER POWER FAN


ATURE
SENSOR SUPPLY

KEYPA
LCD
D
PIC
DISPLAY
18F45K22

LED

Figure 3.3.1 general block diagram of the system

Block diagram description

The basic blocks of the System include the following blocks; Temperature Sensing circuit, PIC
microcontroller, LED, LCD Display, Fan, and keypad. The temperature Sensor detects the
HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 15
AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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 current temperature. The LCD display used is
a 16x2 Alphanumeric Display. The microcontroller generates PWM signal according to the
temperature. The speed of the fan and fan heater are controlled by the ON time of the PWM
generated. With increasing ON time, the speed of the fan increases while the fan heater is
inverse, thus controlling the temperature of the system.

3.3.1 Power Supply


This circuit consists of the following component:-

Transformer

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.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 16


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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)
forobtaining 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
regulatesthis voltage to obtain a steady 12V DC. The output of the IC1 will be regulated by the
IC2 toobtain a steady 5V DC at its output. In this way both 12V and 5V DC are obtained. Such a
circuits very useful in cases when we need twoDC voltages for the operation of a circuit.

Figure3.3.1.1 circuit 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 forIC1.

Current rating Ic = 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.3.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

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 17


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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 bymicrochip’s high-
density non-volatile memory technology. The on-chip Flash allows the program memory to
bereprogrammed 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 application.

Figure.3.3.2.1: PIC 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.

RAMfor data storage.

ROM, EEPROMor Flash memory for program storage.

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

High performance

Wide operating voltage range (2.0-5.56)volts

High sink or source current (25mA)


HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 18
AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Commercial, industrial and extended temperature range. [6]

Figure.3.3.2.2: pin diagram of PIC18F45K22IC Microcontroller. [7]

3.3.3 Temperature sensor LM35


The LM35 series are precision integrated-circuit temperature sensors, with an output voltage
linearly proportional to the Centigrade temperature. This LM35 has advantage over the linear
temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant
voltage from the output to obtain convenient Centigrade scaling. Low cost is assured by
trimming and calibration. The low output impedance, linear output, and precise inherent
calibration of the LM35 make interfacing to readout or control circuitry especially easy. The

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 19


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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 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
10mv.e.g like150 ° C = 1500mV and -40 ° C =-400mV.LM35 does not need for external
trimming to give accuracies of ±1⁄4 at room temperature and ±3/4℃overa full −55 to +150°C
temperature range. It can be easily useable for single supplies of power and it has also comfort level at
minus supplies. Values that the LM35sensor 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
𝑐𝑒𝑙𝑠𝑖𝑢𝑠 = 𝑝𝑜𝑤𝑒𝑟 𝑠𝑢𝑝𝑝𝑙𝑦 𝑣𝑜𝑙𝑡𝑎𝑔𝑒 ∗ 𝑖𝑛𝑝𝑢𝑡 𝑓𝑟𝑜𝑚 𝑠𝑒𝑛𝑠𝑜𝑟 ∗
210

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. If the 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 ispossible 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

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 20


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

output voltage than thermocouples and does not require that output voltage is
amplified.

3.3.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
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]

Figure3.3.4.1: Diagram 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

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 21


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

modes of interfacing one for4 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
designed to allow switching without requiring the lower four data pins. If it is in4 bit mode,

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 22


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

character and control data is transferred as pairs of 4 bit "nibbles" on the upper data pins, D4-D

Table3.3.4.1: LCD pin connection description[4]

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 23


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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.

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.3.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
aDC 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]

3.3.7 KEYPAD

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 24


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Keypad is connected to PORTB. The‘* ‘key of the keypad is used to clear the value entered
during the temperature setup and the ‘# ‘key is used to ENTER (save) the setting. The heater and
the fan are controlled using transistors and relays connected to pins RD0 and RD1 of the
microcontroller respectively. [1]

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 25


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

CHAPTER 4
RESULTS AND DISCUSSION
ALGORITHM

1. Initialize Ports, LCD Input.

2. Display project name on LCD.

3. Clear LCD.

4. Display set temperature from keypad on LCD.

5. Read Analog Voltage Value from Temperature Sensor on AN0 of PIC.

6. If Temperature <= Inserted Temperature from keypad then

6.1. Switch OFF LED

6.2. Switch ON FAN

7. If Temperature >Inserted Temperature from keypad

7.1. Switch ON LED

7.2. Switch OFF FAN and control its speed using PWM generation

8. Repeat Steps 5 to 7 infinitely.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 26


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

4.1 Flow Chart

Figure 4.1.1system flow chart

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 27


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

4.2Software Simulation Results and Discussions


Components that we use:

PIC 18F45K22 microcontroller

LM35 temperature sensor

DC fan motor (12VDC, )

LCD (16× 2)

LED (2.2V,10mA)

Transistor (2N2222)

Virtual terminal instead of GSM (9600baud rate,8data bit,1stop bit,Tele type )

Resistors (200Ω,330Ω)

Diode (1N4007)

Software’s used for the system designed were:

Proteus

MicroC PRO

Software Design

In this part 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.0 professional is used for user interface purpose and for monitoring the
controlling algorithms of the system.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 28


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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]

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.We have three cases in our Circuit diagram to obtain:

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 29


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Case1: when temp (current reading temperature) is greater than the set value (a)

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 30


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Case2: when temp (current reading temperature) is equal to set value(b)

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 31


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Case3: when temp (current reading temperature) is less than the set value(c)

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 32


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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 speed with respect to temperature sensor.
The temperature sensed was mapped to equivalent speed through the ADC (analogue to digital
converter) in the software designed. In that case if every fault occurred on the fan, there will be
notifications about that error for the authorized person. The temperature values andcorresponding
speed of fan is expected to be displayed on the LCD continuously. The system developed was
successfully automatic to control the temperature in server room in such it uses the PWM
algorithm, in what there is no need of human intervention. The system can also be used for not
only server room by initializing the temperature minimum and temperature maximum 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 in
efficient 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.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 33


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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.

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 34


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

APPENDIX
CODE
*Project name: Automatic Temperature Control

*/

// Keypad module connections

charKeypadPort at PORTB;

// End Keypad module connections

// 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;

sbitLCD_RS_Direction at TRISD4_bit;

sbitLCD_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 LED PORTD.RD3

#define VIRTUAL PORTD.RD(5,6)

#define ENTER 15

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 35


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

#define CLEAR 13

#define ON 1

#define OFF 0

void main () {

unsigned short kp,Txt[14];

unsigned short TempMax; //referance Temperature

unsigned char inTemp,inTem;

unsignedint temp;

intmV,TempMin;

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)

Keypad_Init(); // Initialize Keypad

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;

// ON startup, read the referance Temperature from the keypad

START:

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 36


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

Lcd_cmd(_LCD_CLEAR); // clear display

Lcd_Out(1,1, "Enter Temp Max");

TempMax = 0;

TempMin = 0;

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

while(1)

do

Kp = Keypad_key_click(); // store key code in kp variable

while(!kp);

if ( kp == ENTER)break;

if ( kp>3 &&kp<8 )kp = kp-1;

if ( kp>8 &&kp<12) kp=kP-2;

if (kp == 14) kp=0;

if (kp == CLEAR)goto START;

Lcd_Chr_Cp(kp + '0');

TempMax=(10*TempMax) + kp;

Lcd_cmd(_LCD_CLEAR); // clear display

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

intTostr(TempMax,Txt); //convert to string

inTemp = Ltrim(Txt);

Lcd_Out_Cp(inTemp); // Display Tem_Ref

Lcd_Out(2,1, "press # to cont.");

// wait until # is pressed

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 37


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

kp=0;

while(kp!= ENTER)

do

kp =keypad_key_click(); // store key code in kp variable

while(!kp);

Lcd_cmd(_LCD_CLEAR); // clear display

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

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

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

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

Txt[4] = 0;

Lcd_Out(2,7,Txt);

Lcd_Out(2,1, "Temp");

Lcd_Out(2,12, " ");

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

inTemp = Ltrim(Txt);

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 38


AUTOMATIC TEMPERATURE MEASUREMENT &CONTROL SYSTEM FOR SERVER ROOM

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

Lcd_Out(1,11, inTemp);

if (TempMin<TempMax)

Lcd_Out(1,1, "FANspeed Min ");

FAN = ON;

LED = OFF;

if (TempMin==TempMax)

Lcd_Out(1,1, "FANspeed Max: ");

FAN = ON;

LED = OFF;

if(TempMin>TempMax)

FAN = OFF;

LED = ON;

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

HARAMAYA UNIVERSITY ELECTRICAL AND COMPUTER ENGINEERING 2016 Page 39

You might also like