Wireless Monitoring System For Temperature Monitoring.

(1)

“I hereby declared that I have read through this report and found that it has comply the partial fulfillment for awarding the degree of Bachelor of Electrical Engineering

(Control, Instrumentation and Automation)”

Signature : ……….

Supervisor’s Name : PN. AZRITA BINTI ALIAS


(2)

i

WIRELESS MONITORING SYSTEM FOR TEMPERATURE MONITORING

YAP WAI MUN

This Report is Submitted In Partial Fulfillment of Requirements For The Degree of Bachelor In Electrical Engineering (Control, Instrumentation and Automation)

Faculty of Electrical Engineering University Technical Malaysia Malacca


(3)

ii

“I hereby declared that this report is a result of my own work except for the except that have been citied clearly in the references.”

Signature : ……….

Name : YAP WAI MUN


(4)

iii


(5)

iv

ACKNOWLEDGEMENTS

I would like to offer thanks and deepest gratitude from the bottom of my heart for all the support, encouragement and inspirations I obtained through the duration

of this project. The help rendered to me priceless, be it from the smallest of its kind to the largest. They include;

My supervising lecturer, Pn. Azrita binti Alias of which me had a good working relationship,

and who offered me tremendous help and guidance along the completion of this project,

My family, who inspired me weather through the storm and carry on, My beloved, who kept me through it all

Lecturers and relevant personnel who helped me in one way or other;


(6)

v

ABSTRACT

Currently, weather is very unpredictable due to global warming. This unstable weather is harmful to some plants, patients in hospital, some research, and any process that need to be done under a certain condition. In order to prevent the risk of hazardous and reduce unfavorable condition in a room, we may need a system to control the temperature in the room. Thus, a wireless control system for temperature monitoring is developed to monitor the temperature in a room. The system consists of two parts; they are remote location and control room. Each pair of transmitter and receiver is placed in remote location and a control room. Remote location is equipped with a temperature sensor, fan and liquid crystal display. Control room is equipped with liquid crystal display and buzzer as siren. Control room’s antenna receives signal data from remote location to display current temperature on seven-segment display and transmit the data back to control the fan if the temperature is exceeding 30 degree Celsius. If temperature is exceeding 40 degree Celsius, the siren in Control Room is activated to indicate high risk situation.


(7)

vi

ABSTRAK

Kebelakangan ini, cuaca semakin sukar diramalkan disebabkan oleh pemanasan global. Cuaca yang tidak stabil ini akan mendatangkan keburukan atau bahaya kepada tumbuhan, pesakit-pesakit di hospital, penyelidikan dan mana-mana proses yang dijalani di bawah keadaan yang tertentu. Untuk mengelakkan risiko yang merbahaya dan keadaan yang tidak selesa di dalam bilik, kita memerlukan satu sistem yang dapat mangawal suhu dalam bilik. Oleh itu, satu sistem pengawalan suhu bilik akan dikira dan diuji. Sistem ini dibahagikan kepada dua bahagian; iaitu bilik yang dikawal dan bilik kawalan. Dua pasang pemancar dan penerima akan dipasang di bilik dikawal dan bilik kawalan masing-masing. Di bilik dikawal, ia juga dipasang dengan pengesan suhu, kipas, dan paparan. Manakala di bilik kawalan, ia dipasang dengan paparan dan siren sebagai isyarat bahaya. Bilik kawalan akan menerima data isyarat dari bilik dikawal untuk memaparkan suhu bilik tersebut. Jika suhu melebihi 30 darjah celsius, bilik kawalan akan menghantar data isyarat balik ke bilik dikawal untuk memasang kipas. Jika suhu terus naik dan melebihi 40 darjah celsius, loceng bilik kawalan akan berbunyi dan kipas di kawalan akan terus terpasang. Jika suhu diturunkan dan kurang daripada 40 darjah Celcius, siren akan ditutup.


(8)

vii

CONTENTS

CHAPTER TITLE PAGE

ACKNOWLEDGEMENT iv

ABSTRACT v

ABSTRAK vi

CONTENTS vii

LIST OF TABLES x

LIST OF FIGURES xi

LIST OF ABBREVIATION xiii

LIST OF APPENDIX xiv

I INTRODUCTION

1.1 Overview 1

1.2 Problem Statements 2

1.3 Project Objectives 3

1.4 Project Scope 4

1.5 Organization of the Thesis 5

