Top Banner
1 INTEGRATED REFINERY FIRE AND GAS MONITORING SYSTEM USING ZIGBEE Submitted in partial fulfillment of the requirements for the award of Bachelor of Engineering Degree in Electronics and Instrumentation Engineering By BLESSY ANN JOSEPH (3018125) JUL STEFFO (3018148) DEPARTMENT OF ELECTRONICS AND INSTRUMENTATION ENGINEERING FACULTY OF ELECTRICAL AND ELECTRONICS ENGINEERING SATHYABAMA UNIVERSITY JEPPIAAR NAGAR, RAJIV GANDHI SALAI, CHENNAI 600119. TAMILNADU. MARCH 2014
57

Final Report Content

Jul 16, 2015

Download

Documents

Steffo Sharlin
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Final Report Content

1

INTEGRATED REFINERY FIRE AND GAS MONITORING

SYSTEM USING ZIGBEE

Submitted in partial fulfillment of the requirements for the award of

Bachelor of Engineering Degree in

Electronics and Instrumentation Engineering

By

BLESSY ANN JOSEPH (3018125)

JUL STEFFO (3018148)

DEPARTMENT OF ELECTRONICS AND INSTRUMENTATION ENGINEERING

FACULTY OF ELECTRICAL AND ELECTRONICS

ENGINEERING

SATHYABAMA UNIVERSITY

JEPPIAAR NAGAR, RAJIV GANDHI SALAI,

CHENNAI – 600119. TAMILNADU.

MARCH 2014

Page 2: Final Report Content

2

SATHYABAMA UNIVERSITY (Established under Section 3 of UGC Act, 1956)

Jeppiaar Nagar, Rajiv Gandhi Salai, Chennai- 600 119 www.sathyabamauniversity.ac.in

DEPARTMENT OF ELECTRONICS AND INSTRUMENTATION ENGINEERING

BONAFIDE CERTIFICATE

This is to certify that this Project Report is the bonafide work of BLESSY ANN JOSEPH

(3018125) and JUL STEFFO (3018148) who carried out the project entitled

“INTEGRATED REFINERY FIRE AND GAS MONITORING SYSTEM USING

ZIGBEE” under our supervision from November 2013 to March 2014.

Internal Guide

Mr. S.AARON JAMES, M.E., M.B.A.,

Head of the Department

Mrs. SUJATHA KUMARAN M.S., (Ph.D)

Submitted for Viva voce Examination held on_____________________

Name :

Signature:

INTERNAL EXAMINER EXTERNAL EXAMINER

Page 3: Final Report Content

3

DECLARATION FORMAT

We, Blessy Ann Joseph (3018125) and Jul Steffo (3018148) hereby declare that the

Project Report entitled “INTEGRATED REFINERY FIRE AND GAS MONITORING

SYSTEM USING ZIGBEE” done by us under the guidance of Mr. S.Aaron James,

M.E, M.B.A., is submitted in partial fulfillment of the requirements for the award of

Bachelor of Engineering degree in Electronics And Instrumentation.

1.

2.

DATE: PLACE: SIGNATURE OF THE CANDIDATES

Page 4: Final Report Content

4

ACKNOWLEDGEMENT

The satisfaction and elation that accompany the successful completion of any

task would be incomplete without the mention of the people who have made it a

possibility. It is our great privilege to express our gratitude and respect to all those who

have guided and inspired us during the course of the project work.

We would like to express our sincere gratitude to our honorable chancellor

Col. Dr. Jeppiar, M.A., B.L., Ph.D., for giving us a platform wherein we could perform

and give our best. We would like to thank our beloved directors

Dr. Marie Johnson, B.E., M.B.A., M.Phil., Ph.D., and

Dr. Mariazeena Johnson, B.E., M.B.A., M.Phil., Ph.D., for their support. We would

like to thank our vice chancellor Dr. B. Sheela Rani, M.S (By Research),

Ph.D., our registrar Dr.S.S.Rau Ph.D., and the Controller Of Examinations,

Dr. K. V. Narayanan Ph.D. for their timely support.

We would like to sincerely thank our Faculty Head

Dr.E.Logashanmugam,M.E., Ph.D. and our Head of the Department

Mrs. Sujatha Kumaran M.S., (Ph.D.), and Faculty Head for having been a constant

source of support and encouragement for completion of the project.

We would like to express our sincere gratitude to our guide

Mr. S.Aaron James M.E., M.B.A. for his constant guidance and supervision

throughout the course of our project work. We are grateful for his time and support till

the completion of our project.

We would also like to thank our CPCL guide Mr. A.Gowthaman M.E., M.B.A.

for his timely help and support.

Page 5: Final Report Content

5

ABSTRACT

“Integrated refinery fire and gas monitoring system” is designed to monitor fire

and gas leakage and population density in the hazardous locations within the refinery.

The existing system detects any fire or any gas leakage with in geographically

distributed areas. Increase in the complexity of process industry leads to increase in

the number of instruments to detect fire and leak. This increases the number of cables

that run from industrial sensors to the control station. This also increases the size of

the duct. Troubleshooting the reduced insulation or any wire open is difficult because

it is a messy wiring and identifying the individual cable is very difficult along the duct.

This also increases the project cost in terms of cable cost. So to cope up with the

modern technology it is proposed to have a wireless communication between field

devices and the control room. With the advent of wireless technology many

parameters can be sent over a single communication medium. This reduces the messy

wiring, project cost and making trouble shoot easy. The field device can be a portable

or a fixed device which communicates the various parameters that are being

monitored, to the control room through the transmission media – ZigBee.

Page 6: Final Report Content

6

CONTENTS

S.No TITLE PAGE No.

ABSTRACT i

LIST OF TABLES iv

LIST OF FIGURES v

LIST OF ABBREVIATIONS vi

1. INTRODUCTION 1

1.1. OUTLINE OF THE PROJECT 1

1.2. LITERATURE REVIEW 2

1.3. PROBLEM DEFINITION 2

1.4. OBJECTIVE 3

2. EXISTING SYSTEM 4

2.1. DEFINITION 4

2.2. FIELD VISIT 4

2.3. ICSS 5

2.4. LIMITATIONS OF THE EXISTING SYSTEM 6

2.5. FEASIBLE SOLUTIONS 6

3. PROPOSED SYSTEM 8

3.1. DESCRIPTION OF PROPOSED SYSTEM 8

3.2. BLOCK DIAGRAM 9

3.3. POWER SUPPLY 10

3.3.1. Circuit Diagram for Power Supply 10

3.3.2. Basic Functional Units 11

3.3.3. Working Principle 12

3.4. PORTABLE UNIT 12

3.4.1. Circuit Diagram for Portable Unit 14

3.5. INTRODUCTION TO SENSORS 15

3.5.1. Pressure Sensor 16

3.5.2. Temperature Sensor 16

3.5.3. Heart Beat Sensor 17

3.5.4. Gas Sensor 18

3.6. MICROCONTROLLER – PIC18F45K22 18

3.6.1. Microcontroller Features

3.6.2. Analog Features 19

3.6.3. Peripheral Features 20

3.6.4. Pin Diagram 21

Page 7: Final Report Content

7

3.7. OUTPUT DEVICES 22

3.7.1. USB PC Interface 23

3.8. ZIGBEE TECHNOLOGY 25

3.8.1. Advantages of ZigBee 26

3.9. GLOBAL POSITIONING SYSTEM 27

3.9.1. Components of GPS 27

3.9.1.1. Space Segment 27

3.9.1.2. Control Segment 27

3.9.1.3. User Segment 27

3.9.2. Working of GPS 28

3.9.3. Tracking Devices 28

3.10. SOFTWARE DEVELOPMENT TOOLS 29

3.10.1. LabVIEW 29

3.10.1.1. Benefits of LabVIEW 31

3.10.1.2. Core Concepts of LabVIEW 32

3.10.1.3. Programming in LabVIEW 33

4. RESULT & DISCUSSION 34

4.1. PERFORMANCE ANALYSIS 34

4.1.1. Comparison of Communication Devices 34

4.1.2. Gas LELs and UELs 35

4.1.3. ZigBee 802.15.4 Latency Time Analysis 36

4.2. RESULT 42

4.3. ADVANTAGES OF THE DEVELOPED SYSTEM 43

5. CONCLUSION 44

5.1. SUMMARY 44

5.2. CONCLUSION 45

5.3. FUTURE SCOPE 45

REFERENCES

Page 8: Final Report Content

8

LIST OF TABLES

TABLE No. TITLE PAGE No.

4.1 Analysis of various Communication

Devices 34

4.2 Analysis of various gases 35

