0% found this document useful (0 votes)
58 views90 pages

A Dissertation Submitted To The Department of Mechanical/Biomedical Engineering, College of Engineering, Bells University of Technology, Ota

This document describes a dissertation submitted by Otepola Adeleye Adeolu to the Department of Mechanical/Biomedical Engineering at Bells University of Technology in partial fulfillment of the requirements for a Bachelor of Engineering degree. The dissertation involves the design and construction of an automatic room temperature controller. It includes declarations, certifications, dedications, acknowledgements, tables of contents, lists of tables and figures, and describes the objectives, scope and significance of the project.

Uploaded by

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

A Dissertation Submitted To The Department of Mechanical/Biomedical Engineering, College of Engineering, Bells University of Technology, Ota

This document describes a dissertation submitted by Otepola Adeleye Adeolu to the Department of Mechanical/Biomedical Engineering at Bells University of Technology in partial fulfillment of the requirements for a Bachelor of Engineering degree. The dissertation involves the design and construction of an automatic room temperature controller. It includes declarations, certifications, dedications, acknowledgements, tables of contents, lists of tables and figures, and describes the objectives, scope and significance of the project.

Uploaded by

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

DESIGN AND CONSTRUCTION OF AN AUTOMATIC

ROOM TEMPERATURE CONTROLLER

A DISSERTATION SUBMITTED TO THE DEPARTMENT OF


MECHANICAL/BIOMEDICAL ENGINEERING,
COLLEGE OF ENGINEERING,
BELLS UNIVERSITY OF TECHNOLOGY, OTA

IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE


DEGREE OF BACHELOR IN ENGINEERING {B.ENG}

BY
OTEPOLA, ADELEYE ADEOLU
2011/2126

JUNE, 2016

1
DECLARATION
I, OTEPOLA ADELEYE, of the department of Mechanical Engineering, College
of Engineering, Bells University of Technology, Ota hereby declares that this
dissertation titled ” Design and Construction of an Automatic Room Temperature
Controller” submitted by me in partial fulfillment of the requirements for the
degree of Bachelor in Engineering (B.Eng.) is my original work. It has never been
submitted in part or in whole for the award of a degree. Wherever contributions of
other are involved, efforts have been made to indicate them clearly with due
reference to the literatures.

________________________ ______________________

Signature Date

2
CERTIFICATION
DESIGN AND CONSTRUCTION OF AN AUTOMATIC
ROOM TEMPERATURE
CONTROLLER

BY
OTEPOLA, ADELEYE ADEOLU
2011/2126

______________________ _____________________
Supervisor’s signature Date
Mr. O.P Fidelis

______________________ ______________________
Head of Department’s Signature Date
O.B Fakehinde (R. Eng. COREN)

______________________ ______________________
External Examiner Date
Dr J.S Ajiboye

3
DEDICATION
This work is dedicated to God Almighty, the untaught teacher for His guidance, grace and mercy
throughout my academic journey. I also wish to dedicate this project to my awesome parents
Babaijo Ade Otepola and Dr. Mrs. M.D Otepola for their moral and financial support during my
entire University degree. It’s always being you from the start.

4
ACKNOWLEDGEMENT
Father, I thank you for the grace to reach this level, every step on the way have always being a
divine help from you. I would not have made It this far. Thank you Jesus for this awesome
achievement.

I acknowledge my supervisor, Mr. Fidelis O.P, thank you sir for your kind and meticulous
review of my project work, also my H.O.D and mentor, Engineer O. Fakehinde, my other
lecturers, Mr. Wole Oke, Mr. Philip Adewuyi, Mr. Olayiwola. Moreso to my awesome Mr.
Charles Dele Ajibola (uncle D), thank you so much for your assistance and moral support in
making this work become reality.

To my adorable parents, I cannot thank you well enough for this great sacrifice you have given
me and my sisters, Abby and Ope, love you girls.

Lastly my brothers, the journey started from 100 level and still goes on, George, Daniel,
Alhassan, Deji, Bagshaw, Femi, Folu, Evey, Rasheed, Okezie, Mchenry, Kumane, and Kimalex.
My adorable gorgeous Ifeoma, thank you for always been there, making me happy, your
encouragement, helping me carry on when distressed, I love you. To everyone who have helped
me on this academic work, thank you and I love you all.

5
TABLE OF CONTENTS

DECLARATION ii
CERTIFICATION iii
DEDICATION iv
ACKNOWLEDGEMENT v
TABLE OF CONTENTS vi
LIST OF TABLES vii
LIST OF FIGURES viii
ABSTRACT ix
CHAPTER 1 1
INTRODUCTION 13
1.1 Problem statement 13
1.2 Objectives 14
1.3 Scope of Study 14
1.5 Significance of the Project 14
1.4 Operational definition of key terms 15
1.5 Brief overview of Dissertation 16
CHAPTER 2 17
LITERATURE REVIEW 17
2.1 Introduction 17
2.2 Automatic Room Temperature Controller 17
2.3 Room Temperature 25
2.4 A Brief History of Temperature 26
2.5 Temperature and Its Measurement 28
2.5.1 Empirical Relations between Temperature and Thermometric Property 29
2.5.2 Method Used Before 1954 30
2.5.3 Method in Use After 1954 32
2.6 Temperature Control 33
2.6.1 Control loops 33
2.6.2 Energy balance 34
2.7 Temperature Control System 34
2.7.1 On-Off Control 35

6
2.7.2 Linear Control 35
2.7.3.1 Under-damped furnace example 37
2.7.3.2 Over-damped furnace example 37
2.7.4 PID Control 38
2.7.5 Fuzzy Logic 42
2.8 The First Automated Temperature controller 43
CHAPTER 3 45
METHODOLOGY 45
3.1 Introduction 45
3.2 Planning 46
3.2.1 System Design 46
3.2.2 System Design Operation 48
3.3 Hardware and Software Components/Requirements 50
3.3.1 Temperature Sensor 50
3.3.2 Microcontroller Module 51
3.3.3 Serial Liquid Crystal Display (LCD) 53
3.3.4 Other Electronic Components Module 54
3.3.5 Buzzer Module 58
3.3.6 The GSM Communication Module 58
3.3.7 SMS Network 61
3.4 Construction 61
3.4.1 The Electronic and Control Design 61
3.4.2 Analysis 62
3.4.3 Implementation 62
3.4.4 Mechanical Design 65
CHAPTER 4 67
IMPLEMENTATION, TESTING, EVALUATION AND RESULT 67
4.1 Introduction 67
4.2 System Implementation and Mathematical Modelling 67
4.2.1 Temperature Sensor 67
4.2.3 Programming the PIC Microcontroller 68
4.2.4 GSM module Construction 69
4.2.5 The Buzzer 71
4.2.6 Transformer 71

7
4.3 Evaluation 72
4.3.1 Design Algorithm of Fuzzy logic for the Room Temperature 72
4.4 Testing 79
4.4.1 Circuit Design Test 79
4.4.2 Program/Code Test 80
4.4.3 GSM Module test 80
CHAPTER 5 82
CONCLUSION AND RECOMMENDATION 82
5.1 Introduction 82
5.2 Achievement 82
5.3 Challenges 83
5.4 Recommendation 83
5.5 Conclusion 83
REFERENCE 84
APPENDIX 86

8
LIST OF TABLES
Table 2.1: Types of thermometers and their thermometric properties……………………….29

Table 2.2: Comparison of Temperature scale ………………………………………………33

Table 2.3: Membership functions for the current Temperature………………………………43

Table 3.1: Breakdown of Components that make up each System………………………….47

Table 4.1: Membership functions for the temperature……………………………………….72

Table 4.2: Membership functions for heat intensity………………………………………....73

Table 4.3: Membership functions for fan speed……………………………………………..74

Table 4.4: Rule base of the Fuzzy logic……………………………………………………...75

9
LIST OF FIGURES
Figure 2.1: Simulation Diagram of the System…………………………………………………20

Figure 2.3: Block diagram of a Room Temperature and Humidity Controller………………...22

Figure 2.4: Simulink Model using PID Controller……………………………………………..24

Figure 2.5: Diagram of a Celsius and Fahrenheit scale………………………………………...32

Figure 2.6: Ideal feedback model……………………………………………………………….35

Figure 2.7: Diagram of a Proportional Control…………………………………………………36

Figure 2.8: Block diagram of a PID Controller…………………………………………………38

Figure 2.9: Block diagram of a closed loop temperature control system……………………….39

Figure 2.10: Block diagram of a continuous parallel PID Controller…………………………..41

Figure 3.1: Methodology flowchart…………………………………………………………….45

Figure 3.2: Block diagram of the system……………………………………………………….46

Figure 3.3: Flowchart Design…………………………………………………………………...49

Figure 3.4: LM35 Temperature Sensor…………………………………………………………50

Figure 3.5: Pictorial Symbol of PIC16F877A Microcontroller…………………………………51

Figure 3.6: Pin out of PIC16F877A Microcontroller………………………………………….....52

Figure 3.7: Typical Programming Communication System……………………………………52

Figure 3.8: In Circuit Serial Programming (ICSP)………………………………………………53

Figure 3.9: Serial LCD…………………………………………………………………………..54

Figure 3.10 LED…………………………………………………………………………………54

Figure 3.11: Resistor……………………………………………………………………………..55

Figure 3.12: Capacitor…………………………………………………………………………..55

Figure 3.13: Transistor………………………………………………………………………….56

Figure 3.15: Diode……………………………………………………………………………….56

Figure 3.16: Voltage Regulator…………………………………………………………………..57

Figure 3.17: Buzzer………………………………………………………………………………58

10
Figure 3.18: GSM SIM900 Hardware Description………………………………………………59

Figure 3.21: Serial port/DB9 Connector…………………………………………………………59

Figure 3.22: Sim Card Slot………………………………………………………………………60

Figure 3.23: Power On/Off and GSM on Switch………………………………………………..60

Figure 3.24: Circuit Diagram on Proteus VSM………………………………………………..63

Figure 3.25: PIC Programmer……………………………………………………………………64

Figure 3.26: Front view of the model house …………………………………………………….66

Figure 3.27: Side view of the model house………………………………………………………66

Figure 3.28: Roof Compartment of the model house………………………………………….66

Figure 4.1: Inserting the SIM Card into the SIM card slot……………………………………..69

Figure 4.2: Power On/Off and Module On/Off process………………………………………....70

Figure 4.3: GSM Module with RS232 Cable Connection………………………………………70

Figure 4.4: GSM Module with serial to USB converter via RXD, TXD and GND connection…70

Figure 4.5: Connecting wires to CP2102 module ………………………………………………71

Figure 4.6: plot of Membership functions for the temperature…………………………………..73

Figure 4.7: Plot of Membership functions for heat intensity……………………………………74

Figure 4.8: Plot of Membership function for fan speed………………………………………..75

Figure 4.9: Rule Editor of the Room temperature Controller……………………………………77

Figure 4.10: Matlab rule Viewer…………………………………………………………………77

Figure 4.11: Graph of the Temperature against the fan speed………………………………….78

Figure 4.12: Graph of the Temperature against heat intensity …………………………………78

Figure 4.13: Showing Component Connections………………………………………………..79

11
ABSTRACT
Temperature Control is a process to maintaining temperature at a desired level. The demand

for an accurate temperature control is seen in different areas of industries and building spaces. In

a scenario where the room becomes too hot or too cold, it is said the cooling and heating device

are in an uncontrolled state. Hence this project aims to design and construct an automatic room

temperature controller to regulate the temperature of a room.to address the problem, the room

temperature is being controlled automatically by turning on the cooling device when the room

gets hot and turning on the heating device when the room gets cold. In support, an alarm system

is been added to alert the user when there’s an abnormal rise in temperature in case of a potential

fire outbreak. The design is been programmed using Flowcode and simulated using Proteus.

Fuzzy Logic is also used to evaluate the work since it is a better controller in making designs

accurate. The result shows that the controller is able to follow the input reference and the output

response of Fuzzy control has better performance. The result obtained from the process shows

the temperature is controlled effectively and more accurate. The Automatic Room Temperature

Controller was able to regulate the temperature of a room.