II LITERATURE REVIEW

2.1 Microcontroller 7

2.2 Wireless Communication 9

2.2.1 Encoders and Decoders 14

2.2.2 Transmitter 15

2.2.3 Receiver 17


(9)

viii

2.3 Temperature Sensor 21

2.4 Case Study: Temperature Control Project 29

III METHODOLOGY

3.1 Planning of the Study 32

3.2 Block Diagram 34

3.3 System Operation 35

3.4 Microcontroller Board Module 35

3.4.1 Power Supply Circuit 38

3.4.2 Reset Circuit 39

3.5 Wireless Communication Module 40

3.5.1 Encoder 41

3.5.2 Decoder 43

3.5.3 Transmitter 45

3.5.4 Receiver 47

3.5.5 Antenna 48

3.6 Sensor 49

3.7 Control Fan 50

IV SOFTWARE DEVELOPMENT

4.1 Introduction 53

4.2 MikroC Programming 53

4.3 Proteus Professional 7

4.4 Microcontroller PIC16F877A ISKIM Board Testing

56 57

4.5 Sensory Module Testing 59

4.6 Wireless Communication Module 61

4.6.1 Remote Room 61

4.6.2 Control Room 64

V RESULT AND ANALYSIS


(10)

ix

5.2 Microcontroller PIC16F877A Testing 70

5.3 LCD Circuit Testing 72

5.4 Sensory Module Circuit Testing 74

5.5 Wireless Communication Testing 77

5.5.1 Data Encoder and Decoder Circuit Testing 78

5.5.2 Transmitter and Receiver Circuit Testing 79

5.5.3 Wireless Module Circuit Testing 80

5.6 Analysis of the Results 78

VI CONCLUSION AND RECOMMENDATION

6.1 Conclusion 80

6.2 Recommendation 82

VII REFERENCE 83


(11)

x

LIST OF TABLES

NO TITLE PAGE

3.1 Control Pin Functions 43


(12)

xi

LIST OF FIGURES

NO TITLE PAGE

2.1 Basic Microcontroller System 7

2.2 RTD Resistance vs. Temperature 16

2.3 Thermistor Resistance vs. Temperature 17

2.4 Thermocouple 18

2.5 LM34, LM35, LM45 Typical Connections 19

2.6 LM134 Typical Connections 20

2.7 LM56 Block Diagram 20

2.8 LM75 Block Diagram 21

3.1 Methodology Process Flow Chart 23

3.2 Block Diagram for Wireless Temperature Monitoring 24

3.3 Pin Assignment for PIC16F877A 26

3.4 Block Diagram of PIC16F877A 27

3.5 Power Supply Circuit 28

3.6 Reset Circuit 29

3.7 Clock Circuit 30

3.8 Wireless Communication Network 30

3.9 Flow Chart of HT12E 31

3.10 Pin Assignment of HT12E 32

3.11 3.12 3.13 3.14 3.15 3.16 3.17

Circuit Application for HT12E Flow Chart of HT12D

Pin Assignment for HT12D Pin Assignment of TWS-BS-3

Simplified Connection of Transmitter Circuit and Encoder Pin Assignment of RS-433

Simplified Connection of Receiver Circuit and Decoder

33 34 35 36 36 37 38


(13)

xii 3.18

3.19 4.1 4.2 4.3 4.4 4.5

Pin assignment for LM35 Motor Driver L293D

LM 35 and LCD Circuit Connection The Data Transmitting in Remote Location The Data Receiving in Control Room Program Flow Chart in Remote Location Program Flow Chart in Control Room

40 41 44 45 46 47 48


(14)

xiii

LIST OF ABBREVIATION

PIC - Peripheral Interface Controller

LCD - Liquid Crystal Display

CPU - Central Processing Unit

I/O - Input or Output

ROM - Read Only Memory

RAM - Read Access Memory

EEPROM - Electrically Erasable Programmable Read-Only Memory

EPROM - Erasable Programmable Read-Only Memory

LED - Light Emitting Diode

ADC - Analogue to Digital Converter

RF - Radio Frequency

MHz - Mega Hertz

KHz - Kilo Hertz

IC - Integrated Circuit

VSWR - Voltage Standing Wave Ratio

dB - Desibel

SAR - Specific Absorption Rate

LTCC - Low Temperature Co-fired Ceramic

RTD -Resistance Temperature Detector

PWM - Pulse Width Modulation