Page 9: Final Report Content

9

LIST OF FIGURES

FIGURE No. TITLE PAGE No.

3.1 Block diagram of proposed system 9

3.2 Circuit Diagram for Power Supply 10

3.3 Functional Unit of Power Supply 11

3.4 Working Principle of Power Supply 12

3.5 Block Diagram of Portable Unit 13

3.6 Circuit Diagram of Portable Unit 14

3.7 Pin Diagram of PIC18F45K22 21

3.8 Receiving Section 22

3.9 USB – PC Interface 23

3.10 Circuit for USB Interface 24

3.11 LabVIEW Front Panel 30

3.12 LabVIEW Block Diagram Panel 30

4.1 ZigBee network 36

4.2 Block Diagram of Developed System in LabVIEW 42

4.3 Front Panel of Developed System in LabVIEW 43

Page 10: Final Report Content

10

LIST OF ABBREVATIONS

A/D - Analog/Digital

AC - Alternating Current

ADC - Analog to Digital Converter

BOR - Brown-Out Reset

CCA - Clear Channel Assessment

CPCL - Chennai Petroleum Corporation Limited

CPU - Central Processing Unit

CSMA - Carrier Sense Multiple Access

CSMA-CA - Carrier Sense Multiple Access- Collision Avoidance

CTMU - Charge Time Measurement Unit

DC - Direct Current

EUSART - Enhanced Universal Asynchronous Receiver Transistor

F&G - Fire and Gas

Fig - Figure

GND - Ground

GOI - Government of India

GPS - Global Positioning System

HPCL - Hindustan Petroleum Corporation Limited

HRM - Heart Rate Monitor

I/P - Input

IC - Integrated Circuit

ICSP - In Circuit Serial Programmer

ICSS - Integrated Control and Safety System

IR - Infra Red

LabVIEW - Laboratory Virtual Instrument Engineering Workbench

LAN - Local Area Network

LCD - Liquid Crystal Display

LED - Light Emitting Diode

Page 11: Final Report Content

11

LEL - Lower Emission Level

LNG - Liquid Nitrogen Gas

LPG - Liquid Petroleum Gas

LR-WPAN - Low Rate Wireless Personal Area Network

MAC - Medium Access Control

MATLAB - Matrix laboratory

MMT - Million metric tonnes

MMTPA - Million tonnes per annum

MRL - Madras Refinery Limited

MSSP - Master Synchronous Serial Port

NIOC - National Iranian Oil Company

PAN - Personal Area Network

PC - Personal Computer

PCS - Process control systems

PIC - Peripheral Interface Controller

POR - Power On Reset

PWRT - Power-Up Timer

RF - Radio Frequency

Rx - Receiver

SV - Space Vehicles

UART - Universal Asynchronous Receiver Transmitter

UEL - Upper Emission Level

USB - Universal Serial Bus

WDT - Watchdog Timer

WPAN - Wireless Personal Area Network

WSN - Wireless Sensor Networks

Page 12: Final Report Content

12

CHAPTER 1

INTRODUCTION

1.1 OUTLINE OF THE PROJECT

“Integrated refinery fire and gas monitoring system using ZigBee” is a project

based on a wireless communication to enhance man and machine safety in a

petrochemical industry. In today’s world petrochemical industry although being the

largest process control industry it is also highly prone to major fire and gas disasters.

A petrochemical industry has excessively high amount of crude oil stored within a

confined area. Therefore presence of any external source which can cause heat or fire

would lead to a major disaster. Even the gas that are present in petroleum refineries

are hazardous.

The Bhopal gas tragedy, which claimed lives of nearly 3,787 people is one of

the major accidents due to gas leakage. And another instance, the Vishakhapatnam,

HPCL refinery tragedy claimed lives of 30 people. Though a gas and fire detection

system was present which is connected to the sensors using large number of wires

that run from the control room to various plant areas, during the fire the wire itself got

damaged, so the information did not reach the control room.

So in order to avoid any hazard due fire and gas leakage in a petrochemical

industry we have designed an integrated system which will monitor timely gas leakage

in any area around the plant using ZigBee which is a wireless communication device.

We have also proposed a new system which monitors human density within the plant

area. Therefore Integrated plant safety monitor system based on ZigBee can realize

workers attendance registration, Real-time precise positioning, Dynamic gas

concentration monitoring, Real-time data transmission & Danger alarm. This project is

focused on implementing the newly designed integrated system in CPCL, Manali ,

Chennai.

Page 13: Final Report Content

13

1.2 LITERATURE REVIEW:

G.A.Arun Kumar, K.Rajasekhar, B.V.V.Satyanarayana, K.Suryanarayana

Murthy, 2012, “Implementation of Real time Detection of Gas leakage in

Industries using ARM7 &ZigBee”,September, pp 1-4.

In this Paper hardware for gas leakage detection and accurate location identification

system for the production safety in any risky Industries is proposed. The detection and

location are implemented based on Wireless Sensor Networks (WSN). However,

formerly the system was developed using Virtual Instrumentation. Based on ZIGBEE

and ARM7, the system is easy to be deployed and overcomes the shortcomings on

current systems. Using number of nodes at different places of risky areas, this system

can detect the leakage of gas and immediately sends the details of that location to the

observer. It is used to improve the rescue quality and shorten the time for rescue.

Therefore it can compensate for the weaknesses of existing systems.

Anusha, Dr. Shaik Meeravali, 2012 “Detection Of Gas Leak And Its

Location Using Wireless Sensors”, November, pp 1-8

The aim is to develop a gas leak detection and location system for the production

safety in Petrochemical Industry. The system is based on Wireless Sensor

Networks (WSN); it can collect the data of monitoring sites wirelessly and sent to

the computer to update values in the location software. Consequently, it can give

a real-time detective of the potential risk area, collect the data of a leak accident

and locate the leakage point. However the former systems can not react in time,

even cannot obtain data from an accident and locate accurately. The paper has

three parts, first, gives the overall system design, and then provides the

approaches on both hardware and software to achieve it.

1.3 PROBLEM DEFINITION:

Increase in the complexity of process industry leads to increase in the number of

instruments to detect fire and leak. This increases the number of cables that run from

industrial sensors to the control station which leads to messy wiring. This also

increases the size of the duct. Troubleshooting the reduced insulation or any wire

open is difficult because it is a messy wiring and identifying the individual cable is

Page 14: Final Report Content

14

very difficult along the duct. This also increases the project cost in terms of cable

cost.

The fire and gas system is generally required to be independent of the control system.

This is consistent with the fire and gas system normally having a higher integrity

requirement than the control system. Some fire and gas systems have been integrated

with emergency shut-down systems. This remains a contentious point.

As already mentioned, no single company can supply all the ‘best in show’

products for all the items described in this paper. There are therefore normally

interfaces between different suppliers. Minimizing interfaces, document sets and

inspections can be achieved by procuring all products from one source at the cost of

reducing choice of initiating devices and possibly increasing the initial purchase cost.

4-20mA interfaced devices are common, enabling standard or modified process

control interfaces to be used. Field interfaces for smoke detectors, heat detectors and

manual call-points are generally two wires with modifying components in the control

system or marshalling cabinets to allow a 4-20mA interface to be used. Any failure in

the loop causes the system to fail. Presently, the location of the personals working in

the site is uncertain. In case of a dangerous event, the Control station officers have to

personally check the positions of the workers in the particular sites. This calls for more

effort and time.

1.4 OBJECTIVE:

The aim of our project is to design and construct an industrial safety system for

workers working in hazardous environments, comprising of two sections.

A portable unit provided to the workers, which is capable of sensing hazardous

conditions like gases, excessive temperature and humidity etc. and a monitoring

system which interacts with the portable unit using a zigbee wireless communication

link.

Page 15: Final Report Content

15

CHAPTER 2

EXISTING SYSTEM

2.1 DEFINITION

The existing system only detects the fire and gas leakage in certain important

areas only. In existing system, the fire and gas leaks are measured and the

communication is through wires to the control station. In case of faults like discontinuity

in cables, damage to cable due to environmental conditions may lead to loosing of

vital information related to plant safety.

Increase in the complexity of process industry leads to increase in the number

of instruments to detect fire and leak. This increases the number of cables that run

from industrial sensors to the control station which leads to messy wiring. This also

increases the size of the duct. Troubleshooting the reduced insulation or any wire open

is difficult because it is a messy wiring and identifying the individual cable is very

difficult along the duct. This also increases the project cost in terms of cable cost.

2.2 FIELD VISIT

An F&G safety system continuously monitors for abnormal situations such as a