12
CHAPTER 1
INTRODUCTION
Nowadays, the demand for accurate temperature control and air ventilation control has
conquered many of industrial domains such as process heat, alimentary industry, automotive,
industrial spaces or office buildings where the air is cooled in order to maintain a comfortable
environment for its occupants. One of the most important concerns involved in heat area
consist in the desired temperature fruition and consumption optimization. To fulfill such a
challenge one should promote suitable control strategies (Leverda B et al, 2010).

Room temperature (also referred to as ambient temperature) is a common


term to denote a certain temperature within enclosed space at which humans are accustomed.
Room temperature is thus often indicated by general human comfort, with the common range of
22°C (71.6 °F) to 28°C (82.4 °F), though climate may acclimatize people to higher or lower
temperatures (ABD Halim Bin Zakaria,2011). For human comfort, desirable room temperature
greatly depends on individual needs and various other factors. Because of changing effect of
temperature, an automatic control room temperature is needed to solve the problem of
uncomfortable for human life.

1.1 Problem statement


The project idea is derived from a scenario in which A/C devices need to be turned off during
extreme cold and turned on when the room gets hot. The function is uncontrolled and must be
manually turned on and off. Sometime it can lead to high usage of electricity which in turn raises
the electricity bill when the user forgets to switch it off. The system also does not have the capacity
to adjust the room temperature.

To address the problem, the automatic room temperature controller, which can control the
temperature automatically is proposed. The advantages of such system are less energy usage and
it provides more convenience to the user.

The design is operated based on the changing room temperature. For the detection of the room
temperature, a temperature sensor (type: LM35) is used. The temperature sensor sends signal to
the microcontroller (model:PIC16F877A) while the microcontroller determines the increase or
decrease in the room temperature using a heater and A/C device respectively based on the received
signal from the temperature sensor. In addition the controller should use LEDs to indicate the
current state of temperature in the room.

13
1.2 Objectives
The objectives for this project are;
 To design and construct an automatic temperature controller to regulate the temperature of
a room.
 To build an automatic room temperature controller making use of a temperature sensor,
gsm module and a microcontroller.
 To achieve the design of an alert system for the temperature controller.
 To develop a smart temperature controlled environment.

1.3 Scope of Study


The project is limited to an enclosed system (model house), making use of a fan and a
heater with the circuit systems in it.

The scope of this project are;

 To design a system that sets the desired temperature value range


 Automatic temperature sensor monitoring the recent change of temperature within the
range
 Heater/fan functioning within desired temperature range(s).
 Alarm system to alert the user for an uncontrolled rise in temperature.

1.5 Significance of the Project

This project value cuts across various fields, below are the advantages and application of
this project.

. ADVANTAGE:

 The advantages the system are less energy usage and it provides more convenience to
the user
 It automatically manages temperature of the room.
 Less expensive then air-conditioned.
 It reduces electric power consumption.
 Easily install at any place.

14
APPLICATIONS:

 It can used in offices, class rooms, kitchens, living rooms, bed rooms etc.
 It manages temperature in tunnels and mines.
 It also manages temperature in server rooms.

TECHNOLOGICAL SIGNIFICANCE

The technological significance of this project is seeking for a prototype of a workable


automatic room temperature control system using a temperature sensor and microcontroller,
which could be used or enhanced by future developers.

EDUCATIONAL SIGNIFICANCE

The educational significance of this project is establishing a documentation of automatic room


temperature control system that may serve as a resource document or reference for the students
and researchers for their study or application of the theories they learned in class.

More so, a wireless monitor controller is used in this project to alert the user of any fault and to
control the fault.

1.4 Operational definition of key terms


In this project there are several components included as each of them have their specific
function and task. These components are selected based on circuit reliability, function ability, and
cost.

Pic Microcontroller PIC16F877A

The microcontroller selected is the microchip PIC16F877A because of its ease of use, built in
timers and has many digital inputs and outputs. To avoid extra cost, this model is the most basic
that meets all of the design criteria. The microcontroller is used to control the whole operation of
the system.

Temperature Sensor LM35

Temperature sensor lm35 is an integrated circuit sensor that can be used to measure temperature
with an electric output proportional to the temperature in degree Celsius (°C). The LM35 thus has
an advantage over linear temperature sensors calibrated in ˚ Kelvin, as the user is not required to
subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The

15
LM35 is rated to operate over a −55˚ to +150˚C temperature range having a scale factor of
10.0mV/°C.

LCD Display

LCD is an electronically-modulated optical device shaped into a thin, flat panel made up of any
number of color or monochrome pixels filled with liquid crystals and arrayed in front of a light
source (back light) or reflector.

The type of LCD used is alphanumeric with 4 lines of 20 characters.

ARDUINO

Arduino is an open-source computer hardware and software company, project and user community
that designs and manufactures microcontroller-based kits for building digital devices and
interactive objects that can sense and control objects in the physical world.

1.5 Brief overview of Dissertation


This thesis contains 5 chapters and they are outlined as below:
Chapter 1: explains the introduction that includes concept of temperature control system and
alarm systems. It also outlines the objectives and scopes of this system.

Chapter 2: describes the literature review from recent issue and gives a brief review about the
past project.

Chapter 3: provides description and discussion on the design of the hardware of each
module in the systems. The module consists of microcontroller board, sensor, and LCD displays
driver circuit and output devices. It explains the development of the software and system operation.

Chapter 4: presents testing and results that conducted to each module.

Chapter 5: summarizes the overall conclusion for this thesis and a few future
recommendations.

16
CHAPTER 2
LITERATURE REVIEW

2.1 Introduction
Automatic temperature control system is one of the most popular feature which is rapidly
gaining its popularity due to its importance to certain applications such temperature control
(Ahmed Faris,2009).This is an actual fact because of its innovative feature in changing
temperatures automatically.

According to Zairi I.R et al (2013), the advantages of using an automatic temperature


controller has led to many researches focusing on automatic temperature control system
application in different fields. For examples, an automatic temperature controller for multielement
array hyperthermia systems , multi-loop automatic temperature control system design for fluid
dynamics , automatic temperature control for transport airplanes , design of automatic temperature
control system on laser diode of erbium-doped fiber source , design of automatic temperature-
control circuit module in tunnel microwave heating system , development of automatic
temperature control system in blast furnace , the automatic temperature system with Fuzzy self-
adaptive Proportional Integral-Derivative (PID) control in semiconductor laser , the constant
temperature automatic control system design of 3G base station without man’s guard, automatic
body temperature control system for small animal studies using dual mode Proportional-Integral
(PI) control , automatic temperature and humidity control system using air-conditioning in
transformer substation and so forth. There is also a case study of automatic temperature control
system on diagnosable discrete event system design.

2.2 Automatic Room Temperature Controller


According to Ahmad Faris (2009), his work is designed to monitor the temperature inside a
server room. A server room is a room that houses mainly computer servers. 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 temperature or in the upper limit that is 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.

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

General recommendations suggest that temperature range in server room should not go below
10°C (50°F) or above 28°C (82°F). 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 (68-71°F). For a variety
of reasons this can sometimes be a tall order (Faris, 2009).

The project used PIC16F876A to control NPN power transistor (BD135) to further drive DC
brushless fans, LEDs and buzzer when the certain temperature was detected. The value of
temperature always displayed on a LCD screen. The project used two temperature sensors that
placed at different area. This means that temperature can be measured at different place. The
project also used PIC16F877A, LCD screen and keypad to develop a password door security
system. The system activates the relay and buzzer if the password is inserted. The relay controls
the door while the buzzer as indicator for incorrect password. The door used is magnetic
door which is automatically open and close depends to the relay.

The result shows that the temperature controller was able to detect the change in temperature
by increasing the rate at which fan blows to counter the increasing rate of temperature. More so
the security was able to detect if the password entered is right or wrong.

Compared to this project, there are a few differences. This proposed project is designed just for
a room and its temperature range is between 23°C to 28°C which is suitable for our room
temperature. The proposed project additional feature is a wireless alert system for alarming and
notifying the user of any occurrence. The wireless alert system is designed using arduino

A related project as documented by Ruru Martin (2014) is an automatic room temperature


controller for a warehouse in Japan. This project is suitable only in places with temperate climate
since it only uses electric fans and exhaust fans. It also entertains the same operation as regarding
the server room temperature by Ahmed Faris.

The general purpose of this project is to measure the room temperature and to control the
ventilators automatically at the warehouse loft. The researchers aimed to protect the quality of the
products that is being stored in the warehouse loft.

In this study the researchers used prototyping method in order to have an organized outcome. They
undergo with the following phases through; identify the problem, planning, analysis, designing,
testing, and maintenance.

18
Moreover, the automatic room temperature control is a big help for the beneficiaries of this
work in maintaining their products from bending or deformation of steel appliances, bulging of
wooden items and weakening of the adhesiveness of the wood glues.

In conducting this study the researchers also used temperature sensor to measure the
temperature and microcontroller to control the switching on and off of the ventilators (Ruru, 2014)

A limitation to this project is that during brownouts the system stops functioning. An alternative
way to this problem or limitation is by adapting a backup power supply and another one is adding
a roof ventilators.

Oryon (2014) in his work used four temperature sensors to sense room temperature accurately.
If temperature is lower than defined temperature then system switched ON room heater. If
temperature is higher than defined temperature then system switched ON fan. If temperature is
equals to set temperature than room heater and fan both OFF.

In his work, he used an ATMEGA16 microcontroller and you can adjust your room
temperature between 15 degree to 55 degree Celsius. The Microcontroller continuously compare
room temperature and set temperature. If room temperature is smaller than set temperature then
microcontroller automatically ON the room heater. If room temperature is greater than the set
temperature then microcontroller automatically ON the FAN and regulate the FAN speed
according to the difference between set temperature and room temperature. If room temperature is
equals to the set temperature then both FAN and ROOM HEATER become OFF.

The uniqueness of this project is that, it manages the room temperature automatically and can
be easily installed at any place. Moreover, it saves cost in terms of electric power consumption
and it is less expensive than air condition.

The Microcontroller calculates Average temperature or room temperature by using this


formula.

Average temperature = (T1 + T2 + T3 + T4) / 4

Room temperature = average temperature

T1, T2, T3, T4 are the temperature sensed by all four temperature sensors.

The result shows that the Room temperature is equal to average temperature and reads on
LCD’s first line as “Room Temp”. The Switch UP and DOWN is use for setting the reference
temperature of the room that is desired. The reference temperature shows in LCD’s second line as

19
“Set temp”.

Fig 2.1 Simulation Diagram of the system (Oryon, 2014).

Regarding an Automatic room Temperature control for temperate regions, LIZAWATI B.J (
2009) in his work, proposed an automatic room temperature controller, which uses the
difference between the outside and inside room temperature. The difference is assumed to
affect the compressor speed in order to achieve the desired set point. The frequency of the speed

20
compressor is also taken into account. The project involves finding the mathematical model of an
air conditioning system, designing a controller and performing a simulation to analyze the
performance of the designed controller using Matlab/Simulink. The controller is based on adaptive
fuzzy to control the room temperature. The result shows that the controller is able to follow
the input reference and the output response of adaptive fuzzy control has better tracking
performance. The developed system is hoped to address the issue of high cost electricity.

In the research work on the design of a room temperature and humidity controller using fuzzy
logic by Tarun Kumar Das & Yudhajit Das(2013),their proposed model consists of two fuzzy
logic controllers to control temperature and humidity respectively. The first controller accepts
two input values- the current temperature as detected by temperature sensor and its deviation from
user set-temperature, and controls the speed of heat-fan and cool-fan accordingly. When the
current temperature in the room reaches set point, it serves as one of the input for second fuzzy
logic controller that controls the humidity. The ideal relative humidity level for user’s set
temperature is preset in the system. Current humidity in percentage as detected by the humidity
sensor in the room serves as the second input to the controller. The humidifier and exhaust fan
\speed is controlled accordingly to maintain the correct humidity level for that temperature. This
research work would increase the capability of fuzzy logic control systems in process automation
with potential benefits. This proposed design work of room temperature and humidity controller
can be used in a processing plant to maintain comfortable atmosphere in the environment.

21
Fig 2.3 Block Diagram of Room Temperature and Humidity Controller (Tarun et al, 2013)

The model basically employs the principle of ground water/air source reversible heat pumps
which work in either thermal direction to provide heating or cooling to the internal space.