AC - Alternating Current

DC - Direct Current

CMOS - Complementary Metal-Oxide Semiconductor

IR - Infrared Red

ASK - Amplitude Shift Keying

CPLD - Complex Programmable Logic Device

UART - Universal Asynchronous Receiver


(15)

xii

LIST OF APPENDIX

NO TITLE PAGE

1 Remote Room Circuit Diagram 85

2 Control Room Circuit Diagram 86

3 Remote Room MikroC Programming 87


(16)

1

CHAPTER 1

INTRODUCTION

1.1 Overview

Nowadays, embedded system is widely used in an engineering field. An embedded system is a single-purpose computer built into a larger system for the purposes of controlling and monitoring the system. Such systems use microcontrollers or microprocessors, or they may use custom-designed chips but that is not a general purpose workstation, desktop or laptop computer. They are employed in automobiles, machine tools, cameras, consumer electronics, office appliances and others.

At the same time, wireless system which is one of the technology that transfer the information over a distance without the use of electrical conductors or “wires”. It is commonly used in the telecommunications industry for example remote controls, computer networks which use some form of energy such as radio frequency, infrared red, laser light, visible light and acoustic energy.

This perfect combination of wireless and embedded system is mostly used for the technology. For example, we can easily connect to each other with the mobile phone


(17)

2

which is using this combination system. Apart from that, we can span a distance beyond the capabilities of typical cabling for the embedded system.

Currently, weather is very unpredictable due to global warming. This will affect many of the places that need to be operated under a certain condition such as factory, lab, hospital and research centre. In order to prevent the risk of hazardous and provide earlier emergency awareness to the human, embedded control system combines with wireless control system to control the temperature in the remote room.

1.2 Problem Statements

Temperature monitoring is very important to the laboratory or industrial plant for the safety of the workers and to make sure that the environment is conducive to the machine operating. For the semiconductor manufacturing plant, the component is very sensitive to the temperature. It will be easily defect cause by the temperature. Thus, temperature controlled is the main criteria to be emphasize on. Besides that, the machine that is operated must be work in under conditions. It must be expose to the temperature that is suitable under conditions respectively. For the chemical plants, the chemical substances will be easily exploded due to the non suitable temperature. It is very dangerous and may affect the public safety.

Besides that, the transfer of information over a long distance need a wireless technology that without using electrical conductors or wires. One of the benefits of the wireless is the wireless solutions addressed with simple wire replacement, where the radio frequency communication link emulates wire in an existing system. No changes are made to the system architecture. Rather, wireless links are used to transmit the same


(18)

3

data that the physical wire once carried. Using wireless system is due to the consideration of the safety.

Another benefit of wireless is the speed of deployment. Wired systems can take days to weeks to be properly installed, isolated, and commissioned. Wireless networks require only the endpoints to be installed, saving hours or days for each instrument that is installed. Other instruments can be added as required without the need for expensive, disruptive cabling and labor.

A further benefit of the wireless system is the ease of reconfiguration and expansion. If there is the need for a plant expansion or relocation of instruments, there is no expensive conduit to be moved or added. If the instruments to be connected to the control panel need to be placed on mobile equipment, such as the mobile batch containers found in biotech, pharmaceutical, and other specialty chemical installations, wireless offers an attractive solution.

1.3 Project Objectives

These are the objectives of this project:

1. Design a wireless control system for indoor temperature monitoring using microcontroller PIC16F877A.

2. Develop its monitoring system to prevent the risk of hazardous.

3. Provide earlier emergency awareness to the human when the temperature reach to the critical level.


(19)

4

1.4 Project Scope

The scope of this project is to design a temperature monitoring system that consists of a control room and the remote locations. User can set the range of the desired temperature in the control room. When the temperature is out of the range, control room will receive the signal and control the temperature in remote location by switching on heater or air-conditioner. If the temperature is continuing increase and reach the critical level, the buzzer in the control room will be activated to indicate high alarm situation. The temperature of remote room will be displayed at both locations by using LCD. The system is controlled automatically without human observation by using microcontroller.

The system design is based on microcontroller PIC16F877A. In order to achieve the objective, the project is divided into two parts:

 Hardware design that consists of microcontroller, encoder, decoder,

transmitter, receiver, sensor, LCD and motor.


(20)

5

1.5 Organization of the Thesis

The thesis is orderly organized into 5 chapters.

CHAPTER 1 : INTRODUCTION