fire, or combustible or toxic gas release within the plant; and provides early warning

and mitigation actions to prevent escalation of the incident and protect the process or

environment. By implementing an integrated fire and gas strategy based on the latest

automation technology, plants can meet their plant safety and critical infrastructure

protection requirements while ensuring operational and business readiness at project

start-up. Throughout the process industries, plant operators are faced with risks. For

example, a chemical facility normally has potential hazards ranging from raw material

and intermediate toxicity and reactivity, to energy release from chemical reactions,

high temperatures, high pressures, etc.

According to international standards, safety implementation is organized under a

series of protection layers, which include, at the base levels, plant design, process

control systems, work procedures, alarm systems and mechanical protection systems.

The safety shutdown system is a prevention safety layer, which takes automatic and

independent action to prevent a hazardous incident from occurring, and to protect

personnel and plant equipment against potentially serious harm.

Page 16: Final Report Content

16

Conversely, the fire and gas system is a mitigation safety layer tasked with

taking action to reduce the consequences of a hazardous event after it has occurred.

The F&G system is used for automating emergency actions with a high-integrity safety

and control solution to mitigate further escalation. It is also important for recovering

from abnormal situations quickly to resume full production.

An industrial safety system is a countermeasure crucial in any hazardous plants

such as oil and gas plants and nuclear plants. They are used to protect human, plant,

and environment in case the process goes beyond the control margins. As the name

suggests, these systems are not intended for controlling the process itself but rather

protection. Process control is performed by means of process control systems (PCS)

and is interlocked by the safety systems so that immediate actions are taken should

the process control systems fail.

2.3 ICSS

Process control and safety systems are usually merged under one system,

called Integrated Control and Safety System (ICSS). Industrial safety systems typically

use dedicated systems that are SIL 2 certified at minimum; whereas control systems

can start with SIL 1. SIL applies to both hardware and software requirements such as

cards, processors redundancy and voting functions. Fire and gas detection systems

are designed to mitigate unexpected events. Designers need to know what is available

in order to choose the correct systems for their plants.

The main objectives of the fire and gas system are to protect personnel, environment,

and plant (including equipment and structures). The FGS shall achieve these

objectives by:

Detecting at an early stage, the presence of flammable gas,

Detecting at an early stage, the liquid spill (LPG and LNG),

Detecting incipient fire and the presence of fire,

Providing automatic and/or facilities for manual activation of the fire protection

system as required,

Initiating environmental changes to keep liquids below their flash point.

Initiating signals, both audible and visible as required, to warn of the detected

hazards,

Initiating automatic shutdown of equipment and ventilation if 2 out of 2 or 2 out

of 3 detectors are triggered, and the exhausting system.

Page 17: Final Report Content

17

2.4 LIMITATIONS OF EXISTING SYSTEM

The fire and gas system is generally required to be independent of the control

system. This is consistent with the fire and gas system normally having a higher

integrity requirement than the control system. Some fire and gas systems have been

integrated with emergency shut-down systems. This remains a contentious point.

As already mentioned, no single company can supply all the ‘best in show’

products for all the items described in this paper. There are therefore normally

interfaces between different suppliers. Minimizing interfaces, document sets and

inspections can be achieved by procuring all products from one source at the cost of

reducing choice of initiating devices and possibly increasing the initial purchase cost.

4-20mA interfaced devices are common, enabling standard or modified process

control interfaces to be used. Field interfaces for smoke detectors, heat detectors and

manual call-points are generally two wires with modifying components in the control

system or marshalling cabinets to allow a 4-20ma interface to be used. Any failure in

the loop causes the system to fail. Presently, the location of the personals working in

the site is uncertain. In case of a dangerous event, the Control station officers have to

personally check the positions of the workers in the particular sites. This calls for more

effort and time.

2.5 FEASIBLE SOLUTION

To overcome these difficulties we implemented a portable device. This device

can be fixed in their helmet or jacket. To measure various parameters this device

consists of sensors. They are Gas sensor, Temperature sensor, Heart beat sensor,

Pressure sensor.

These sensors in the portables device sense various parameters (gas,

temperature, pressure) continuously. And if the value exceeds the reference value,

immediately it activates the relay driver and produces an alarming sound. So it will be

useful for the person to know about hazardous situation.

Heart beat sensor, senses the workers heart beat continuously. If the person

loses his/her consciousness then this information is sensed by the sensor and it will

be passed to the control room.

Page 18: Final Report Content

18

All the communications are done by wireless zigbee protocols, so that the

informations will be transmitted without any obstructions. The main advantage of

zigbee is that it is a multimode communication, so that the data’s are transmitted node

by node.

A GPS is used in our project to track the location of the person during

hazardous conditions, so that he can be rescued immediately.

Finally, all the parameters are monitored using labVIEW software. It contains

a comprehensive set of tools for acquiring, analyzing, displaying, and storing data, as

well as tools to help you troubleshoot code you write.

Page 19: Final Report Content

19

CHAPTER 3

PROPOSED SYSTEM

3.1 DESCRIPTION

Our project is “Integrated Refinery Fire and Gas monitoring System using

ZigBee”. In this project, we are going to monitor and transmit the industrial parameters

such as gas leakage and fire. These parameters are monitored using gas sensor and

fire detectors. The analog outputs are converted into digital form using analog to digital

converter and then given to microcontroller. These data are sent to the control room

through a ZigBee wireless via UART also displayed in the LCD display for workers.

Corresponding to the sensor outputs the relay is activated using microcontroller to

operate the precaution devices. With this a buzzer alert is also given. In the receiver

side a PC is used to view all the parameter conditions. The relays can be activated

from the remote area too via ZigBee wireless communication.

In addition to this, this system integrates person locating with gas concentration

checking system effectively, and realizes functions of person attendance, distance

measurement positioning, gas concentration detecting and data communication. This

system is an open system, and it allows developing other applications on it. It provides

much spatial gas concentration data with the timestamp for follow-up gas prediction

research.

The field device can be a fixed device or a portable device. The portable device is

carried by the worker whenever he enters the plant area. It basically detects the gas

leakage if any, wherever the worker goes, it also sends the information about the

location of the person and the heartbeat of the person. The fixed device is fixed in the

plant area. It also detects gas leakage and transmits information to the control room.

The system will be developed in Lab view software. The hardware will be interfaced

with Lab view to collect the transmitted data and the interpretation of the received

information.

This project was accepted by CPCL and to be developed and tested in their site. We

are sure that this project will definitely help CPCL to increase its safe operation.

Page 20: Final Report Content

20

3.2 BLOCK DIAGRAM

Fig 3.1: Block diagram of the proposed system

Fig 3.1 refers to the block diagram of the proposed system where the analog

parameters like the gas leakage, temperature level, pressure level & heartbeat of a

worker from the plant area is sensed by the sensors. These analog signals are sent to

the analog to digital converter and a digital signal is further sent to the PIC

microcontroller. The microcontroller is programmed in order to transmit these signals

to various output devices. The relay drive drives the relay which sets the buzzer on.

The LCD provides the direct information in case of any hazardous situation. The

portable section transmits this information through the ZigBee transmitter to the control

room where it is receiver by the ZigBee receiver and the information is displayed on

the PC.

Page 21: Final Report Content

21

3.3 POWER SUPPLY

Power supply is a device that transfers electric power from a source to a load

using electronic circuits. Typical application of the power supplies is to convert utility’s

AC input power to regulated voltage required for electronic equipments.

3.3.1 Circuit for Power Supply

Fig 3.2: Circuit for power supply

The power supply circuit consists of a 12V DC adapter with a DC input, the two

IN4007 diodes is used for rectification of the signal so that no negative signal is passed

on to the further units, Vin is 12V pure DC, the capacitors, the LEDs, the LM317 and

the LM7805 as shown in Fig 3.2.

The DC I/P has two pins one is the Vout pin(pin1) and the other is the ground

pin(pin2). Diodes are used for rectification. Capacitors are incorporated for the

purpose of filtering. LEDs indicate if the power supply is ON or OFF. LM317 regulator

is used to regulate or adjust the voltage from 12V to 3.3V which is used by the

microcontroller, analog sensors and the RF section. LM7805 regulator is used to

adjust the voltage from 12V to 5V which is used by the heart beat sensor. The

Page 22: Final Report Content

22

regulation of voltage is done specifically because we have used devices that are

compatible with either 5V or 3.3V. The 1k resistors are used for safety purposes.

3.3.2 Basic Functional Units

Most electronic circuits need a DC supply such as a battery to power them.

Since the mains supply is AC it has to be converted to DC to be useful in electronics.

This is what a power supply does.