In cooling mode, the inside coil is the evaporator and the outside coil is condenser. The
compressor takes away the low pressure vapour from the refrigerant and discharge it as high
pressure vapour which thereby enters the condenser where it is cooled and condensed into liquid.
After leaving the condenser as high pressure cooler liquid, the refrigerant now enters the
evaporator where it changes into vapour coming in contact with low pressure atmosphere. During
this evaporative cycle, heat is removed from the air which gets cooler and enters the room. The
low pressure refrigerant then routes back to the compressor by suction line to repeat the cooling
process.

In heating mode, the inside coil is now condenser and outside coil is evaporator. The
compressor sends the high pressure vapour into the reversing valve which routes the vapour

22
to the condenser coil where it is cooled, and condensed into liquid by passing through the coil.
The heat removed from the refrigerant is expelled to the inside air by the air movement system.
The refrigerant leaves the inside coil as a high pressure liquid. When this liquid enters the low
pressure atmosphere of the outside coil (evaporator) it evaporates into vapor. When the evaporative
process takes place, heat is removed from the air flowing through the evaporator and the air, which
is now cool, is returned to the outside air (ambient). From the evaporator, the low pressure
refrigerant vapour returns to the reversing valve which routes the low pressure vapor to the
compressor through the suction line to start the heating process again (Yudhajit Das, 2013).

The analysis clearly maps out advantage of fuzzy logic in dealing with problems that are
difficult to study analytically yet are easy to solve intuitively in terms of linguistic variables. In
case of the Air -Conditioning system, fuzzy logic helped solve a complex problem without getting
involved in intricate relationships between physical variables.

In their work Zairi et al (2013) presented an innovative prototype design of electric fan with
smart characteristics. This electric fan uses a microcontroller to produce an automation function.
It also has unique double feature designs, such as 2 fans, 2 Light Emitting Diodes (LED) and 2
sensors. This is to ensure the cooling process operates more efficiently and effectively, especially
for a large space application and in hot weather due to global warming.

The circuit starts to function when the 9V Direct Current (DC) battery supply is turned on. It
is connected to the IC regulator circuit to produce 5V stable voltage. Then, the LM35 sensor
functions to measure the changes of temperature surrounds the area. All the operations are
controlled by the PIC16F876A to produce the output. The PIC is as a brain of the circuit. The
LCD, fans and buzzer are the output where they are set with the pseudo code of PIC. The LCD is
used to measure and show the changes of temperature value. The fan starts to function when the
switch is turned on. The high value of temperature causes both fan A and fan B to turn on
automatically. Then, the buzzer will only show the emergency feature if the temperature reaches
an unusual value.

A unique feature of this design is that the circuit is suitable for disabled people who have
difficulty to switch on the fan manually. Lastly, the circuit can be manipulated by diversifying its
function as a detector, where it can produce an alarm signal when emergency case occurs such as
the house or premise is on fire.

23
An upgrade can be made on this work by using a wireless technology to interface sensor and
microcontroller, monitor and control the temperature via internet and using an USB to link
microcontroller and computer.

In Kumar et al (2013) work, they proposed a control scheme for a static room based on the
continuous monitoring of the thermal variables. Their aim was to maintain the temperature and the
humidity of room close to the targeted values, and reduce the electrical energy intake of the
compressor/Fan while utilizing all available resources in the most efficient manner. In this work,
the indoor temperature control loop has been implemented using a conventional PID algorithm &
fuzzy logic. Since Fuzzy logic technique is an innovative technology used in designing solutions
for multi-parameter and non-linear control models for the definition of a control strategy. As a
result, it delivers solutions faster than the conventional control design techniques. A practical
application of a fuzzy control system & PID for a static room was carried out and the simulation
results are presented using Simulink / MATLAB trying to deal mainly with the issue of
maintaining the desired indoor temperature in spite of the change in outdoor temperature
simultaneously reducing the temperature oscillations and energy consumption.

Fig 2.4 Simulink Model Using PID Controller (Kumar et al, 2013)

Akpado et al(2013),still on the use of fuzzy logic and PID controller simulating it with
Simulink/Matlab, they focused on the performance evaluation of PID controllers implemented
with a clear objective to control the temperature of a ventilation system, Mathematical models of
plant (chamber) and actuator were developed. Controller design based on the models was also

24
developed using Simulink. The models were validated through simulation using Matlab/Simulink
and the Zeigler-Nichol tuning method was adopted as the tuning technique for varying the
parameters of the PID controller in order to achieve a desirable transient response of the system
when subjected to a unit step input. A schematic model of the system was also captured using
proteus and the animated simulation was carried out to validate the system’s performance to
varying temperature conditions within the chamber. After several assumptions and simulations, a
set of optimal parameters was obtained that exhibited a commendable improvement in the
overshoot, rise time, peak time and settling time thus improving the robustness and stability of the
system.

An improvement is been made over Faris (2009)’s work when Arun et al (2011) by setting in
their program using microcontroller AT89S52 to set an alarm when the temperature is higher than
50 °C. The alarm system makes use of a buzzer. This work also follow similar trend in the use of
an alarm system.

2.3 Room Temperature


Room temperature is a colloquial expression for the typical or preferred indoor (climate-
controlled) temperature to which people are generally accustomed. It represents the small range of
temperatures at which the air feels neither hot nor cold, approximately 24 °C (75°F) (Wikipedia,
2016).

The American Heritage Dictionary of the English Language (5th Ed, 2014) identifies room
temperature as around 20 to 22 °C (68 to 72 °F).

According to Burroughs et al (2011), “owing to variations in humidity and likely clothing,


recommendations for summer and winter may vary; a suggested typical range for summer in a
tropical region is 23 °C (73 °F) to 25.5 °C (78 °F), with that for winter being 20 °C (68 °F) to 23.5
°C (74 °F)”. Although by other considerations, the maximum should be below 24 °C (75 °F) – and
for sick building syndrome avoidance, below 22 °C (72 °F).

According to the West Midlands Public Health Observatory (UK) (Hartley, 2006), an adequate
level of wintertime warmth is 21 °C (70 °F) for a living room, and a minimum of 18 °C (64 °F)
for other occupied rooms, giving 24 °C (75 °F) as a maximum comfortable room temperature for
sedentary adults.

25
Room temperature implies a temperature inside a temperature-controlled building. Ambient
temperature simply means "the temperature of the surroundings" and will be the same as room
temperature indoors. (Word reference, ambiente, retrieved 2011).

2.4 A Brief History of Temperature


Temperature is by far the most measured parameter. It impacts the physical, chemical and
biological world in numerous ways. Yet, a full appreciation of the complexities of temperature and
its measurement has been relatively slow to develop (Capgo, 2013).

Intuitively, people have known about temperature for a long time: fire is hot and snow is cold.
Greater knowledge was gained as man attempted to work with metals through the bronze and iron
ages. Some of the technological processes required a degree of control over temperature, but to
control temperature you need to be able to measure what you are controlling.

Until about 260 years ago temperature measurement was very subjective. For hot metals the
colour of the glow was a good indicator. For intermediate temperatures, the impact on various
materials could be determined. For example does the temperature melt sulphur, lead or wax, or
boil water? In other words a number of fixed points could be defined, but there was no scale or
any way to measure the temperature between these points. It is, however possible that there is a
gap in the recorded history of technology in this regard as it is difficult to believe that the
Egyptians, Assyrians, Greeks, Romans or Chinese did not measure temperatures in some way
(capgo,2013).

Galileo invented the first documented thermometer in about 1592. It was an air thermometer
consisting of a glass bulb with a long tube attached. The tube was dipped into a cooled liquid and
the bulb was warmed, expanding the air inside. As the air continued to expand, some of it escaped.
When the heat was removed, the remaining air contracted causing the liquid to rise in the tube and
indicating a change in temperature. This type of thermometer is sensitive, but is affected by
changes in atmospheric pressure.

By the early 18th century, as many as 35 different temperature scales had been devised. In 1714,
Daniel Gabriel Fahrenheit invented both the mercury and the alcohol thermometer. Fahrenheit's
mercury thermometer consists of a capillary tube which after being filled with mercury is heated
to expand the mercury and expel the air from the tube. The tube is then sealed, leaving the mercury
free to expand and contract with temperature changes. Although the mercury thermometer is not

26
as sensitive as the air thermometer, by being sealed it is not affected by the atmospheric pressure.
Mercury freezes at -39° Celsius, so it cannot be used to measure temperature below this point.
Alcohol, on the other hand, freezes at -113° Celsius, allowing much lower temperatures to be
measured (Capgo, 2013).

At the time, thermometers were calibrated between the freezing point of salted water and the
human body temperature. (Salt added to crush wet ice produced the lowest artificially created
temperatures at the time). The common Flemish thermometers of the day divided this range into
twelve points. Fahrenheit further subdivided this range into ninety-six points, giving his
thermometers more resolution and a temperature scale very close to today's Fahrenheit scale. (In
fact there appeared to have been between 15 and 20 different temperature scales at this time,
determined by nationality and application.)

Later in the 18th century, Anders Celsius realised that it would be advantageous to use more
common calibration references and to divide the scale into 100 increments instead of 96. He chose
to use one hundred degrees as the freezing point and zero degrees as the boiling point of water.
Sensibly the scale was later reversed and the Centigrade scale was born.

The early 1800's were very productive in the area of temperature measurement and
understanding.

William Thomson (later Lord Kelvin) postulated the existence of an absolute zero. Sir William
Hershel, discovered that when sunlight was spread into a colour swath using a prism, he could
detect an increase in temperature when moving a blackened thermometer across the spectrum of
colours. Hershel found that the heating effect increased toward and beyond the red in the region
we now call 'infrared'. He measured radiation effects from fires, candles and stoves, and deduced
the similarity of light and radiant heat. However it was not until well into the following century
that this knowledge was exploited to measure temperature.

In 1821 T J Seebeck discovered that a current could be produced by unequally heating two
junctions of two dissimilar metals, the thermocouple effect. Seebeck assigned constants to each
type of metal and used these constants to compute total amount of current flowing. Also in 1821,
Sir Humphrey Davy discovered that all metals have a positive temperature coefficient of resistance
and that platinum could be used as an excellent temperature detector (RTD). These two discoveries
marked the beginning of serious electrical sensors (Capgo, 2013).

27
Gradually the scientific community learnt how to measure temperature with greater precision. For
example it was realized by Thomas Stevenson (civil engineer and father of Robert Louis
Stevenson) that air temperature measurement needed to occur in a space shielded from the sun's
radiation and rain. For this purpose he developed what is now known as the Stevenson Screen. It
is still in wide use.

The late 19th century saw the introduction of bimetallic temperature sensor. These thermometers
contain no liquid but operate on the principle of unequal expansion between two metals. Since
different metals expand at different rates, one metal that is bonded to another, will bend in one
direction when heated and will bend in the opposite direction when cooled (hence the term
Bimetallic Thermometer or BiMets). This bending motion is transmitted, by a suitable mechanical
linkage, to a pointer that moves across a calibrated scale. Although not as accurate as liquid in
glass thermometers, BiMets are hardier, easy to read and have a wider span, making them ideal
for many industrial applications.

The 20th century has seen the discovery of semiconductor devices, such as: the thermistor, the
integrated circuit sensor, a range of non-contact sensors and also fibre-optic temperature sensors.
Also, Lord Kelvin was finally rewarded for his early work in temperature measurement. The
increments of the Kelvin scale were changed from degrees to Kelvins. Now we no longer say "one-
hundred degrees Kelvin;" we instead say "one-hundred Kelvins". The "Centigrade" scale was
changed to the "Celsius" scale, in honour of Anders Celsius.

The 20th century also saw the refinement of the temperature scale. Temperatures can now be
measured to within about 0.001°C over a wide range, although it is not a simple task. The most
recent change occurred with the updating of the International Temperature Scale in 1990 to the
International Temperature Scale of 1990 (ITS-90). This document also covers the recent history
of temperature standards (Capgo, 2013).

2.5 Temperature and Its Measurement


Temperature measurement describes the process of measuring a current local temperature for
immediate or later evaluation. Datasets consisting of repeated standardized measurements can be
used to assess temperature trends (Wikipedia, 2010).

28
The zeroth law of thermodynamics is the basis of temperature measurement. In order to obtain
a quantitative measure of temperature, a reference body of known physical characteristic which
changes with temperature is chosen. The chosen characteristic is called thermometric property and
the reference body is called thermometer. In common thermometer, expansion of mercury is used
as thermometric property. Table 2.1 shows the types of thermometer with its thermometric
property.