This chapter presents the basic operation of this project, problem statements, objectives of project, scope of project and organization of report.

CHAPTER 2 : LITERATURE REVIEW AND PROJECT BACKGROUND This chapter would present the literature research on the selection of components.

CHAPTER 3 : METHODOLOGY

This chapter would present the methodology that adapted to conduct the final year project, including the method and

sequence of process flow which used to perform for this project will be explained details and ensure the best understanding of conducting this project.

CHAPTER 4 : SOFTWARE DEVELOPMENT

This chapter would discuss the development of the software of each module and system operation. This chapter also includes the flowchart of each module.


(21)

6

CHAPTER 5 : TESTING AND EVALUATING RESULT

This chapter would presents various testing and results that are conducted to each module. Some recommendation and system upgrades are also discussed.

CHAPTER 6 : CONCLUSION

This chapter presents the overall conclusion for this thesis and a

few suggestion and recommendation are proposed for


(22)

7

CHAPTER 2

LITERATURE REVIEW AND PROJECT BACKGROUND

2.1 Microcontroller

Microcontroller is a single chip used to control other devices. It processes data, analog and/or digital and outputs data in digital form. Examples of microcontroller are 68HC11, 68332, MPC555, PIC16F870, Intel 8051. Microprocessor is a single chip that contains the CPU or most of the computer. Pentium, PowerPC chip are belongs to microprocessor. A microcontroller is essentially a microprocessor with several other features embedded onto a single chip. Microcontrollers mostly used in automobiles, automatic cameras, CD player. In fact, industry sells 10 times as many microcontrollers as microprocessors. It may cause of the microcontroller reduce the chip count and reduced the power consumption. Besides that, the design cost can be reduced and many applications do not require as much as computing power.

The main parts of a microcontroller consist of CPU, Memory, I/O. The Central Processing Unit is the “smart part” of the computer that processes data and makes decisions. The microcontroller has three types of memory that is RAM, ROM and EEPROM. Random Access Memory storing the data while microcontroller is running


(23)

8

and the Read Only Memory storing boot up data information. EEPROM or EPROM function as persistent storage of data parameters that can be rewritten. For example, alarm clock saving the time when the power goes off. The input and output is a method to interact with the world outside the microcontroller.

In order to choose a microcontroller for a particular control system, we have to consider the block diagram of the microcontroller system as shown in Figure 2.1.

Figure 2.1: Basic Microcontroller System

The input components would consist of digital devices such as switches, push buttons, pressure mats, float switches, keypads, radio receivers and analogue sensors such as light dependent resistors, thermistors, gas sensors, pressure sensors. The control unit is of course the microcontroller. The microcontroller will monitor the inputs and as a result the program would turn outputs on and off. The microcontroller stores the program in its memory, and executes the instructions under the control of the clock

circuit. The output devices would be made up from LED’s buzzers, motors, alpha

-numeric displays, radio transmitters, 7-segment displays, heaters, fans.

According to Dave Smith (2002), the most obvious choice then for the microcontroller is how many digital inputs, analogue inputs and outputs the system requires. This would then specify the minimum number of inputs and outputs (I/O) that


(24)

9

the microcontroller must have. If analogue inputs are used then the microcontroller must have an Analogue to Digital (A/D) module inside.

The next consideration would be what size of program memory storage is required. This should not be too much a problem when starting out, as most programs would be relatively small.

The clock frequency determines the speed at which the instructions are executed. This is important if any lengthy calculations are being undertaken. The higher the clock frequency the quicker the micro will finish one task and start another.

Other considerations are the number of interrupts and timer circuits required, and how much data EEPROM if any is needed.

2.2 Wireless Communication

The transmitter portion of a wireless remote control system usually consists of an encoder that automatically generates serial data that contains both address bits, data bits and an RF transmitter module that sends the serial data by wireless. The receiver portion consists of an RF receiver module and a decoder to receive the data. Address bits are used to give an identity to transmitters and receivers so that only those identical address settings can process data.


(1)

1.4 Project Scope

The scope of this project is to design a temperature monitoring system that consists of a control room and the remote locations. User can set the range of the desired temperature in the control room. When the temperature is out of the range, control room will receive the signal and control the temperature in remote location by switching on heater or air-conditioner. If the temperature is continuing increase and reach the critical level, the buzzer in the control room will be activated to indicate high alarm situation. The temperature of remote room will be displayed at both locations by using LCD. The system is controlled automatically without human observation by using microcontroller.