Fig 3.3: Functional units of power supply

Fig 3.3 represents the functional units of power supply and is explained below.

First the AC mains supply passes through an isolating switch and safety fuse before it

enters the power supply unit. In most cases the high voltage mains supply is too high

for the electronic circuitry. It is therefore stepped down to a lower value by means of a

Transformer. The mains voltage can be stepped up where high DC voltages are

required.

From the transformer the AC voltage is fed to a rectifier circuit consisting of one

or more diodes. The rectifier converts AC voltage to DC voltage. This DC is not steady

as from a battery. It is pulsating. The pulsations are smoothed out by passing them

through a smoothing circuit called a filter. In its simplest form the filter is a capacitor

and resistor.

Any remaining small variations can, if necessary, be removed by a regulator circuit

which gives out a very steady voltage. This regulator also removes any variations in

the DC voltage output caused by the AC mains voltage changing in value.

Regulators are available in the form of Integrated Circuits with only three connections.

Each of the blocks is described in more detail below:

Page 23: Final Report Content

23

Transformer - steps down high voltage AC mains to low voltage AC.

Rectifier - converts AC to DC, but the DC output is varying.

Smoothing - smoothens the DC from varying greatly to a small ripple.

Regulator - eliminates ripple by setting DC output to a fixed voltage.

3.3.3 Working Principle

Fig 3.4: Working principle of the power supply

The first section is the transformer. The transformer steps up or steps

down the input line voltage and isolates the power supply from the power line. The

rectifier section converts the alternating current input signal to a pulsating direct

current. And the pulsating dc is not desirable. For this reason a filter section is used to

convert pulsating dc to a purer, more desirable form of dc voltage. The final section,

the regulator, does just what the name implies. It maintains the output of the power

supply at a constant level in spite of large changes in load current or input line voltages

as shown in Fig 3.4.

3.4 PORTABLE UNIT

The portable unit is the unit which the worker carries with him whenever he

enters the plant area. It can be attached to the helmet or a badge as per convenience.

The portable unit consists of the analog sensors namely the gas sensor, the

temperature sensor, the pressure sensor and the heart beat sensor whose output is

fed into the microcontroller. The microcontroller processes the information and through

the voltage conversion unit it is sent to the RF transceiver which transmits the signals

wirelessly to the receiving RF transceiver at the control room. The microcontroller can

be programmed to send out an alarm through an alarm or an LED.

Page 24: Final Report Content

24

The alarm cannot be driven directly by the microcontroller and thus a relay is

used for this purpose. The microcontroller is connected to a relay drive which drives

the relay which in turn activates the alarm. The block diagram of the portable unit is

shown in fig. 3.5.

Fig 3.5: Block diagram of the portable unit

Page 25: Final Report Content

25

3.4.1 Circuit diagram of the portable unit

Fig 3.6: Circuit for portable unit

The portable unit circuit consists of the four sensors namely temperature

sensor, pressure sensor, gas sensor and heart beat sensor, microcontroller

(PIC18F45K22), the RF transmitter, the In Circuit Serial Programmer (ICSP), push

button, power supply and ground as shown in Fig 3.6.

The temperature sensor, pressure sensor and the gas sensor are analog

sensors and thus are connected to the analog pins in the port A, RA0, RA1, RA2

respectively. The heart beat sensor is a digital sensor and is connected to pin RA4 of

port A which is a digital pin. Each sensor has three pins each Vcc (power dc), Vout

(analog / digital) and GND (power ground).

Page 26: Final Report Content

26

The microcontroller used is PIC18F45K22, a 40pin IC which has an inbuilt ADC

in it thus the analog outputs can be directly fed into the microcontroller without getting

it through a separate ADC unit.

The RF transmitter is used for communication purpose. It uses a UART which

has two parts – a transmitting section and a receiving section. The RF in this circuit is

the transmitting section. Pin 1 of the RF is the power, pin 2 is connected to pin 30 of

the microcontroller which is the transmitting line, pin 3 is connected to pin 29 of the

microcontroller which is the receiving line and pin 4 is the ground pin.

The ICSP is used to download the program on the microcontroller chip. From

the PC, pic-it-try is used to feed the program into the ICSP and then from the ICSP the

program is downloaded to the chip. It consists of 5 pins. Pin 1 is connected to the

master clear pin of the chip, pin 2 to the programmable clock, pin 3 to the

programmable data, pin 4 is the ground pin and pin 5 is the power supply.

The push button/switch is provided to set or reset the microcontroller which is

connected to the master clear pin. The pins 11 and 32 of the microcontroller are the

power supply to the microcontroller and pins 12 and 31 are the ground pins.

3.5 INTRODUCTION TO SENSORS

A sensor is a converter that measures a physical quantity and converts it into a

signal which can be read by an observer or by an (today mostly electronic) instrument.

For example, a mercury-in-glass thermometer converts the measured temperature

into expansion and contraction of a liquid which can be read on a calibrated glass tube.

A thermocouple converts temperature to an output voltage which can be read by

a voltmeter. For accuracy, most sensors are calibrated against known standards.

Sensors used:

Pressure sensor- MPX5050

Temperature sensor- LM35

Heart beat sensor- HRM 2115

Gas sensor- MQ-5

Page 27: Final Report Content

27

3.5.1 Pressure sensor:

MPX5050 is used for pressure sensing. It is a linear pressure sensor. The

MPX5050 series piezoresistive transducer is a state-of-the-art-monolithic silicon

pressure sensor designed for a wide range of applications, but particularly those

employing a microcontroller or microprocessor with A/D inputs. This patented, single

element transducer combines advanced micromachining techniques, thin-fi lm

metallization, and bipolar processing to provide an accurate, high level analog output

signal that is proportional to the applied pressure. The output voltage is given by 0v to

5v depending upon the pressure. Can measure pressure up to 10kPa. The integrated

sensor is a simple 3pin package. It is fabricated using micro machined pies electric

technology. It is an integrated sensor and does not require any signal conditioning.

The supply voltage input is 5V dc. The analog output from the pressure sensor is

directly connected to the A/D input.

Features:

2.5% Maximum Error over 0° to 85°C

Ideally suited for Microprocessor or Microcontroller-Based Systems

Temperature Compensated Over –40° to +125°C

Patented Silicon Shear Stress Strain Gauge

Durable Epoxy Unibody Element

Easy-to-Use Chip Carrier Option

3.5.2 Temperature sensor:

The LM35 series are precision integrated-circuit temperature sensors, whose

output voltage is linearly proportional to the Celsius (Centigrade) temperature. 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 LM35 does not require any external calibration or

trimming to provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over

a full −55 to +150°C temperature range. Low cost is assured by trimming and

calibration at the wafer level. The LM35’s low output impedance, linear output, and

precise inherent calibration make interfacing to readout or control circuitry especially

Page 28: Final Report Content

28

easy. It can be used with single power supplies, or with plus and minus supplies. As it

draws only 60μA from its supply, it has very low self-heating, less than 0.1°C in still

air. The LM35 is rated to operate over a −55° to +150°C temperature range, while the

LM35C is rated for a −40° to +110°C range (−10° with improved accuracy). The LM35

series is available packaged in hermetic TO-46 transistor packages. Its accuracy is

within 0.5°C. It is an integrated sensor in a simple 3pin package. It is an integrated

sensor and does not require any signal conditioning. The supply voltage input is 5V

dc. The analog output from the temperature sensor is directly connected to the A/D

input.

Features:

Calibrated directly in ° Celsius (Centigrade), linear + 10.0 mV/°C scale factor

0.5°C accuracy guarantee (at +25°C)

Rated for full −55° to +150°C range

Suitable for remote applications

Low cost due to wafer-level trimming

Operates from 4 to 30 volts

Less than 60μA current drain

Low self-heating, 0.08°C in still air

Nonlinearity only ±1⁄4°C typical

Low impedance output, 0.1 W for 1 mA load

3.5.3 Heart beat sensor:

HRM 2115 is the heart beat sensor which has been used in this project.

HRM2115 is a portable heart rate monitoring module. It works on the principle of opto

interruption caused by the flow of blood. The sensor houses an IR transmitter and a

sensitive IR detector on the other side of the sensor. HRM2115 is available in two

different options for user convenience. The ‘E’ version is for using the sensor by

clipping it to the ear lobe. The ‘B’ version is for using it with the finger. Any of these

can be used depending upon user convenience and suitability. We use the ‘B’ version.

The operating input voltage is 5V. The heart beat rate sensor output is in the form of

Page 29: Final Report Content

29

square wave in the range between 0-5V. The sensor consists of IR module coupled