Table 2.1 Types of Thermometers and their Thermometric Properties (Wikipedia, 2010)

S/NO THERMOMETER THERMOMETRIC SYMBOL


PROPERTY

1 Mercury-in-glass Length L

2 Constant Volume Gas Pressure P

3 Electric Resistance Resistance R

4 Constant Pressure gas Volume V

5 Thermocouple Thermal Electromotive Force E

6 Pyrometer(radiation) Intensity of Radiation I or J

2.5.1 Empirical Relations between Temperature and Thermometric Property


If x is the thermometric property and temperature is the linear function (direct proportionality) of
x. So, mathematically

F(x) = ax………………. (2.1)

If x1 corresponds to F(x1), then x2 can be calculated as follows.

F(x1) = ax1………………. (2.2)

29
Where “a” is an arbitrary constant.

a = F (x1) / x1 inserting this in equation (2 .1) we get

F (x) = F (x1) / x1 .x

Assuming x = x2 we get from (2.2)

F (x2) = F (x1) / x1.x2

F (x2) / F (x1) = x2 / x1…………………. (2.3)

Equation (2.3) shows that two temperatures on the linear x scale are to each other as the ratio of
the corresponding readings i.e., x2 and x1.

2.5.2 Method Used Before 1954


Let F(x) = ax + b … (2.4)

The thermometer is first placed in contact with a standard system and measures the temperature
of it. Let x1 be the reading, so,

F (x1) = ax1 + b … (2.5)

Where b is another arbitrary constant

Then the thermometer is placed with another standard system and measures the temperature of it
and let x2 be the reading, so,

F (x2) = ax2 +b ….. (2.6)

Solving (2.5) and (2.6) for a and b,

F(x1) –F(x2) = a (x1 –x2)

a = F (x1) – F (x2) / x1 –x2

(2.5) => b = f (x1) – ax1

b= F(x1) – F(x1) – F(x2) / x1 – x2. x1

30
b= x1 F (x1) – x2 F (x1) – x1 F(x1) + x1 F (x2) / x1 –x2

b = x1 F(x2) – x2 F(x1) / x1 –x2

Inserting the value of a and b in (2.4), we get

F(x) = F(x1) – F(x2) / x1 –x2 .x + x1 F(x2) – x2 F(x1) / x1 –x2 …..(2.7)

Note: If b = 0 then equation (2.7) reduces to

F(x) = F(x1) – F(x2) / x1 – x2. x

And we have

b = 0 = x1 F(x2) –x2 F(x1) / x1 –x2

(Wikipedia, 2010).