The system design is based on microcontroller PIC16F877A. In order to achieve the objective, the project is divided into two parts:

 Hardware design that consists of microcontroller, encoder, decoder, transmitter, receiver, sensor, LCD and motor.


(2)

1.5 Organization of the Thesis

The thesis is orderly organized into 5 chapters.

CHAPTER 1 : INTRODUCTION

This chapter presents the basic operation of this project, problem statements, objectives of project, scope of project and organization of report.

CHAPTER 2 : LITERATURE REVIEW AND PROJECT BACKGROUND This chapter would present the literature research on the selection of components.

CHAPTER 3 : METHODOLOGY

This chapter would present the methodology that adapted to conduct the final year project, including the method and

sequence of process flow which used to perform for this project will be explained details and ensure the best understanding of conducting this project.

CHAPTER 4 : SOFTWARE DEVELOPMENT

This chapter would discuss the development of the software of each module and system operation. This chapter also includes the flowchart of each module.


(3)

CHAPTER 5 : TESTING AND EVALUATING RESULT

This chapter would presents various testing and results that are conducted to each module. Some recommendation and system upgrades are also discussed.

CHAPTER 6 : CONCLUSION

This chapter presents the overall conclusion for this thesis and a few suggestion and recommendation are proposed for


(4)

CHAPTER 2

LITERATURE REVIEW AND PROJECT BACKGROUND

2.1 Microcontroller

Microcontroller is a single chip used to control other devices. It processes data, analog and/or digital and outputs data in digital form. Examples of microcontroller are 68HC11, 68332, MPC555, PIC16F870, Intel 8051. Microprocessor is a single chip that contains the CPU or most of the computer. Pentium, PowerPC chip are belongs to microprocessor. A microcontroller is essentially a microprocessor with several other features embedded onto a single chip. Microcontrollers mostly used in automobiles, automatic cameras, CD player. In fact, industry sells 10 times as many microcontrollers as microprocessors. It may cause of the microcontroller reduce the chip count and reduced the power consumption. Besides that, the design cost can be reduced and many applications do not require as much as computing power.

The main parts of a microcontroller consist of CPU, Memory, I/O. The Central Processing Unit is the “smart part” of the computer that processes data and makes decisions. The microcontroller has three types of memory that is RAM, ROM and EEPROM. Random Access Memory storing the data while microcontroller is running


(5)

and the Read Only Memory storing boot up data information. EEPROM or EPROM function as persistent storage of data parameters that can be rewritten. For example, alarm clock saving the time when the power goes off. The input and output is a method to interact with the world outside the microcontroller.

In order to choose a microcontroller for a particular control system, we have to consider the block diagram of the microcontroller system as shown in Figure 2.1.

Figure 2.1: Basic Microcontroller System

The input components would consist of digital devices such as switches, push buttons, pressure mats, float switches, keypads, radio receivers and analogue sensors such as light dependent resistors, thermistors, gas sensors, pressure sensors. The control unit is of course the microcontroller. The microcontroller will monitor the inputs and as a result the program would turn outputs on and off. The microcontroller stores the program in its memory, and executes the instructions under the control of the clock circuit. The output devices would be made up from LED’s buzzers, motors, alpha -numeric displays, radio transmitters, 7-segment displays, heaters, fans.

According to Dave Smith (2002), the most obvious choice then for the microcontroller is how many digital inputs, analogue inputs and outputs the system requires. This would then specify the minimum number of inputs and outputs (I/O) that


(6)

the microcontroller must have. If analogue inputs are used then the microcontroller must have an Analogue to Digital (A/D) module inside.

The next consideration would be what size of program memory storage is required. This should not be too much a problem when starting out, as most programs would be relatively small.

The clock frequency determines the speed at which the instructions are executed. This is important if any lengthy calculations are being undertaken. The higher the clock frequency the quicker the micro will finish one task and start another.

Other considerations are the number of interrupts and timer circuits required, and how much data EEPROM if any is needed.

2.2 Wireless Communication

The transmitter portion of a wireless remote control system usually consists of an encoder that automatically generates serial data that contains both address bits, data bits and an RF transmitter module that sends the serial data by wireless. The receiver portion consists of an RF receiver module and a decoder to receive the data. Address bits are used to give an identity to transmitters and receivers so that only those identical address settings can process data.