with semiconductor chip.

Features:

5V low power operation

Output is in the form of digital pulses(square wave) corresponding to heart rate

Consists of three pins namely Vcc(5V DC), Vout(Digital out) and GND(Power

Ground)

3.5.4 Gas sensor:

MQ-5 is used for combustible gas detection. It can detect the presence and

concentration of gases like methane, propane and butane. The sensing element used

is SnO2. Resistance of SnO2 varies in the presence of gases. It is a six pin device, with

an integrated heating coil. The sensitivity of SnO2 is greater at higher temperatures.

The supply voltage is 5V DC. The output voltage proportional to the gas concentration

is an analog voltage and is given to the A/D. They are used in gas leakage detecting

equipments in family and industry, are suitable for detecting of LPG, natural gas, town

gas, avoid the noise of alcohol and cooking fumes and cigarette smoke.

Features:

High sensitivity to LPG, natural gas, town gas

Small sensitivity to alcohol, smoke

Fast response Stable and long life, Simple drive circuit

3.6 MICROCONTROLLER - PIC18F45K22

The microcontroller executes the program loaded in its Flash memory. This is

the so called executable code comprised of seemingly meaningless sequence of

zeroes and ones. It is organized in 12-, 14- or 16-bit wide words, depending on the

microcontroller’s architecture. Every word is considered by the CPU as a command

being executed during the operation of the microcontroller. For practical reasons, as it

is much easier for us to deal with hexadecimal number system, the executable code

is often represented as a sequence of hexadecimal numbers called a Hex code. It

Page 30: Final Report Content

30

used to be written by the programmer. All instructions that the microcontroller can

recognize are together called the Instruction set. As for PIC microcontrollers the

programming words of which are comprised of 14 bits, the instruction set has 35

different instructions in total.

3.6.1 Microcontroller Features:

Full 5.5V operation (PIC18F2XK22/4XK22)

Low voltage option available for 1.8V-3.6V operation

(PIC18LF2XK22/4XK22)

Self-reprogrammable under software control

Power-on Reset (POR), Power-up Timer (PWRT) and Oscillator Start-up

Timer

Programmable Brown-out Reset (BOR)

Extended Watchdog Timer (WDT) with on-chip oscillator and software

enable

Programmable code protection

In-Circuit Serial Programming (ICSP) via two pins

In-Circuit Debug via two pins

3.6.2 Analog Features:

3.6.2.1 Analog-to-Digital Converter (ADC) module:

10-bit resolution

17 analog input channels (PIC18F/LF2XK22)

Auto acquisition capability

Conversion available during Sleep

Programmable High/Low Voltage Detection (PLVD) module

3.6.2.2 Charge Time Measurement Unit (CTMU) for mTouch support:

Page 31: Final Report Content

31

Up to 28 channels for button, sensor or slider input

Analog comparator module with:

Two rail-to-rail analog comparators

Comparator inputs and outputs externally accessible

and configurable

3.6.2.3 Voltage reference module with:

Programmable On-chip Voltage Reference module (% of

VDD)

Selectable on-chip fixed voltage reference

3.6.3 Peripheral Features:

24/35 I/O pins and 1 input-only pin

High current sink/source 25 mA/25 mA

Individually programmable weak pull-ups

Individually programmable interrupt-on-pin change

Three external interrupt pins

Up to seven Timer modules:

Up to four 16-bit timers/counters with prescaler

Up to three 8-bit timers/counters

Dedicated, low-power Timer1 oscillator

Up to two Capture/Compare/PWM (CCP) modules

Up to three Enhanced Capture/Compare/PWM (ECCP) modules with:

One, two or four PWM outputs

Selectable polarity

Programmable dead time

Auto-shutdown and Auto-restart

PWM output steering control

Page 32: Final Report Content

32

Two Master Synchronous Serial Port (MSSP) modules with two modes of operation:

3-wire SPI (supports all 4 SPI modes)

I2C™ Master and Slave modes (Slave mode with address masking)

Two Enhanced Universal Synchronous Asynchronous Receiver Transmitter

modules (EUSART):

Supports RS-232, RS-485 and LIN 2.0

3.6.4 Pin Diagram

Fig 3.7: Pin diagram of PIC18F45K22

Fig 3.7 shows the pin diagram of PIC18F45K22 microcontroller which is a 40pin

IC chip. It consists of 5 ports namely A, B, C, D and E. Ports A, B, C and D have 8pins

each and port E has 3pins. 35pins out of the 40pins of the microcontroller can be used

as input pins or output pins. Each pin has special function as well as multiple

functioning capacity. Pin 11 and pin 32 are the two supply pins. Pin 12 and 31 are the

ground pins. Pin 1 is the master clear pin which sets and resets the microcontroller.

Page 33: Final Report Content

33

3.7 OUTPUT DEVICES

An output device is any piece of computer hardware equipment used to

communicate the results of data processing carried out by an information processing

system (such as a computer) which converts the electronically generated information

into human-readable form.

They are:

Alarm

Liquid Crystal Display

Compute

An alarm device or system of alarm devices gives an audible, visual or other

form of alarm signal about a problem or condition. Alarm devices are often outfitted

with a siren. A liquid-crystal display (LCD) is a flat panel display, electronic visual

display, or video display that uses the light modulating properties of liquid crystals.

Liquid crystals do not emit light directly

A computer is a general purpose device that can be programmed to carry out a

set of arithmetic or logical operations. Since a sequence of operations can be readily

changed, the computer can solve more than one kind of problem. It can be used to

monitor the whole process.

Fig. 3.8: Receiving section

The receiving end of the system, as shown in Fig 3.8 consists of a RF

transceiver, a voltage conversion unit, a USB interface and a PC. The RF transceiver

serves the purpose of receiving the signals that are transmitted by the portable or the

fixed device through the ZigBee network to the receiving end at the control room. The

voltage conversion unit is used for the conversion of the incoming signal into voltage

Page 34: Final Report Content

34

that is compatible with the PC. A USB interface is used to interface this signal into the

PC. The USB interface circuit is explained in detail in section 3.7.1.

3.7.1 USB PC Interface Circuit

Fig 3.9 shows the USB PC interface pictorially. The USB port of the computer

is used for communication with microcontroller.The microcontroller uses UART-serial

Communication. Hence, an interfacing circuit using FTDX chip is built to convert USB

signals into UART signals and vice-versa. It enables full duplex communications, while

doing the necessary voltage conversions.

The USB (Universal Serial Bus) port of a computer is a general interface to

which any external devices can be connected. The external devices can be

conventional computer input output devices like keyboard, mouse, a printer, camera

etc. Additionally other hardware like projects, embedded systems and even FPGA can

also be connected to the USB port, for communication with the various softwares on

the computer.

But most microcontrollers and other embedded hardware have a conventional

UART interface. But the USB port of a computer cannot be connected directly to the

UART interface. Additionally any hardware connected to the USB port needs device

drivers that have to be installed on the computer for the operating system to identify

the external device and communicate with it accordingly.

Hence there is a need for a device that can enable communication between the

UART interface of an embedded system or a FPGA and the USB port of a computer.

Various ICs are available that can perform this function. The FT231X is one such IC

that can perform the function of UART to USB conversion.

Fig 3.9: USB PC interface

Page 35: Final Report Content

35

The FT231X is a 20 pin IC that can work either with a external 5V power supply

or it can even work with the power from the USB port of the computer. It is also capable

of communicating with external devices that have either a 5V UART interface or a 3.3V

UART interface.

The device drivers needed by the computer for communicating with the FT231X

IC are also provided by the manufacturers of the IC and hence there is no need for the

user to develop the device drivers. For all of these reasons the FT231X is a ideal IC

to use for connecting any project hardware to a PC or a laptop. The circuitary of the

USB interface unit is shown in Fig 3.10.

Fig 3.10 Circuit diagram for the USB interface

Page 36: Final Report Content

36

3.8 ZIGBEE TECHNOLOGY

The ZigBee communication is a communication technology to connect local

wireless nodes and provides high stability and transfer rate due to data communication

with low power. In the nodes away from coordinator in one PAN, the signal strength is

weak causing the network a shortage of low performance and inefficient use of

resources due to transferring delay and increasing delay time and thus cannot conduct

seamless communication. This study suggests the grouping method, that makes it

possible to perform wide range data transferring depending on the node signal

strength in ZigBee node and analyzes the suggested algorithm through simulation.

Based on IEEE 802.15.4 Low Rate-Wireless Personal Area Network (LR-

WPAN) standard, the ZigBee standard has been proposed to interconnect simple, low