Two commonly used scales are Celsius scale and Fahrenheit scale. Symbols C and Fare used to
denote the readings on the two scales. Before 1954, the two fixed points used are steam point
(boiling point of water at standard atmospheric pressure and the ice point (freezing point of water)

Temperature Celsius scale Fahrenheit scale

Steam point 100 212

Ice point 0 32

Interval 100 degrees 180 degrees

100 -0 /C -0 = 212 – 32 /F -32

100 / C = 180 / F -32

5 /C = 9 / F -32

C /5 = F -32 / 9

31
2.5.3 Method in Use After 1954
On and after 1954, Kelvin suggested that only one fixed point is necessary to establish a
temperature scale. This fixed point is the triple point of water. The value of the triple point of water
is 0.01oC or 273.16 K. Correspondingly, the ice point of 0 o c on the Celsius scale becomes 273.15
K on Kelvin scale. Let us use to C for Celsius scale and T for Kelvin scale.

Then

Tin Kelvin= 273.15 + to C.

The triple point of water in the Fahrenheit scale is 32.02!!F and for Rankine scale is 491.69R

T in Rankine scale = 459.67 to F

Fig.2.5 Diagram of a Celsius and Fahrenheit scale (Wikipedia, 2010).

32
Table 2.2 Comparisons of Temperature Scale (ASME, 2013)

Fixed Point Celsius Kelvin Fahrenheit Rankine

Steam Point 100 373.15 212 671.67

Triple Point of Water 0.01 273.16 32.02 491.69

Ice Point 0 273.15 32 491.67

Absolute Zero -273.15 0 459.67 0

2.6 Temperature Control


Temperature control is a process in which change of temperature of a space (and objects
collectively there within) is measured or otherwise detected, and the passage of heat energy into
or out of the space is adjusted to achieve a desired average temperature (Wikipedia, 2015).

2.6.1 Control loops


A home thermostat is an example of a closed control loop: It constantly assesses the current
room temperature and controls a heater and/or air conditioner to increase or decrease the
temperature according to user-defined setting(s) ----“in the case of this project, the temperature
measuring device is the LM35 which sends the measured temperature to the microcontroller while
the microcontroller determines the increase and decrease of the room temperature.”

A simple (low-cost, cheap) thermostat merely switches the heater or air conditioner either on
or off, and temporary overshoot and undershoot of the desired average temperature must be
expected. A more expensive thermostat varies the amount of heat or cooling provided by the heater
or cooler, depending on the difference between the required temperature (the "set point") and the
actual temperature. This minimizes over/undershoot. This method is called Proportional control.
Further enhancements using the accumulated error signal (Integral) and the rate at which the error
is changing (Derivative) are used to form more complex PID Controllers which is the form usually
seen in industry (Wikipedia, 2015).

33
2.6.2 Energy balance
An object's or space's temperature increases when heat energy moves into it, increasing the
average kinetic energy of its atoms, e.g., of things and air in a room. Heat energy leaving an object
or space lowers its temperature. Heat flows from one place to another (always from a higher
temperature to a lower one) by one or more of three processes: conduction, convection and
radiation. In conduction, energy is passed from one atom to another by direct contact. In
convection, heat energy moves by conduction into some movable fluid (such as air or water) and
the fluid moves from one place to another, carrying the heat with it. At some point the heat energy
in the fluid is usually transferred to some other object by means conduction again. The movement
of the fluid can be driven by negative-buoyancy, as when cooler (and therefore denser) air drops
and thus upwardly displaces warmer (less-dense) air (natural convection), or by fans or pumps
(forced convection). In radiation, the heated atoms make electromagnetic emissions absorbed by
remote other atoms, whether nearby or at astronomical distance. For example, the Sun radiates
heat as both invisible and visible electromagnetic energy. What we know as "light" is but a narrow
region of the electromagnetic spectrum.

If, in a place or thing, more energy is received than is lost, its temperature increases. If the
amount of energy coming in and going out are exactly the same, the temperature stays constant—
there is thermal balance, or thermal equilibrium (Wikipedia, 2015).

We can therefore say the automatic room temperature is a control system.

2.7 Temperature Control System


A control system is a device, or set of devices, that manages, commands, directs or
regulates the behavior of other device(s) or system(s). A control system consists of controller
and plant, and requires an actuator to interface the plant and controller. The behavior and
performance of a control system depend on the interaction of all the element (Yudhajit Das, 2013).

There are two common classes of control systems, open loop control systems and closed loop
control systems. In open loop control systems output is generated based on inputs. In closed loop
control systems current output is taken into consideration and corrections are made based on
feedback. A closed loop system is also called a feedback control system (as in case of the
temperature controller).

34
In the case of linear feedback systems, a control loop, including sensors, control algorithms
and actuators, is arranged in such a fashion as to try to regulate a variable at a set point or reference
value. An example of this is decreasing the temperature of a room when the room gets hot using
an air conditioning system. PID controllers are common and effective in cases such as this. Control
systems that include some sensing of the results they are trying to achieve are making use of
feedback and so can, to some extent, adapt to varying circumstances.

Fig 2.6 Ideal feedback model (Wikipedia, 2015).

2.7.1 On-Off Control


A thermostat is a simple negative feedback controller: when the temperature (the "process
variable" or PV) goes below a set point (SP), the heater is switched on. Another example could be
a pressure switch on an air compressor. When the pressure (PV) drops below the threshold (SP),
the pump is powered. Refrigerators and vacuum pumps contain similar mechanisms operating in
reverse, but still providing negative feedback to correct errors.

Simple on–off feedback control systems like these are cheap and effective. In some cases, like
the simple compressor example, they may represent a good design choice.

In most applications of on–off feedback control, some consideration needs to be given to other
costs, such as wear and tear of control valves and perhaps other start-up costs when power is
reapplied each time the PV drops. Therefore, practical on–off control systems are designed to
include hysteresis which acts as a deadband, a region around the set point value in which no control
action occurs. The width of deadband may be adjustable or programmable.

2.7.2 Linear Control


Linear control systems use linear negative feedback to produce a control signal mathematically
based on other variables, with a view to maintain the controlled process within an acceptable
operating range (Wikipedia, 2015).

35
The output from a linear control system into the controlled process may be in the form of a
directly variable signal, such as a valve that may be 0 or 100% open or anywhere in between.
Sometimes this is not feasible and so, after calculating the current required corrective signal, a
linear control system may repeatedly switch an actuator, such as a pump, motor or heater, fully on
and then fully off again, regulating the duty cycle using pulse-width modulation.

2.7.3 Proportional control


When controlling the temperature of an industrial furnace, it is usually better to control the
opening of the fuel valve in proportion to the current needs of the furnace. This helps avoid thermal
shocks and applies heat more effectively.

Proportional negative-feedback systems are based on the difference between the required set
point (SP) and process value (PV). This difference is called the error. Power is applied in direct
proportion to the current measured error, in the correct sense so as to tend to reduce the error and
therefore avoid positive feedback. The amount of corrective action that is applied for a given error
is set by the gain or sensitivity of the control system.

At low gains, only a small corrective action is applied when errors are detected. The system may
be safe and stable, but may be sluggish in response to changing conditions. Errors will remain
uncorrected for relatively long periods of time and the system is over-damped. If the proportional
gain is increased, such systems become more responsive and errors are dealt with more quickly.
There is an optimal value for the gain setting when the overall system is said to be critically
damped. Increases in loop gain beyond this point lead to oscillations in the PV and such a system
is under-damped.

Fig.2.7 Diagram of a proportional control (Wikipedia, 2015).

36
In real systems, there are practical limits to the range of the manipulated variable (MV). For
example, a heater can be off or fully on, or a valve can be closed or fully open. Adjustments to the
gain simultaneously alter the range of error values over which the MV is between these limits. The
width of this range, in units of the error variable and therefore of the PV, is called the proportional
band (PB). While the gain is useful in mathematical treatments, the proportional band is often used
in practical situations. They both refer to the same thing, but the PB has an inverse relationship to
gain – higher gains result in narrower PBs, and vice versa.

2.7.3.1 Under-damped furnace example


In the furnace example, suppose the temperature is increasing towards a set point at which,
say, 50% of the available power will be required for steady-state. At low temperatures, 100% of
available power is applied. When the process value (PV) is within, say 10° of the SP the heat input
begins to be reduced by the proportional controller (note that this implies a 20° proportional band
(PB) from full to no power input, evenly spread around the set point value). At the set point the
controller will be applying 50% power as required, but stray stored heat within the heater sub-
system and in the walls of the furnace will keep the measured temperature rising beyond what is
required. At 10° above SP, we reach the top of the proportional band (PB) and no power is applied,
but the temperature may continue to rise even further before beginning to fall back. Eventually as
the PV falls back into the PB, heat is applied again, but now the heater and the furnace walls are
too cool and the temperature falls too low before its fall is arrested, so that the oscillations continue
(Wikipedia, 2015).

2.7.3.2 Over-damped furnace example


The temperature oscillations that an under-damped furnace control system produces are
unacceptable for many reasons, including the waste of fuel and time (each oscillation cycle may
take many minutes), as well as the likelihood of seriously overheating both the furnace and its
contents.

Suppose that the gain of the control system is reduced drastically and it is restarted. As the
temperature approaches, say 30° below SP (60° proportional band (PB)), the heat input begins to
be reduced, the rate of heating of the furnace has time to slow and, as the heat is still further
reduced, it eventually is brought up to set point, just as 50% power input is reached and the furnace
is operating as required. There was some wasted time while the furnace crept to its final
temperature using only 52% then 51% of available power, but at least no harm was done. By
carefully increasing the gain (i.e. reducing the width of the PB) this over-damped and sluggish

37
behavior can be improved until the system is critically damped for this SP temperature. Doing this
is known as 'tuning' the control system. A well-tuned proportional furnace temperature control
system will usually be more effective than on-off control, but will still respond more slowly than
the furnace could under skillful manual control (Wikipedia, 2015).

2.7.4 PID Control


Apart from sluggish performance to avoid oscillations, another problem with proportional-only
control is that power application is always in direct proportion to the error. In the example above
we assumed that the set temperature could be maintained with 50% power. What happens if the
furnace is required in a different application where a higher set temperature will require 80% power
to maintain it? If the gain was finally set to a 50° PB, then 80% power will not be applied unless
the furnace is 15° below set point, so for this other application the operators will have to remember
always to set the set point temperature 15° higher than actually needed. This 15° figure is not
completely constant either: it will depend on the surrounding ambient temperature, as well as other
factors that affect heat loss from or absorption within the furnace.

To resolve these two problems, many feedback control schemes include mathematical
extensions to improve performance. The most common extensions lead to proportional-integral-
derivative control, or PID control (Wikipedia, 2015).

Fig 2.8 a block diagram of a PID Controller (Wikipedia, 2010)

According to Akpabio et al(2013),his work system design is based on PID Controller


implemented on a microcontroller and a temperature sensor(LM35). The temperature sensor
converts change in temperature to change in electrical signal which is then compared by the PID
controller control algorithm to activate the fan for the cooling of the system. The microcontroller

38
accepts inputs from a simple four-key keypad which allow specification of the Set point
temperature and it displays both set-point and measured chamber temperatures using an LCD
display. Finally, a pulse-width modulation (PWM) output from the controller is used to drive
a relay which switches the fan off and on.

The temperature control system was built around several mathematical models needed
for the analysis of the system dynamics and the design and evaluation of the control system,
but here we will be looking at the model of the PID controller As related to this project. Figure 2.9
shows the closed loop structure of a temperature controlled system. In this structure, the models
of the system dynamics; sensors, actuators and computational effects are the basic elements which
often cannot be altered. The design and fine tuning of the PID controller was the subject of the
analysis. The design and fine tuning of this controller required application of control system design
theory to the dynamic models of the other elements from Figure 2.9. A simplified mathematical
model of the overall system was derived in this section. The system was validated by simulating
the controller model with the plant model, sensor and actuators or any combination of these
components. As a result the system was able to track and/or regulate the desired chamber
temperature with minimum peak time, rise time, settling time and overshoot.

Fig 2.9 Block Diagram of the closed loop temperature control system (Akpabio et al, 2013).

39
In the mathematical model of the controller, The Ziegler-Nichols tuning rule was applied in
the design of the parallel Proportional-Integral-Derivative controller (Ezeagwu, 2013). The PID
controller was selected since it is probably the most extensively used method in
industrial process control applications. A large number of references can be found which
describe the continuous and digital forms of this controller, its performance evaluation,
implementation and auto-tuning forms. The block diagram of the continuous PID controller
is shown in figure 2.10 where, Kp is the proportional gain, Ti is the integral time constant,
and Td is the derivative time constant [].

The transfer function of the standard PID algorithm is:

…….. 1

In the S-domain, the PID controller can be written as;

………2

The discrete form of the PID controller can be achieved by finding the Z-transform of equation

………. 3

…….… 4

Where

………. 5

40
Fig.2.11 Block diagram of a continuous parallel PID controller (Akpabio et al, 2013)

2.7.4.1 Derivative Action


The derivative part is concerned with the rate-of-change of the error with time: If the measured
variable approaches the set point rapidly, then the actuator is backed off early to allow it to coast
to the required level; conversely if the measured value begins to move rapidly away from the set
point, extra effort is applied—in proportion to that rapidity—to try to maintain it.

Derivative action makes a control system behave much more intelligently. On control systems
like the tuning of the temperature of a furnace, or perhaps the motion-control of a heavy item like
a gun or camera on a moving vehicle, the derivative action of a well-tuned PID controller can
allow it to reach and maintain a set point better than most skilled human operators could.

If derivative action is over-applied, it can lead to oscillations too. An example would be a PV


that increased rapidly towards SP, then halted early and seemed to "shy away" from the set point
before rising towards it again.

2.7.4.2 Integral action


The integral term magnifies the effect of long-term steady-state errors, applying ever-increasing
effort until they reduce to zero. In the example of the furnace above working at various
temperatures, if the heat being applied does not bring the furnace up to set point, for whatever

41
reason, integral action increasingly moves the proportional band relative to the set point until the
PV error is reduced to zero and the set point is achieved.

2.7.5 Fuzzy Logic


Fuzzy logic is an attempt to apply the easy design of logic controllers to the control of complex
continuously varying systems. Basically, a measurement in a fuzzy logic system can be partly true,
that is if yes 1 is and no is 0, a fuzzy measurement can be between 0 and 1(Wikipedia,2010).

The rules of the system are written in natural language and translated into fuzzy logic. For
example, the design for a furnace would start with: "If the temperature is too high, reduce the fuel
to the furnace. If the temperature is too low, increase the fuel to the furnace."

Measurements from the real world (such as the temperature of a furnace) are converted to
values between 0 and 1 by seeing where they fall on a triangle. Usually, the tip of the triangle is
the maximum possible value which translates to 1.

The last step is to "defuzzify" an output. Basically, the fuzzy calculations make a value between
zero and one. That number is used to select a value on a line whose slope and height converts the
fuzzy value to a real-world output number. The number then controls real machinery.

According to Tarun et al (2013), he designed a fuzzy logic algorithm for room temperature and
humidity controller, setting different membership functions and ranges for each of them
respectively. this simplified design algorithm is used to design the fuzzifier, inference
engine, rule base and defuzzifier for the room air conditioning system according to the
control strategy of the processing plant to achieve the quantity and quality of the desire needs
to maintain the room environment. The model operate within 8°C to 44°C temperature range.
And user can set any desired temperature from 18 to 26. For any temperature within 18°C
to 26°C both temperature and humidity controlling part of the proposed model performs
well to maintain the comfort atmosphere of the user. The tables below are the membership
functions for the different temperature ranges.

42
Table 2.3 Membership functions for the current temperature (Tarun et al, 2013).

MEMBERSHIP FUNCTIONS RANGE(°C)

COLD 8 – 14

COOL 13 – 19

NORMAL 18 – 22

WARM 21 – 27

HOT 26 – 32

VERY HOT 31 – 39

EXTRA HOT 38 - 44

2.8 The First Automated Temperature controller


The Automatic Temperature Control System was named as a Historic Mechanical Engineering
Landmark in 2008. Warren S. Johnson came up with the idea for automatic temperature control
while teaching at Normal School in Whitewater, Wisconsin in the 1880's. Originally, janitors
would have to enter each classroom to determine if it was too hot or cold and then adjust the
dampers in the basement accordingly. Johnson sought a way to end, or at least minimize the
classroom interruptions of the janitors and increase the comfort level of the students. The
Automatic Temperature Control System would do just that.

In 1883 Warren Johnson gave up teaching to fully devote his time to researching and
developing his ideas. He moved to Milwaukee and formed the Johnson Electric Service Company
in 1885. In 1895, Johnson patented the pneumatic temperature control system. This allowed for
temperature control on a room by room basis in buildings and homes. It was the first such device
of its kind. By the early 20th century the Automatic Temperature Control System was being used
in many notable places including the New York Stock Exchange, Palaces of Spain and Japan, West
Point, the Smithsonian, the US Capitol Building, and the home of Andrew Carnegie.

43
Back in 1895 the Automatic Temperature Control System outlined the same design principles
used in modern day temperature and climate control systems. A design that sustains relevance for
over 100 years must be a true engineering marvel. The Automatic Temperature Control System
established a great reputation for Johnson Controls. Even in the present day, Johnson Controls
exhibits the enduring legacy of Warren Johnson and his inventions through its 140,000 employees
and services evident in 200 million vehicles, 12 million homes, and 1 million commercial
buildings.

44
CHAPTER 3
METHODOLOGY
3.1 Introduction
In this chapter, the list of the component required as well as technical specification of the
component is discussed, the reasons behind the selection of the components and the purpose(s)
served by each component. It also explains the various connections and sub-circuits that lead to
the realization of this project.The software needed for project development is also discussed in
this chapter.

The methodology adopted in the design and construction for this project is based on system
development life cycle (SDLC) which is divided into three: planning, fabrication and
implementation. The figure below illustrates the system flowchart.

PLANNING CONSTRUCTION TESTING

ELECTRONIC/
SYSTEM DESIGN MECHANICAL
CONTROL

SYSTEM DESIGN
PROCCESS

HARDWARE/SOFTWARE
COMPONENTS

Figure 3.1 Methodology flowchart

45
3.2 Planning
This phase is divided into the two parts; the system design phase and the requirements for
hardware and software.

3.2.1 System Design


For the system design, it shows how the project is been operated. The design is based on varying
room temperature. For the detection of the room temperature, a temperature sensor (type: LM35)
is used. The temperature sensor sends signal to the microcontroller (model:PIC16F877A) while
the microcontroller determines the increase or decrease in the room temperature using a heater
and Air Conditioner (A/C) device respectively based on the received signal from the temperature
sensor. The figure below show the block diagram of the system.

TEMPERATURE
LED
SENSOR

PIC A/C
16F877A

HEATER

LCD
DISPLAY

ARDUINO

CELL BUZZER
PHONE

Figure 3.2 Block diagram of the system

46
The system design is made up of three subsystems:

 Input system
 Output system
 Control system

The input system is responsible for passing the prevailing temperature of the room as it varies
into the controller. Moreso it also provide a user interface. The output is the result of the
processed input data which delivers the necessary adjustment to regulate the temperature of the
room. The control systems are the processors which generate the output, it’s made up of the
Arduino which is responsible for the alert system and the microcontroller which is master brain
of the device responsible for carrying out the main control of the device.

Table 3.1 Breakdown of Components that make up each subsystem.

Subsystems Components

Input system 1. LM35 temperature sensor


2. Keypad/buttons

Output system 1. Fan


2. Heater
3. LCD
4. LEDs indicator
5. Alarm system

Control systems 1. GSM communication module


2. Microcontroller

47
3.2.1.1 Functional Decomposition
 Input system
 Detects temperature of the room
 Allows user interface
 Output system
 Automatically maintains the room temperature
 Display the condition of the device
 Indicates the present state of the room temperature
 Provides heat and cooling source
 Buzzes when temperature exceeds desired range
 Control system
 Buzzes when temperature exceeds desired range.
 Controls the operation of the device.
 Controls the operation of the alert system.

3.2.2 System Design Operation


An automatic temperature control system has the ability to monitor and control the
temperature of a specified space without human interventions. The primary purpose is to manage
the temperature of a given area (i.e. the room) based on settings by a user of the system.

This project uses a PIC microcontroller (PIC16F887A) to automatically control the temperature
of the room. The temperature of the room is measured using the temperature sensor (lm35).

The microcontroller reads the temperature at a specified time (say 10s) and compares it with
the desired value. If the desired value is higher than the measured value, then the heater is turned
ON to heat the room. The heater is switched OFF once the desired temperature is reached. If on
the other hand the measured value is higher than the desired value, then the fan is switched ON
to cool off the room until the required temperature is reached. An LCD display shows the
measured temperature continuously. While the room temperature increases beyond desired
temperature, an alarm system goes off to alert the user through a buzzer on the device and also
via a cell phone.

The programming software used for this project is Flowcode v5 and it is simulated using
Proteus and arduino to program the GSM module.

48
Read Room
Temperature

Is 18°C < Display Normal


Temp<
room temp
26°C

Display Low Turn on


Is Temp< Heater
18° C room temp

Turn on
Is Temp> Display High fan
33° C room temp

Is Temp> Display fire Turn on


40°C Alarm Buzzer

STOP

Fig 3.3 Flowchart Diagram

49
3.3 Hardware and Software Components/Requirements
In this project there are several components included and each of them have their specific
function and task. These components are selected based on circuit reliability, function ability,
and costs. The hardware requirements is divided into seven parts:

 Temperature Sensor
 Microcontroller Module
 LCD
 Other Electrical Components (such transistors, relays etc.)
 Buzzer Module
 GSM communication module
 SMS Network

3.3.1 Temperature Sensor


For the temperature detection section of this project, LM35 temperature sensor would be used to
detect change in temperature of the room. The LM35DZ series are precision integrated-circuit
temperature sensors, which output voltage is linearly proportional to the Celsius (Centigrade)
temperature. This temperature sensor may detect over -55ºC to 150 ºC temperature range and
suitable for the scope of project which temperature range is from0ºC to 60ºC. It can be used with
single power supplies, or with plus and minus supplies. It can be supplied from 4 to 30 Volt and
in this project, it is directly supplied with 5V from voltage regulator. As it draws only 60 mA
from its supply, it has very low self-heating, less than 0.1ºC in still air. It is available in the
plastic TO-92 transistor package. It has 10.0 mV/ºC scale factor and it may operate from 4 to 30
volts .For the system, it will send a signal in voltage to the PIC that will read and convert it to
degree Celsius.

Fig 3.4 LM35 Temperature sensor

50
3.3.2 Microcontroller Module
This module is the brain of the entire project. Once there is a fault with the microcontroller
programming or device, the entire project will not be a success. It receives inputs from the
temperature sensor and outputs the appropriate signals to the LCD display, buzzer, GSM
communication board, In-Circuit Programming (ICSP), etc. In order words, it is interfaced with
the temperature sensor, LCD display, buzzer and the GSM communication board. The
microcontroller is the heart of the whole system as it carries all the codes/programs required for
success operation of the project. It also activates the functionality of the other parts of the
system.

A microcontroller consists of an integrated chip embedded in it. It consists of the CPU, RAM,
ROM, I/O PORTS, Timers designed to execute only specific task needed to control a single
system. PIC Microcontrollers (Programmable Interface Controllers) are electronic circuits
programmed to carry an immense range of tasks. They can be found in alarm systems, phones,
etc. the Microcontroller used in this project PIC16F877A Microcontroller.

3.3.2.1 PIC Microcontroller


The figure (3.6) shows the Pin-out of PIC 16F877A microcontroller that was created by
MICROCHIP. The code used in programming the microcontroller is stored in the program
memory. The PIC 16F877A is a 40-pin DIP Pin-out microcontroller which makes it a lot easier
to use the various peripherals as the functions are distributed round the 4-pins. Its only
disadvantage is the fact that it does not include an internal clock as part of its features. One of its
major advantages is the fact that each pin is only shared between two or three functions so it is
easier to decide the pin function.

Fig 3.5 Pictorial symbol of PIC 16F877A Microcontroller (Campus Component, 2011).

51
Fig 3.6 Pin-out of PIC16F877A Microcontroller (Campus Component, 2011).

3.3.2.2 in Circuit Serial Programming (ICSP)


In-Circuit Serial Programming (ICSP) is a protocol for programming microcontroller devices
like PIC microcontrollers, etc. A programmer is connected to an I/O port of a PC on one side and
to the PIC on the other side. Some of the features of the programming types are:

1. Parallel port: is a large bulky cable. Recent make of laptops from 2010 do not support
this port. The port programming is very fast.

2. Serial port (COM port): they lack adequate circuit programming supply voltage. Recent
make of laptops from 2010 do not support this port.

3. Socket (in or out of circuit): CPU is either removed from the circuit or a clamp is
attached to the chip.

4. USB cable: it supports voltage source. It is the intermediary between the circuit to be
programmed and the computer and is usually less than 180 cm.

Figure (3.7) A typical programming communication system.

52
Figure (3.8): In-Circuit Serial Programming (ICSP) (Campus Component, 2011).
3.3.3 Serial Liquid Crystal Display (LCD)
Liquid Crystal Display is an electro-optical device used to display digits, characters or
images. It is commonly found among digital watches, calculators, portable computers, and so on.
For this project, the LCD displays the following information:

• Information about the designer of this project (which is me);

• Temperature measured by the LM35 sensor;

• The current temperature of the room;

• Indication for fire alarm.

The serial LCD used is the alphanumeric 20×4 LCD display that is 20 columns by 4 rows, as
shown in Figure (3.9). Basically, 16 lines are needed to communicate with this LCD. The main
controller cannot supply all these lines therefore it has to be serially enabled (since it operates
normally in parallel format) using a serial enables backpack.

The 20-character, 4-line parallel liquid crystal display provides a large viewing are. It has an
LED backlight for viewing in a dimly lighted place. It is compatible with a variety of
microcontrollers. A potentiometer also known as a variable resistor is connected to the Vo which
makes it possible for you to set the contrast for optimal viewing of your display.

53
Figure (3.9): A Serial LCD (Campus Component, 2011).

3.3.4 Other Electronic Components Module


Other electrical components that led to the successful operation of this project are capacitors,
transistor, voltage regulator, variable resistor, diode, buzzer, LED, crystal oscillator, step down
transformer, 4 miniature PCB relay etc.

3.3.4.1 Light Emitting Diode (LED)


LED also known as Light Emitting Diode is a special type of diode from the various electronic
components used to displays light when current flows through it in one direction. And this
implies that the diode must be connected in the correct way for current to flow through the right
path.

The positive (anode) leg of the LED is always longer than the negative (cathode) leg. The
negative leg has a flat edge on the plastic casing of the LED. Sometimes when one is confused
about which leg is the positive and negative leg, a series resistor and a multimeter is always used
to note the positive leg from the negative leg.

Figure (3.10): Pictorial and Electrical symbol of LED

3.3.4.2 Resistor
This is a two-terminal electrical or electronics component that resists electric current by
producing a voltage drop between its terminals in accordance with ohm’s law. Resistors may be
connected either way round, and cannot be damaged by heat when soldering.

54
Figure (3.11): Pictorial and Electrical symbol of a resistor

The formula for calculating resistance is:

……3.1

The resistors are made from carbon mixtures, metal films, or resistance wire and they also have
connecting wires attached to them. The electrical resistance is equal to the ratio of the voltage
drop across the resistor and the current through the resistor. The basic unit of a resistor is ohms
(Ω) but throughout the entire project some of the resistors would be having their unit in ‘kilo
ohms (kΩ)’.

3.3.4.3 Capacitor
This electrical device is used to store electrical charge. It consists of two metal plates
separated by a non-conducting (insulating) layer called DIELECTRIC. They are used to smooth
varying DC supplies as they act as reservoirs of charge. They are also used in filter circuits
because capacitors easily pass AC (changing) signals but they block DC (constant) signals. And
make them useful in preventing direct current from entering some parts of an electric circuit.

Figure (3.13): Electrical symbol of a Capacitor

CAPACITANCE

The capacitor’s capacitance (C) is a measure of the amount of charge (Q) stored on each plate for
a given potential difference or voltage (V) which appears between the plates:

(3.2)

It is also used to measure the capacitor’s ability to store charge therefore a large capacitance
means that more charge can be stored. The basic unit of capacitance is a Farad (F). Most times
this unit is too large for practical usage, so microfarad (µF) and Pico farad (pF) are commonly
used.

55
3.3.4.4 Transistor
Transistor is an electrical component that controls the current flow in a circuit. A transistor
acts as an ‘electrical switch’ so that small current can control large current. For example, the
low-current devices like microcontroller controlling the large-current devices like motors.

Transistors are used in radios, electronic toys, electronic staplers, etc.

Transistor has three legs which are labelled base, collector, and emitter. The base leg activates
the ‘electronic switch’. So when small current passes through the base connection, it allows a
much larger current to flow down between the collector and emitter. This larger current is then
used to switch on devices like motors, lamps and buzzers.

For this project, BD139 NPN bipolar transistor is used.

Figure (3.14): Labelled Transistor Legs and transistor (Campus Component, 2011).

3.3.4.5 Diode
This is a semiconductor device that has unidirectional current flowing it is forward or
backward biased. It can be used as a voltage regulator tuning device, frequency multiplying
device, mixing device, etc.

For this project the semiconductor diode is used and it is connected to the buzzer that acts as the
alarm system.

Figure (3.15): Electrical and pictorial symbol of a diode

3.3.4.6 Voltage Regulator


A voltage regulator is an electrical regulator designed to convert varying input voltage and
automatically maintain a constant voltage level. Voltage regulators usually have three legs. For
this project, the 7805 series voltage regulator would be used.

56
THE 7805 SERIES VOLTAGE REGULATOR

Most common voltage regulator part numbers usually begins with the numbers 78 or 79 and ends
with two digits indicating the output voltage. Number 78 means positive voltage while number
79 means negative polarity. For this project 7805 voltage regulator means that we are working
with positive polarity and producing +5 volts regulated and without ripple. This 7805 has three
legs as would be shown in Figure (3.16); the input leg would hold up to 36V DC, the common
leg (GND), and the output leg with the regulator’s voltage.

Figure (3.16): Types of 7805 Voltage Regulator Series (Campus Component, 2011).

3.3.4.7 Variable Resistor


Variable resistor is a rheostat with three terminal resistors whose function is to continuously
adjust tapping point controlled by rotating a shaft or knob. They have resistance that varies
across certain range. Mechanical variable resistor is also known as potentiometer.

It acts as a voltage regulator to regulate the amount of voltage entering the LCD by balancing it
wholly or partially by a known potential difference. Resistors are always attached to one of the
pins of the resistor.

They can be found in electronic analog computers, volume controller in audio equipment etc.

3.3.4.8 Crystal Oscillator


A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a
vibrating crystal of piezoelectric material to create an electrical signal with a very precise
frequency. This frequency is commonly used to provide a stable clock signal for digital
integrated circuits.

3.3.4.9 Transformer
A transformer is an electrical device that transfers electrical energy between two or more circuits
through electromagnetic induction. Commonly, transformers are used to increase or decrease the
57
voltages of alternating current in electric power applications. The main principle of operation of
a transformer is mutual inductance between two circuits which is linked by a common magnetic
flux.

3.3.4.10 Relay
A relay is an electrically operated switch, they can turn on or turn off the power supplied to
another device, like a switch. However, instead of having a person flip the switch, relays switch
when provided with a small amount of power.

3.3.5 Buzzer Module


A buzzer contains a small electronic circuit that generates the electronic signal needed to make
noise. The buzzer has two pins; one pin is connected to the positive input voltage supply and the
other pin is connected to the microcontroller pin no 2.4. When the microcontroller sends a low
signal to the buzzer, the circuit will be completed which triggers the buzzer to start alarming.

Figure (3.17): Electrical and Pictorial symbol of a buzzer (campus component, 2011).

3.3.6 The GSM Communication Module


This board consists of the GSM module, ICSP connector, interface connector to the main board,
GSM module SIM900, the network indicator, the module power on indicator.

3.3.6.1 GSM Modem


GSM modem is a special type of modem that accepts a SIM card, and operates over a
subscription to a mobile phone, the way a mobile phone does.

This GSM modem is connected to a computer so that the computer can communicate over the
mobile network. GSM modems are used to provide mobile internet connectivity but it would be
used to send and receive SMS messages in this project design.

58
3.3.6.2 GSM Modem Hardware Description

Figure (3.18): GSM SIM900 Hardware Description

3.3.6.3 MAX232
This is an integrated circuit which converts signals from an RS-232 serial port to signals that
are suitable for use in TTL compatible digital logic circuit. Therefore, devices that functions on
TTL logic can share the data with devices connected via Serial port (DB9 Connector).

3.3.6.4 Serial Port/DB9 Connector


RS232 cable is attached to this to enable connection to devices that has Serial port/DB9
Connector.

Figure (3.21): Serial port/DB9 connector

59
3.3.6.5 SIM (Subscriber Identity Module) Card Slot
This is an onboard card slot that provides users with the ability to insert a SIM (GSM only) card
of any service provider. Users need to take great precaution to ensure that the power supply is
OFF before inserting in and removing out the SIM card from the SIM card slot. This is so that
after making power supply ON, it will be easy to reinitialize the SIM for this module.

Figure (3.22): SIM Card Slot

3.3.6.6 Power On/Off and GSM on Switch


Power ON/OFF switch is a push-on push-off type of DPDT switch used only to make power
supply on/off provided through AC/DC socket and it is indicated by ‘Power LED’. While the
GSM ON switch is a push on type of DPST tactile switch used to make GSM module ‘On’ and it
is indicated by ‘Module On/Off LED’ while initiating with network is indicated by ‘Network
Indication LED’.

Figure (3.23): Power On/Off and GSM On switch

60
3.3.7 SMS Network
For the SMS network section of this project AT commands would be used to send SMS message
from the system to the receiver’s mobile phone.

SOFTWARE REQUIREMENTS

 PROTEUS VSM (Virtual System Modelling): A design suite that offers the users the
ability to co-simulate both high and low-level microcontroller code in the context of a
mixed mode circuit simulation. It provides debugging facilities including breakpoints,
single stepping and variable display for both assembly code and high level language
source.
 FLOWCODE: A programming tool that uses flowcharts instead of a textual
Programming language. It is used for programming embedded devices such as the
PIC (Peripheral Interface Controller) and AVR (Automatic Voltage Regulation).

3.4 Construction
The procedures undertaken for the fabrication of the device has been divided into two stages:

 The mechanical design.


 The electronic and Control design.

3.4.1 The Electronic and Control Design


The main electrical components required for the construction of the device are:
 Microcontroller PIC16F877A
 LCD display
 LM35 temperature sensor
 Buzzer
 Vero board
 Fan
 Heater

3.4.1.1 Simulation
The simulation of the system is carried out using flowcode, this process involves the real time
analysis of exactly how the system would perform after implementation on a project circuit
board. After the code is successfully created, flowcode allows users to carry out simulations
based on the conditions defined in the code. The flowchart for the temperature control system
employed by the PIC is found on figure3.3.

61
3.4.2 Analysis
The circuit box is placed at the power source of a prototype house, there the LM35 sensor
senses either a rise or drop in the room temperature .the fan and the heater(in this case an
incandescent bulb) placed inside the prototype house. When the room temperature is high or low,
and does not correspond within the normal room temperature i.e. 23°C - 28°C.the
microcontroller in this case sends a signal to either the fan or heater(incandescent bulb) and also
to the buzzer to alert the user in case of an abnormal rise in temperature.

3.4.3 Implementation
At this point of the project, all the findings that has been gathered for the problem statement
and analysis are carried out and used to generate codes that would control the working process of
the system which is fully implemented. The first step was to design the circuit using the Proteus
VSM design suite to ensure that the components would respond appropriately when placed on
the Vero Board.

The design layout is simply a guide that aided in the arrangement of the electrical components on
the project circuit board, it contains information such as the voltage and resistance rating for
several electrical components (resistors, transistors etc.) used for the design of the circuit, it also
provides information on how to fully connect the circuit by showing how every port and pin of
the components should be connected to one another on the project circuit board. The next stage
in the implementation is programming the microcontroller.

62
Figure 3.24 Circuit Diagram on Proteus VSM

3.4.3.1 Programming the PIC16F877A Microcontroller


After the code is fully developed and tested with flowcode and the knowledge of the design
layout is fully understood, the next step is uploading the code to the PIC16F877A
microcontroller. The code blocks written with flowcode is compiled to a .Hex format, the code
is converted because the microcontroller can only interpret and execute commands in a .Hex
format. The .Hex file is uploaded into the PIC with the use of a PIC programmer.

The PIC programmer is connected to the computer with a USB cable through the USB port.

63
Figure 3.25 the PIC Programmer

3.4.3.2 Constructing the Circuit


I. This first step is mounting the PIC16F877A microcontroller on the project circuit board
and solder it against the board carefully.
II. When mounting components parts on the project circuit board, the circuit layout diagram
is used as guide because it contains all the necessary information about the components
and how they are connected to one another.
III. The resistors and diodes are mounted vertically on the board because of space constraints.
IV. The LCD is installed on the project circuit board and calibrated with a variable resistor to
the appropriate voltage required.
V. The LCD is connected to the project circuit board with floppy cables
connected to the appropriate port with respect to the
PIC16F877Amicrocontroller.
VI. The next step is mounting the transistors on the project circuit board connected to the
microcontroller and then solder against the board firmly and carefully.
VII. The LM35 temperature sensor is connected to the proper AN0 port on the PIC16F877A
microcontroller.
VIII. A relay is mounted on the project circuit board to control the flow of electric current.
IX. Every other component is mounted appropriately on the project circuit board and
properly connected to their respective terminals

64
3.4.3.3 Checking the Circuit
After the part of mounting the components on the project circuit board is completed, the
continuity of the circuit is checked. This part of the job is to ensure that the operation of the
circuit will run smoothly.

The tools related with checking the parts is a multimeter and the continuity checking is involved
with every circuit tracks and the point of soldering. By using the buzzer multimeter, it will alert
the failed continuity. The failed continuity is soldered again.

It was also tested by connecting the Vero Board to an external battery to power up the LED
display and then the sensor was placed close to a heated material (the soldering iron). The LED
displayed the temperature and then once it exceeded the desired range, the buzzer started to ring.

The heater, fans and control unit (The Board) were wired to the power cable which is connected
to an external A.C source.

3.4.4 Mechanical Design


In the mechanical design, the model of the project was constructed in the form of a house.it was
constructed with ply wood .the roofing of the model house was made in such a way to allow the
circuit board, transformer and wiring of the device.

The plywood is easy to work with, flexible and is easily replaceable. There is an abundance of
wood available in all parts of the world, whereas plastic may not be. It is still very durable,
and can be comparable in their insulation properties, with heat transfer coefficients ranging
from 0.055 to 0.17 at 25 Celsius. Wood is much less expensive and absolutely non-toxic (unless
treated with toxic stains). Lastly, wood has less of an impact on the environment and is
more sustainable.

The finishing of the wooden model house is done by sandpapering and painting;

 Sandpaper: A sandpaper was used before and after body filling to smoothen the surfaces
for an easier and smoother paint job.
 Painting: Lead oxide was used as a first coat to improve the corrosion resistance
of the metal parts. Then blue and white paint used for ostentation and identification of the
device.

65
Figure 3.26: Front view Figure 3.27: Side view

Figure 3.28: Roof compartment

66
CHAPTER 4
IMPLEMENTATION, TESTING, EVALUATION AND RESULT

4.1 Introduction
This work aims to design and construct an automatic room temperature controller that controls
the regulation of a room temperature for user by turning on the Air-conditioner (AC) and heater
when the room sets hot or cold repectively.in case the temperature exceeds the set temperature,
an alarm is been triggered through the buzzer and a sms alert is been sent to the user of the
alarm.

In this chapter, the implementation of this project based on different components used is
discussed. To make the construction easier and also to aid time management in accomplishing
the project, the entire project was divided into different modules which make trouble shooting
easier. The project is also evaluated using fuzzy logic and Matlab Simulink. Firstly, we
implement each module of the entire project on a breadboard. Once the circuit starts functioning
properly on the breadboard, we transfer the modules carried out on the breadboard unto a Vero
board. After this, we link all this modules on the Vero board together via microcontroller. The
next step is to write your program and upload the program unto the microcontroller chip so as to
perform the desired control operations. The construction is tested after using Proteus VSM and
on the main project model to ensure the temperature sensor is working and the entire device
function properly.

This chapter is then finalized with the details of full system testing and analysis and a BEME
(Bill of Engineering and Evaluation).

4.2 System Implementation and Mathematical Modelling


4.2.1 Temperature Sensor
I used LM35 heat sensor and a comparator for this part of my design. The LM35 heat sensor has
three pins i.e. Pin 1, 2, and 3. I connected pin 1 to Vcc and Pin 2 to the ground while the Pin 3
was my output pin. This pin 3 was then connected to the comparator.

For this design, my threshold temperature is 40°C after which a high signal is sent to the PIC
16F877A microcontroller about a suspected fire occurrence.

Since:

10mv = 1°C
67
5V = 5000mv {because this particular microcontroller has a rating of 5V}

5000mv = 500°C

500°C = 1023

50°C = X {50°C is room temperature i.e. 23°C plus extra 27°C rise in temperature}

Therefore,

50 ×1023
X=
500

X = 102.30

1023
= 2.046
500

𝑐𝑜𝑢𝑛𝑡
Temperature =
2.046

So, count> 61.38 = High Temperature, Check cause

The above temperature is done for all the four temperature sensors. Once count is greater than
81.84, a high signal is sent to the microcontroller through the comparator. The microcontroller
then checks the signal to detect if it is a false alarm or real alarm. If it is a real alarm, the LCD
then displays the state of the temperature and also the word ‘ALARM ON/SMS ALERT’. At this
same time, an SMS is sent to the user to alert him/her about the condition of his/her property.

4.2.3 Programming the PIC Microcontroller


After I had finished writing all my programs for the design project using Flowcode software, I
compiled the program to an HEX file on the Flowcode software. I then installed the software that
came with the programmer which is the USBPICPROG 140616. I then connected my programmer
to my laptop using a USB cable. Once this is done properly the already installed USBPICPROG
140616 should recognize/detect my PIC on my programmer. Next, I opened the HEX file. The
converted file is displayed on the USBPICPROG 140616. I then program my PIC. While carrying
out this process, the yellow LED first comes ON to show the first stage of verification and stops.
Then the red LED starts blinking to indicate that I am actually programming my PIC and this
continues until the programming is done after which it stops blinking. Then a message titled
‘Verified OK’ comes up to indicate that my PIC has been programmed.

68
4.2.4 GSM module Construction
The GSM communications module was built on a separate PCB. Some of the components used in
its construction are listed below and a brief explanation of the construction procedure is describe
below.

4.2.4.1 Construction
The microcontroller socket was placed on the PCB and then soldered in. Other peripheral
components were subsequently placed on the board surrounding it. The GSM module came last
(as it was the largest component). It was placed above the entirety of the other circuits to ensure
that it was accessible for future purposes such as in cases where SIM card has to be replaced. A
serial interface cable was soldered onto the microcontroller for communication with the meter
controller purposes.

After this, I inserted the SIM card into the SIM card slot by first unlocking the SIM card
cover by sliding back. Then I opened the cover and inserted the SIM card according to slot. I
then put down the cover on the SIM card and locked it by sliding forward. This process was done
carefully as the SIM card slot is too delicate while inserting or removing the SIM card. See
figure (4.1) on inserting the SIM card into the SIM card slot.

Next, I operated the power supply on/off and module on/off by first connecting the external
power supply by using battery/adapter/transformer after which I pressed the power on/off switch
(which is a push-on push-off switch) by pushing it to turn the power supply on and pushing it
again to turn the power supply off. During this process, two LEDs would glow; the first is the
power On/Off indicator LED while the other is the Network Status LED (which glows
continuously to indicate either no network or searching for network). Next is to press Module on
switch (which is PWR) for at least 2 seconds, once the Module On/Off LED glows, I released the
switch. The Network LED then blinks to indicate signal strength.

Figure (4.1): Inserting the SIM card into the SIM card slot.

69
Figure (4.2): Power On/Off and Module On/Off process.

Next, I connected the GSM interface board by either using serial port or serial to USB converter
and this was done by connecting the RS232 cable to the GSM interface board.

Figure (4.3): GSM module with RS232 serial cable connection.

Next, I connected the GSM module with serial to USB converter cable via Receiver (RXD),
Transmitter (TXD) and Ground (GND). This was done by connecting CP2102 serial to USB
converter cable to PC through USB cable. I then connected one end of the USB cable to PC’s USB
connector, and finally connected another end of the USB to CP2102 module’s USB connector.

Figure (4.4): GSM module with serial to USB converter via RXD, TXD and GND connection.

Next, I connected three single Berg wires to CP2102 module’s RXD, TXD and GND pins. I then
connected RXD wire to TXD of GSM module and TXD wire to RXD of GSM module. I connected
the GND common by connecting GND wire to GND pin of GSM module.

70
Figure (4.5): Connecting wires to CP2102 module’s RXD, TXD and GND pins.

Next, I tested the GSM module on the terminal software. This was achieved by using shared the
data through serial port. After installing the Real term which appeared as a shortcut on my desktop,
I double clicked on it to open the software. I selected Baud Rate as ‘9600’. I selected COM port to
connect the GSM module. I then clicked ‘Open’ to start communication. I initialized the GSM
module by typing ‘AT’ and the pressed ‘enter. This sends ‘OK’. To send SMS, I typed the
following commands: AT+CMGF=1, I pressed enter key; It then returns
‘OK’;AT+CMGS=”+2348164687596”;It then displays ‘>’ after which I then typed the message
that I want the microcontroller to send to the user’s mobile phone; I then pressed “Ctrl+z” on the
keyboard; It then returns ‘+CMGS: 203’ ‘OK’. This sends the SMS successfully.

4.2.5 The Buzzer


This device consists of two pins; one of which is connected to the power supply while the other
pin is connected to the microcontroller pin. So when there is a potential fire occurrence, the
microcontroller will send a signal to the buzzer, once the circuit is completed, the buzzer is
triggered and it starts alarming.

4.2.6 Transformer
The transformer is employed inn stepping down the voltage generated from the AC source. It
has 400 primary turns i.e. N1 to step down a voltage of 220V which correspond to V1. A
12V output is required. To determine the number of secondary turns for the transformer (N2),
this formula is employed:

400 ×12
Therefore, N→= ≅ 22 turns
2 220

71
4.3 Evaluation
4.3.1 Design Algorithm of Fuzzy logic for the Room Temperature
This design was developed from the works of Tarun Das on fuzzy logic for fuzzy logic for a
room temperature and humidity Controller. This simplified design algorithm is used to
design the fuzzifier, inference engine, rule base and defuzzifier for the room air
conditioning and heater system to maintain the room environment. The model is assumed to
operate within 8’C to 44’C temperature range.

The input variable is taken to be the temperature of the room with the following membership
function;

Table 4.1 Membership Functions for the Temperature

Input Variable: temperature

Membership Function Range ℃

Cold 8-14

Cool 13-19

Normal 18-22

Warm 21-27

Hot 26-32

Very-hot 31-39

Extra-hot 38-44

72
Figure (4.6): plot of membership functions for the temperature

The output variables are taken to be the heat intensity and fan speed of the heater and fan (or AC)
respectively. The heat intensity can either be in ON or OFF state depending on the temperature
preference in the room. If the current temperature of the room is below the desired temperature
then the heater automatically gets on according to temperature difference.

Table 4.2 Membership Functions for Heat Intensity

Output Variable: Heat Intensity

Membership Function Range %

Stop 0-5

Heat-slow 0-45

Heat-medium 36-65

Heat-fast 60-100

73
Figure (4.7): plot of membership functions for heat intensity

If the current temperature of the room is above the desired temperature then this fan
automatically gets on according to temperature difference.

Table 4.3 Membership Functions for Fan Speed

Output Variable: Fan speed

Membership Functions Range %

Stop 0-5

Cool-slow 0-30

Cool-medium 25-50

Cool-fast 45-80

Cool-v.fast 75-100

74
Figure (4.8): plot of membership function for fan speed

The Rule Base is given below;

Table 4.4 Rule base of the fuzzy logic

Rule No Temperature Heat Intensity Fan Speed

1 Cold Heat fast Stop

2 Cold Heat Medium Stop

3 Cool Heat medium Stop

4 Cool Heat slow Stop

5 Cool Stop Stop

6 Cool Stop Cool slow

7 Normal Heat slow Stop

8 Normal Stop Stop

75
9 Normal Stop Cool slow

10 Warm Heat slow Stop

11 Warm Stop Stop

12 Warm Stop Cool slow

13 Warm Stop Cool medium

14 Hot Stop Cool slow

15 Hot Stop Cool medium

16 Hot Stop Cool fast

17 Very hot Stop Cool slow

18 Very hot Stop Cool medium

19 Very hot Stop Cool fast

20 Very hot Stop Cool v.fast

21 Extreme hot Stop Cool v.fast

22 Extreme hot Stop Cool v.fast

76
Figure (4.9): Rule Editor of the room temperature controller

Figure (4.10): Matlab Rule Viewer

77
Figure (4.11): graph of the temperature against the fan speed

Figure (4.12): graph of the temperature against the heat intensity

78
4.4 Testing
The device has to be tested to ensure that the temperature controller is adequately measuring the
room temperature changes and responding likewise to this changes. The testing required during
the construction process are as follows:

 Circuit design test using Proteus VSM.


 Code test to ensure that the sensor responds appropriately.
 GSM Module to ensure that the device responds to alert system.
 Full function test to ensure that entire device functions appropriately.

4.4.1 Circuit Design Test


The circuit was first drawn on paper. Since the efficacy of such circuits are not certain, a circuit
design suite that even allows for simulation to see how the microcontroller would respond to the
various connections was employed (Proteus VSM). The hand drawn circuit was therefore
redrawn on the suite and appropriate connections made, after which a test flowcode was added to
the design to see how the system responds. Picture of the simulation is placed below:

Figure (4.13): Showing Component Connections

79
4.4.2 Program/Code Test
In order to test the code, a heat source and an ice block as well a temporary power source. The
heat source was a soldering iron plugged to an AC source while the temporary power source was
a battery connected to the board. The heat source was placed close to the sensors this
caused the temperature displaying on the LCD display to rise. When the temperature exceeded
the set temperature for the LM 35 temperature sensor employed in the fabrication, the buzzer
came on and showed the display of alert, likewise the LM35 sensor was place on the ice block
which caused the temperature to reduce. This proves that the code programmed on the PIC
controlled the responses of the other components as desired.

4.4.3 GSM Module test


I tested this project design using an available GSM phone. The results were in synchronization
with the data displayed on the LCD. I then tested the design using another GSM phone number
to ensure flexibility and reliability of the system in responding to the temperature exceeding the
set temperature indicating a fire outbreak by using different phone numbers and service networks
providers. The results were also satisfactory as an appropriate response in the form of a SMS was
sent to the appropriate user during a potential fire outbreak.

The devices used during the testing process were up to standard to ensure the integrity of the data
being passed through the MAX232 IC. All results were satisfactory.

80
4.5 Result

Figure (4.14): (a) front view with LCD, (b) side view with socket outlet for external fan, (c) roof
compartment for circuit board and wiring.

81
CHAPTER 5
CONCLUSION AND RECOMMENDATION
5.1 Introduction
This design project was carried out with suitable and available materials so as to maximize utility
of the design, even though minimal problems were encountered during its construction. Though
some challenges were developed when searching for suitable components, testing of the final
prototype produced relatively accurate data and the implementation of the design can be rated as
an overall success.

This chapter examines how the system design and construction meets the requirements and
objectives that were stated in the introduction section of chapter one. The project will be
observed wholly and alternative methods of implementation will be cited. Possible
improvements to this project will also be mentioned, as well as challenges encountered in the
course of work. It will subsequently end with the experience gained and the conclusion.

5.2 Achievement
In line with the objectives cited at the beginning of this project, this project has developed a
smart temperature controlled environment (i.e.) a room environment, incorporating the GSM
Module as an interface between the user and the device.it has been able to alert the user via the
GSM and the buzzer connected to the device of an abnormal rise in temperature, by detecting the
room temperature with the temperature sensor if it is still in the programmed range of
temperatures incorporated into the design.

I also added LEDs which indicates the different temperature changes as detected by the
temperature sensor.by the time the room temperature exceeds 40℃, the device was able to send
an SMS alert to my phone of the present rise in temperature and indication to check for a
potential fire outbreak and while the temperature was low, the heater (in form of an incandescent
bulb) came on, likewise the fan, when the temperature was high. The whole design worked
perfectly as it was programmed.

82
5.3 Challenges
A major challenge encountered is the fact that this system is dependent on the service provider so
when their server is down SMS part of this system would be unoperational. Also network
interference and network coverage areas are another challenge.

Another challenge faced was the rise in dollar rating which affected some of our components that
were not local unavailable. Also, considering the delays into our project timeline due to the
shipping of our imported components was a challenge. All these introduced extra costs into our
budget.

5.4 Recommendation
For further advancement and improvement on this project, the following measures can be carried
out:
 The addition of a wireless controller to turn on and off the device as needed.
 Ability of the device to operate on both AC and DC device.
 Addition of security alarm.
 Eliminating dependency on the service providers to prevent the SMSing part of this
system being down when the service providers are unoperational.
 Eliminating network interference with this system.
 Joint partnership with telecommunication companies to eliminate the issue of coverage
areas.

5.5 Conclusion
The Automatic Room Temperature Controller designed to control room temperature is one that
continues to add increasing value to the home automation system by making the home a smart
environment and it is a viable design that have an impressive prospect for the future. This
chapter has served to provide a general summary and conclusion of this project work, and has
also highlighted possible future improvements which would lead to advancements in the home
automation system.

83
REFERENCE
1. ABD Halim B.Z. Automatic Room Temperature Controller. FY report (2011), Universiti
Teknikal Malaysia Melaka, Malaysia, April 2011.
2. Ahmad Faris B.Z. Automatic Temperature Control with Security System. FY report
(2009). Universiti Malaysia Pahang, Malaysia, May 2009.
3. Aigbokhan E.M, Design and Construction of an Incubator with Phototherapy Unit. Bells
University of Technology Ota, Nigeria, July 2015.
4. Akpado K.A, Ezeagwu C.O, Ejiofor.A, Nwokoko A.O. Design, Modelling and
Simulation of a Microcontroller Based Temperature Control in a Ventilation System.
IJAREEIE vol 2, issue 7, July 2013.
5. Best-Microcontroller-Projects.com. (2005-2015). Best Microcontroller Projects Home
page. Retrieved February 7, 2015, from View Mobile Site: http://www.best-
microcontroller-projects.com/16F877A.html
6. Campuscomponent. (2011). GSM Interfacing Board. (C. C. Ltd, Ed.) Retrieved March 3,
2015, from http://www.campuscomponent.com: http://www.campuscomponent.com
7. CAPGO (n.d), History of Temperature home page,http://www.google.com/history of
temperature/Capgo/home/resources/interest/history of temperature, retrieved February,
2016.
8. Consortium, T. I. (n.d). Global System for Mobile Communication (GSM). Retrieved
January 25, 2004, from Web ProForum Tutorials: http://www.iec.org
9. Consortium, T. I. (n.d.). Global System for Mobile Communication (GSM). Web
ProForum Tutorials, 1-19.
10. Kumar.J,Kapoor.R,Brijebda,Hement,Jyoti.Comparative Analysis of Room Temperature
Controller using Fuzzy Logic & PID.AEEE,volume 3,No 7:Pp 853-858 (2013).
11. Levarda.B and Budaciu.C.The Design of Temperature Control System using
PIC18F4620.Buletinul Institutului Politechnic Din Lasi,Tomul LVI(LX),Fasi 4,2010.
12. Mechanical Engineering (n.d), Temperature and its
Measurement,http://www.google.com/temperature measurement/mechanical
engineering/home/temperature and its measurement, retrieved February 2016.
13. Nor Mazlu. B.N.Automatic Room Temperature Control Sytem.FY report 2009,
Universiti Malaysia Pahang, Malaysia, May 2009.
14. Oyekola A.O, Design and Construction of a Smoke and Heat Detection System with
SMS Alert. Bells University of Technology Ota, Nigeria, July 2015.

84
15. Oryon Technology. Automatic Room Temperature Controller. Oryon Technology Ltd,
2015.
16. Prezi(n.d),Automatic Room Temperature Controller by Ruru Martin(april,2014),retrieved
January ,2016.
17. SMS Tutorial AT Command Operations Test, Set, Read and Execution. (n.d.). Retrieved
January 15, 2008, from Google: SMS Tutorial AT Command Operations Test, Set, Read
and Execution.htm
18. SMS Tutorial Checking if the Use of AT Commands to Send, Receive and Read SMS
Messages is supported. (n.d.). Retrieved January 15, 2008, from Google: SMS Tutorial
Checking if the Use of AT Commands to Send, Receive and Read SMS Messages is
Supported.htm
19. SMS Tutorial Introduction to SMS Messaging-Short Message Service, Concatenated
SMS-Long SMS and EMS. (n.d.). Retrieved January 15, 2008, from Google: SMS
Tutorial Introduction to SMS Messaging-Short Message Service, Concatenated SMS-
Long SMS and EMS.htm
20. Wikipedia. (n.d.). In-circuit serial programming, CC BY-SA 3.0. (Wonderfl, Editor,
Wikipedia, Producer, & Wikipedia) Retrieved February 7, 2015, from Wikipedia:
en.m.wikipedia.org/wiki/In_circuit_serial_programming
21. Wikipedia (n.d), Control Sytem,http://www.wikipedia.com/control system, retrieved
December 2015.
22. Wikipedia (n.d), Microcontroller,http://www.wikipedia.com/microcontroller,retrieved
February 2016.
23. Wikipedia (n.d), Room Temperature,http://www.wikipedia.com/room temperature,
retrieved January 2016.
24. Wikipedia (n.d).Temperature Control,http://www.wikipedia.com/temperature
control/.retrieved September 2015.

85
APPENDIX
APPENDIX A: FLOWCODE

86
87
88
89
90

You might also like