rate and battery powered wireless devices. The deployment of ZigBee networks is

expected to facilitate numerous applications such as Home-appliance net-works,

home healthcare, medical monitoring and environmental sensors. An effective routing

scheme is more important for ZigBee mesh networks. In order to achieve effective

routing in ZigBee Mesh networks, a ZigBee protocol module is realized using NS-2.

The suitable routing for different data services in the ZigBee application layer and a

best routing strategy for ZigBee mesh network is proposed. The ZigBee standard

provides network, security, and application support services operating on top of the

IEEE 802.15.4 Medium Access Control (MAC) and Physical Layer wireless standard.

It employs a group of technologies to enable scalable, self-organizing, self-healing

networks that can manage various data traffic patterns.

ZigBee is a low-cost, low-power, wireless mesh networking standard. The low

cost allows the technology to be widely deployed in wireless control and monitoring

applications, the low power-usage allows longer life with smaller batteries, and the

mesh networking which promises high reliability and larger range. ZigBee has-been

developed to meet the growing demand for capable wireless networking between

numerous low power devices. The aims of this network are to reduce the energy

consumption and latency by enhancing routing algorithm. In a traditional tree routing

when a node wants to transmit a packet to the destination, the packet has to follow

child/parent relationship and go along tree topology, even if the destination is lying at

Page 37: Final Report Content

37

nearby source. In order to solve this problem, an Enhanced Tree Routing Algorithm is

introduced using ZigBee network. This algorithm can find the shortest path by

computing the routing cost for all of router that stored in neighbor table, and transmit

the packet to the neighbor router that can reduce the hop count of transmission. The

enhanced tree routing algorithm can achieve more stable and better efficiency then

the previous traditional tree routing algorithm. Index Terms: - ZigBee, wireless

network, IEEE 802.15.4, repeater, grouping. Network Key, protocols, meshes, suite,

bandwidth.

3.8.1 Advantages of ZigBee

Low power consumption, simply implemented.

Users expect batteries to last many months to years! Consider that a typical

single family house has about 6 smoke/CO detectors. If the batteries for each

one only lasted six months, the home owner would be replacing batteries every

month.

Bluetooth has many different modes and states depending upon your latency

and power requirements such as sniff, park, hold, active, etc.; ZigBee/IEEE

802.15.4 has active (transmit/receive) or sleep. Application software needs to

focus on the application, not on which power mode is optimum for each aspect

of operation.

Even mains powered equipment needs to be conscious of energy. Consider a

future home with 100 wireless control/sensor devices, Case 1:802.11 Rx power

is 667mW (always on) @ 100 devices/home & 50,000 homes/city = 3.33

megawatts Case 2: 802.15.4 Rx power is 30mW (always on) @ 100

devices/home & 50,000 homes/city = 150 kilowatts 5)Low cost (device,

installation, maintenance): Low cost to the users means low device cost, low

installation cost and low maintenance. ZigBee devices allow batteries to last up

to years using primary cells (low cost) without any chargers (low cost and easy

installation). ZigBee’s simplicity allows for inherent configuration and

redundancy of network devices provides low maintenance.

High density of nodes per network: ZigBee’s use of the IEEE 802.15.4 PHY and

MAC allows networks to handle any number of devices. This attribute is critical

for massive sensor arrays and control networks.

Page 38: Final Report Content

38

Simple protocol, global implementation: ZigBee’s protocol code stack is

estimated to be about 1/4th of Bluetooth’s or 802.11’s. Simplicity is essential to

cost, interoperability, and maintenance. The 2.4 GHz band is now recognized

to be a global band accepted in almost all countries.

3.9 GLOBAL POSITIONING SYSTEM

The Global Positioning System (GPS) is a space-based satellite

navigation system that provides location and time information in all weather conditions,

anywhere on or near the Earth where there is an unobstructed line of sight to four or

more GPS satellites. The system provides critical capabilities to military, civil and

commercial users around the world. It is maintained by the United States government

and is freely accessible to anyone with a GPS receiver.

3.9.1 Components of GPS

3.9.1.1 Space segment:

24 GPS space vehicles (SVs).Satellites orbit the earth in 12 hrs.6 orbital planes

inclined at 55 degrees with the equator. This constellation provides 5 to 8 SVs from

any point on the earth.

3.9.1.2 Control Segment:

The control segment comprises of 5 stations. They measure the distances of

the overhead satellites every 1.5 seconds and send the corrected data to Master

control. Here the satellite orbit, clock performance and health of the satellite are

determined and determines whether repositioning is required. This information is sent

to the three uplink stations.

3.9.1.3 User segment:

It consists of receivers that decode the signals from the satellites. The receiver

performs following tasks:

Selecting one or more satellites

Acquiring GPS signals

Measuring and tracking

Recovering navigation data

Page 39: Final Report Content

39

3.9.2 Working of GPS

The actual principle of GPS is very easy to appreciate, since it is exactly the

same as traditional “triangulation”. If one imagines an orienteer needing to locate

themselves on a map, they first need to be able to find at least three points that they

recognize in the real world, which allows them to pinpoint their location on the map.

They can then measure, using a compass, the azimuth that would be needed

to take them from the point on the map to their current position. A line is then drawn

from each of the three points, and where the three lines meet is where they are on the

map.

Translating this into the GPS world, we can replace the known points with

satellites, and the azimuth with time taken for a signal to travel from each of the known

points to the GPS receiver. This enables the system to work out roughly where it is

located - it is where the circles representing the distance from the satellite, calculated

on the basis of the travel time of the signal, intersect.

Of course, this requires that the GPS locator has the same coordinated time as

the satellites, which have atomic clocks on board. To do this, it cross checks the

intersection of the three circles with a fourth circle, which it acquires from another

satellite. If the four circles no longer intersect at the same point, then the GPS system

knows that there is an error in its clock, and can adjust it by finding one common value

(one second, half a second and so on) that can be applied to the three initial signals

which would cause the circles to intersect in the same place.

Behind the scenes, there are also many complex calculations taking place

which enable the system to compensate for atmospheric distortion of the signals, and

so forth, but the principle remains the same.

3.9.3 Tracking Devices

One of the easiest applications to consider is the simple GPS tracking device;

which combines the possibility to locate itself with associated communications

technologies such as radio transmission and telephony.

Page 40: Final Report Content

40

Tracking is useful because it enables a central tracking center to monitor the

position of several vehicles or people, in real time, without them needing to relay that

information explicitly. This can include children, criminals, police and emergency

vehicles, military applications, and many others.

The tracing devices themselves come in different flavors. They will always

contain a GPS receiver, and GPS software, along with some way of transmitting the

resulting coordinates. GPS watches, for example, tend to use radio waves to transmit

their location to a tracking center, while GPS phones use existing mobile phone

technology.

The tracking center can then use that information for co-ordination or alert

services. One application in the field is to allow anxious parents to locate their children

by calling the tracking station - mainly for their peace of mind.

3.10 SOFTWARE DEVELOPMENT TOOLS:

3.10.1 LabVIEW

Lab view (Laboratory Virtual Instrument Engineering Workbench) is a system-

design platform and development environment for a visual programming

language from National Instruments. It contains a comprehensive set of tools for

acquiring, analyzing, displaying, and storing data, as well as tools to help you

troubleshoot the code you write. The graphical language is named "G" (not to be

confused with G-code). Originally released for the Apple Macintosh in 1986, LabVIEW

is commonly used for data acquisition, instrument control, and industrial automation on

a variety of platforms including Microsoft Windows, various versions of UNIX, Linux,

and Mac OS X.

Page 41: Final Report Content

41

Fig 3.11: LabVIEW front panel

The Front Panel as shown in Fig 3.11 is “the window through which the user

interacts with the program”. When we run a VI, we must have the front panel open so

that we can input data to the executing program. The front panel is where we see our

program’s output.

Fig 3.12: LabVIEW block diagram panel

Page 42: Final Report Content

42

The block diagram window shown in Fig 3.12 holds the graphical source code

of a LabVIEW VI – it is the actual executable code. We construct the block diagram by

wiring together objects that perform specific functions. The various components of a

block diagram are terminals, nodes and wires.

3.10.1.1 Benefits of LabVIEW:

Using LabVIEW real time signals from various sensors and devices can be

seen as continuous graphs and waveforms. LabVIEW is an easy to use software.

Since it uses graphical programming, it does not require any experience in

conventional programming languages. Instruments similar to real life instruments and

even more complicated interfaces can also be implemented easily.

One benefit of LabVIEW over other development environments is the extensive

support for accessing instrumentation hardware. Drivers and abstraction layers for

many different types of instruments and buses are included or are available for

inclusion. These present themselves as graphical nodes. The abstraction layers offer

standard software interfaces to communicate with hardware devices. The provided

driver interfaces save program development time. The sales pitch of National

Instruments is, therefore, that even people with limited coding experience can write

programs and deploy test solutions in a reduced time frame when compared to more

conventional or competing systems. A new hardware driver topology (DAQmxBase),

provides platform independent hardware access to numerous data acquisition and

instrumentation devices. The DAQmxBase driver is available for LabVIEW on

Windows, Mac OS X and Linux platforms.

In terms of performance, LabVIEW includes a compiler that produces native

code for the CPU platform. The graphical code is translated into executable machine

code by interpreting the syntax and by compilation. The LabVIEW syntax is strictly

enforced during the editing process and compiled into the executable machine code

when requested to run or upon saving. In the latter case, the executable and the

source code are merged into a single file. The executable runs with the help of the

LabVIEW run-time engine, which contains some precompiled code to perform

common tasks that are defined by the G language. The run-time engine reduces

compile time and also provides a consistent interface to various operating systems,

Page 43: Final Report Content

43

graphic systems, hardware components, etc. The run-time environment makes the

code portable across platforms.

Many libraries with a large number of functions for data acquisition, signal

generation, mathematics, statistics, signal conditioning, analysis, etc., along with

numerous graphical interface elements are provided in several LabVIEW package

options. The number of advanced mathematic blocks for functions such as integration,

filters, and other specialized capabilities usually associated with data capture from

hardware sensors is immense. In addition, LabVIEW includes a text-based

programming component called MathScript with additional functionality for signal

processing, analysis and mathematics. MathScript can be integrated with graphical

programming using "script nodes" and uses .m file script syntax that is generally

compatible with MATLAB.

The fully object-oriented character of LabVIEW code allows code reuse without

modifications: as long as the data types of input and output are consistent, two sub

VIs are interchangeable.

The LabVIEW Professional Development System allows creating stand-alone

executables and the resultant executable can be distributed an unlimited number of

times. The run-time engine and its libraries can be provided freely along with the

executable.

A benefit of the LabVIEW environment is the platform independent nature of

the G code, which is (with the exception of a few platform-specific functions) portable

between the different LabVIEW systems for different operating systems (Windows,

Mac OS X and Linux). National Instruments is increasingly focusing on the capability

of deploying LabVIEW code onto an increasing number of targets including devices

like Phar Lap OS based LabVIEW real-time controllers, PocketPCs, PDAs, FieldPoint

modules and into FPGAs on special boards.

3.10.1.2 Core LabVIEW Concepts:

LabVIEW Environment Basics – learn the most important building blocks for

any LabVIEW application, including the front panel, block diagram, palettes,

controls, and indicators

Page 44: Final Report Content

44

Graphical Programming Basics – see how to connect functions and work with

a variety of data types when constructing applications

Common Tools – view a collection of important tools and common user

functions that all users should be familiar

Debugging Tools – learn how to use simple tools and techniques to understand

the behavior of code and address problems or bugs

3.10.1.3 Programming in LabVIEW:

Data Structures – arrays, clusters, and enumerated data

Execution Structures – while loops, for loops, and case structures

Passing Data between Loop Iterations – shift register.

Handling Errors – error handling and error clusters

Page 45: Final Report Content

45

CHAPTER 4

RESULT & DISCUSSION

4.1 PERFORMANCE ANALYSIS:

4.1.1 Comparison of communication devices

Table 4.1 Analysis of various wireless communication devices

Brand Name Wi-Fi Bluetooth ZigBee

Battery Life Several Hours Several Days Several Years

Maximum

Network Capacity

32 Nodes 7 Nodes 64000 Nodes

Communication

Distance 100m 10m >30m

Communication Speed

11 Mbps 1 Mbps 250 Kbps

Security Method

SSID 64, 128 bit 32, 64, 128 bit

Application Wireless LAN Wireless speech Remote control measurement

A comparison between the various wireless communication devices is made in

Table 4.1. The ZigBee has a long battery life, consumes less power, a higher network

capacity than the other devices. The communication distance is less, this is because

a mesh network is used in the network topology, the communication distance is

between the nodes and thus can be used in a long range. The speed is comparatively

low this drawback is bearable for the proposed system as the parameters are being

monitoring only in specified time intervals as any gas leakage reaches its UEL levels

only gradually and not in split seconds.

Page 46: Final Report Content

46

4.1.2. Gas LELs and UELs

Table 4.2: Analysis of various Gases

VARIOUS GASES

LEL (%)

UEL (%)

Acetone 13.5 15.5

Benzene 11 14

Butadiene 10 13

Butane 12 14.5

Carbon Disulfide 5 8

Carbon monoxide 5.5 6

Diethyl ether 10.5 13

Ethylene 10 11.5

Hydrogen 5 6

Iso Butane 12 15

Methane 12 14.5

Methyl Alcohol 10 13.5

Propane 11.5 14

Propylene 11.5 14

Hydrogen sulfide 7.5 11.5

The Lower Emission Level (LEL) and Upper Emission Level (UEL) of the

various gases are discussed in Fig 4.2. The LEL is the level of gas in percentage below

which the gas is not hazardous or does not catch fire, the UEL is the upper level of

gas leakage above which it is not combustible. The LEL and UEL is measured in

percentage of the gas leaked.

Page 47: Final Report Content

47

4.1.3 ZigBee 802.15.4 latency time analysis:

Fig 4.1: ZigBee network

Digi's XBee Series 1 radio modules run 802.15.4 firmware, which allows them to

transmit data in a point-to-point, peer-to-peer or point-to-multipoint (star) network

architecture as shown in Fig 4.1. The time it takes to transmit a data packet is a sum

of the Time on Air and Time for CSMA-CA and Retries, as outlined below.

Quick Reference:

XBee 8021.5.4 max payload = 100 bytes

XBee ZNET 2.5 max payload = 72 bytes

RF baud rate (802.15.4, 2.4GHz) = 250 Kbps

Byte time @ 250 Kbps = 32 us

64-bit: T_air(B) = 0.8 + 0.032B ms

16-bit: T_air(B) = 0.416 + 0.032B ms

16-bit best case (broadcast and unicast): T_total(B) = 0.544 + 0.032B ms

64-bit unicast best case: T_total(B) = 0.928 + 0.032B ms

Broadcast worst case: T_total(B) = 9.376 + 0.032B ms

16-bit unicast worst case: T_total(B) = 40.096 + 0.128B ms

64-bit unicast worst case: left for the reader to calculate

Total transmission time = Time on air + Time delay cause by hardware

Page 48: Final Report Content

48

Time on Air

The 802.15.4 PHY layer allows a maximum 127 bytes per packet, including

payload. Due to the size of the packet header, XBee Series 1 modules can send a

maximum payload of 100 bytes. XBee Series 2 modules, which utilize more header

bytes for ZigBee mesh networking, can send a maximum payload of 72 bytes.

At 2.4 GHz the 802.15.4 PHY layer specifies an RF baud rate of 250 Kbps, which

is a 4 us bit time or 32 us byte time. This gives us enough information to compute the

"T_air(B)," the actual time on the air taken to send B payload bytes.

T_air(1) = (25 + 1) * 32 us = 0.832 ms [25-byte header + 1 payload byte) * 32 us byte

time]

T_air(100) = (25 + 100) * 32 us = 4.000 ms

T_air(B) = 0.8 + 0.032B ms

The above calculation is assuming 64-bit addressing. It is probably more

common to use only 16-bit addressing, which allows us to use a 13-byte header

instead of a 25-byte header (subtract 48 bits from 64 bits in both source and

destination addressing to reduce a total of 96 bits or 12 bytes). Using 16-bit

addressing, T_air for different payload bytes are as follows:

T_air(1) = (13 + 1) * 32 us = 0.448 ms

T_air(72) = (13 + 72) * 32 us = 2.720 ms

T_air(100) = (13 + 100) * 32 us = 3.616 ms

T_air(B) = 0.416 + 0.032B ms

Page 49: Final Report Content

49

Time for CSMA-CA and Retries

The above calculations are the "on-air" time only. The total time it takes to

transmit an 802.15.4 packet includes the time for CSMA-CA and retries, where

applicable.

CSMA-CA stands for Carrier Sense Multiple Access - Collision Avoidance. This

basically means that before a radio actually begins transmitting on the air it senses

the carrier channel to make sure the air waves are clear (called CCA-Clear Channel

Assessment). If it senses strong enough activity on the channel, it will perform a

random delay (back off/wait time) and then try again with another CCA.

For easier reference an outline of the basic steps here:

Perform random delay.

Perform CCA.

Transmit if CCA is clear. If channel is not clear, then repeat steps 1-3 up to 4

more times.

Done if broadcast (no acknowledgment/retry).

If unicast:

Wait for ACK (acknowledgment of packet received) from destination

node.

Done if ACK is received. Repeat steps 1-4 up to 3 more times.

Following are the computations for the above steps:

Perform random delay. The random delay function is (0 : 2^BE - 1) * 0.320

ms, where BE starts at RN and increments each time (up to max value of 5)

through the loop until step 3 is cleared. (RN is default 0; it is a user-settable).

The "0:2" means it chooses a random number between 0 and 2.

Perform CCA. This step always takes 0.128 ms.

No computation on this step.

Wait for ACK. This step takes up to 0.864 ms.

No computation on this step.

Page 50: Final Report Content

50

Total Transmit Time

Let's do some examples to compute "T_total(B)," the total time taken to send B

payload bytes.

Best case:

Broadcast 1 byte, RN = 0

Random Delay = (0 : 2^0 - 1) * 0.320 = 0 ms

CCA = 0.128 ms

T_air(1) = 0.448 ms

T_total(1) = 0 + 0.128 + 0.448 = 0.576 ms

To generalize this "best case" timing calculation (works for both broadcast and

unicast since "best case" assumes no time spent waiting on the ACK in step 4.a):

16-bit: T_total(B) = 0.544 + 0.032B ms

Similarly, we can compute the "best case" timing for a 64-bit addressed unicast

packet, assuming ~0 time spent waiting on the ACK:

64-bit: T_total(B) = 0.928 + 0.032B ms

Worst case:

Example: Broadcast 1 byte, RN = 0

Random Delay = 0 ms

CCA = 0.128 ms [Assume CC did not clear. Go back to step 1.]

Random Delay = (0 : 1) * 0.320 = 0.320 ms

CCA = 0.128 ms

Page 51: Final Report Content

51

Random Delay = (0 : 3) * 0.320 = 0.960 ms [Assuming (0 : 3) yielded 3.]

CCA = 0.128 ms

Random Delay = (0 : 7) * 0.320 = 2.240 ms [Assuming (0 : 7) yielded 7.]

CCA = 0.128 ms

Random Delay = (0 : 15) * 0.32 = 4.800 ms [Assuming (0 : 15) yielded 15.]

CCA = 0.128 ms

Subtotal for this CSMA-CA section: 8.96 ms

T_air(1) = 0.448 ms

T_total(1) = 8.96 + 0.448 = 9.408 ms

To generalize this "worst case" timing calculation for a broadcast message:

T_total(B) = 9.376 + 0.032B ms

4.2 RESULT

Thus, an industrial safety system is designed and constructed for workers

working in hazardous environments, comprising of two sections.

A portable unit is provided to the workers, which is capable of sensing

hazardous conditions like gases, excessive temperature, heart beat and humidity etc.

and a monitoring system at the receiving end (control room) which interacts with the

portable unit using a ZigBee wireless communication link is developed.

Page 52: Final Report Content

52

Fig 4.2 Block Diagram of Developed System in LabVIEW

Fig. 4.3: Front Panel of the Developed System in LabVIEW

Fig 4.2 shows the block diagram developed in labview for the system. Fig 4.3

illustrates the front panel of the developed system in LabVIEW. The digital indicators

indicates the output from various sensors implemented in the system. If the outputs of

the sensors exceed the set point, the LED flashes. The plot depicts the variation of

output with respect to time.

Page 53: Final Report Content

53

4.3 ADVANTAGES OF THE DEVELOPED SYSTEM

Communication channel availability is maximized

Workers distribution at any given time for any area is known.

Open system, allows developing other applications

Long time archiving helps analysis

Safety system integrity is improved

Page 54: Final Report Content

54

CHAPTER 5

CONCLUSION

5.1 SUMMARY

“Integrated refinery fire and gas monitoring system using ZigBee” is a project based

on a wireless communication to enhance man and machine safety in a petrochemical

industry. As petroleum industries are the largest process control industry it is also

highly prone to major fire and gas disasters. A petrochemical industry has excessively

high amount of crude oil stored within a confined area. Therefore presence of any

external source which can cause heat or fire would lead to a major disaster. Even the

gas that are present in petroleum refineries are hazardous. And another instance, the

Vishakhapatnam, HPCL refinery tragedy claimed lives of 30 people. Though a gas

and fire detection system was present which is connected to the sensors using large

number of wires that run from the control room to various plant areas. But during the

fire the wire itself got damaged, so the information did not reach the control room.

Therefore our system is developed with the aim of overcoming the restrictions and

disadvantages of the existing system. The system we have designed is an integrated

system which will monitor timely gas leakage in any area around the plant using

ZigBee which is a wireless communication device. We have also proposed a new

system which monitors human density within the plant area. Therefore Integrated plant

safety monitor system based on ZigBee can realize workers attendance registration,

Real-time precise positioning, Dynamic gas concentration monitoring, Real-time data

transmission & Danger alarm. This project is focused on implementing the newly

designed integrated system in CPCL, Manali.

Page 55: Final Report Content

55

5.2 CONCLUSION

“Integrated refinery fire and gas monitoring system using ZigBee” is developed to

enhance man and machine safety in a petroleum refinery. The main objective of the

project was early detection of gas leakage around the plant area. With the detection

of a gas leak the sensor present in the plant area as well as with the plant area workers

alerts the control room personnel. Therefore with this system even the human density

in the plant area was determined. We have also analyzed various wireless

technologies and various hardware and software approaches that can be

implemented. After implementing this system in CPCL, Manali it was found out to be

more efficient than the previously existing system. And with the introduction of ZigBee

the whole project cost was also reduced and human safety level was also increased.

5.3 FUTURE SCOPE

In addition to the developed system, the system can be enhanced by adding a

control element which controls the gas leakage if it exceeds the specified upper

explosive level for the various gases in the plant area. This can be achieved by any

gas leakage indication in any part of the plant alerts the control room and then the

control valve is shut off. Therefore preventing any hazard arising due to gas leakage.

Page 56: Final Report Content

56

REFERENCES

[1] Chih-Ning Huang, Chia-Tai Chan, “ZigBee-based indoor location system by k-

nearest neighbor algorithm with weighted RSSI”, Procedia Computer Science,

Volume 5, 2011, pp. 58-65.

[2] Ebrahim A. Soujeri,Harikrishnan A. I, Rahim Rajan,Sumi M, “Design of a

zigbee-based RFID network for industry applications”, proceedings of the 2nd

international conference on Security of information and networks, 2009, pp.

111-116.

[3] Fabio Graziosi, Fortunato Santucci,Marco Di Renzo, Stefano Tennina,

“Locating zigbee nodes using the tis cc2431 location engine: a testbed latform

and new solutions for positioning estimation of wsns in dynamic indoor

environments”

[4] Fire and Gas System Engineering –Performance Based Methods for Process

Facilities , ISA manual, 2011

[5] G. A. Arun Kumar, K.Rajasekhar, B.V.V.Satyanarayana, K.Suryanarayana

Murthy, “Implementation of Real time Detection of Gas leakage in Industries

usingARM7 &ZigBee” International Journal of Engineering Research &

Technology,

[6] IEEE Reference: Restful Web Service Mashup Based Coal Mine Safety

Monitoring and Control Automation with Wireless Sensor Network

[7] Instrument Hand Book Of CPCL By Gowthaman 2012 May edition

[8] Integrity Level Selection: Systematic Methods Including Layer of

[9] Jeffrey Wong,Haruo Noma,Kiyoshi Kogure, Masakazu Miyamae,Satoshi

Takahashi,Shojiro Nishio, Tomoji Toriyama, Tsutomu Terada, “A ZigBee-

based sensor node for tracking people's locations”, proceedings of the 2nd

ACM international conference on Context-awareness for selfmanaging

systems, 2008, pp. 34-38.

[10] Jin Hyung Park, Joon Goo Park, Sharly Joana Halder, Sin Woo Park, Sung Hun

Kang, Tae Young Choi, “Enhanced ranging using adaptive filter of ZIGBEE

Page 57: Final Report Content

57

RSSI and LQI measurement”, Proceedings of the 10th International Conference

on Information Integration and Web-based Applications & Services, 2008, pp.

367-373.

[11] MSA Gas detection hand book, 2008

[12] Protection Analysis Eric William Scharpf, The Instrumentation, Systems, and

Automation Society (May 1, 2002)Year of Publication: 2012