You are on page 1of 62

IMPLEMENTAION OF BUILDING MONITORING

SYSTEM USING WIRELESS SENSOR NETWORK

A PROJECT REPORT

Submitted by

R.SOUNDHARYA (421113106185)

in partial fulfillment for the award of the degree

Of

BACHELOR OF ENGINEERING
IN

ELECTRONICS AND COMMUNICATION ENGINEERING

IFET COLLEGE OF ENGINEERING, VILLUPURAM

ANNA UNIVERSITY:: CHENNAI 600 025

APRIL 2017
ANNA UNIVERSITY :: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “IMPLEMENTATION OF BUILDING


MONITORING SYSTEM USING WIRELESS SENSOR NETWORK” is
the bonafide work of “R.SOUNDHARYA (421113106185)” who carried out
the project work under my supervision.

SIGNATURE SIGNATURE
Mrs.R.MALAR, M.E., Ms.B.KRITHIGA, M.Tech.,
HEAD OF THE DEPARTMENT SUPERVISOR
Associate Professor Assistant professor
Department of E.C.E, Department of E.C.E,
IFET College of Engineering IFET College of Engineering,
Villupuram-605108 Villupuram-605108

Submitted for the project work & viva voce examination on………….

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT
I take this opportunity with privilege to express my sense of gratitude to
those who have helped me in bringing out the project successfully.

I take this opportunity to record my sincere thanks to Mr.K.V.RAJA,


Chairman, IFET College of Engineering for providing the infrastructural
facilities required to complete my project work.

I would like to express my deep sense of gratitude to our beloved


Principal Dr.G.MAHENDRAN, M.Tech (IITM), Ph.D for his constant
encouragement throughout my course of study and providing me all facilities.

I am extremely grateful to treasured Vice Principal and Dean Academics


Dr.S.MATILDA,M.S.,Ph.D., and Dean Placement and Student Affairs Prof.
J.ASHA,M.E,(Ph.D)., for their incitement and created enthusiasm to make my
project work wonderful and successful one.

I am extremely thankful to my respected Head of Department


Mrs.R.MALAR, M.E., and Batch Co-ordinator Mrs.D.VASANTHI M.E.,
for their incitement and created enthusiasm to make my project as successful
one.

I thank my internal guide Ms. B. KRITHIGA, M.Tech for her guidance


and encouragement right from the commencement of this project work.

I also thank all the staff members in our department for their cooperation
they have rendered to me, sustained interest shown at every stage of my
endeavor in making the project a success.

I am very much grateful to my lovely parents and friends who have


given me all the requirements for the fulfillment of the project and bringing the
project a success.
ABSTRACT

With the fast improvement of wireless communication innovation,


individuals' life has experienced awesome changes. As of late, the solace and
safety of the building condition have turned into an all-inclusive concern. The
main aim of this project is to monitor the building or house from fire accident,
gas leakage, load capacity and vibrations. This system has three nodes in which
two at the transmitter side and one at the receiver side. Signals from each sensor
are sent to the monitoring system through zig-bee. In case of fire detection, gas
leakage, detection of vibration and when the capacity of building is increased
beyond the limit then alert message will be sent to mobile numbers through
GSM. This project outlines a long distance transmission method of data inside
the whole working by Zig-bee-GSM, and afterward the signals identified by
sensors are transmitted to the monitoring center. The configuration can
guarantee the security of structures and individuals exhaustively and viably.

i
LIST OF FIGURES

FIGURE NO NAME OF FIGURE PAGE NO

4.1 BLOCK DIAGRAM OF NODE 1 7

4.2 BLOCK DIAGRAM OF NODE 2 8

4.3 BLOCK DIAGRAM OF NODE 3 8

5.1 BLOCK DIAGRAM OF AT89S52

MICROCONTROLLER 15

5.2 PIN DIAGRAM OF MICROCONTROLLER 16

5.3 FLAME SENSOR (SR017) 22

5.4 GAS SENSOR (MQ-6) 24

5.5 VIBRATION SENSOR (LTC1050) 25

5.6 LOAD CELL (FORSENTEK) 26

5.7 GSM MODULE 28

5.8 PIN DIAGRAM OF MAX232 29

5.9 PIN DIAGRAM OF ADC0808 30

5.10 DIAGRAM OF LCD 31

5.11 NINE VOLT BATTERY 32

5.12 POWER SUPPLY UNIT 33

5.13 CIRCUIT DIAGRAM OF NODE 1 34

ii
5.14 CIRCUIT DIAGRAM OF NODE 2 35

7.1 NODE 1 (TRANSMITTER) 40

7.2 NODE 2 (TRANSMITTER) 40

7.3 NODE 3(RECEIVER) 40

7.4 SOFTWARE RESULT IN VIRTUAL BASIC 6.0 41

iii
LIST OF ABBREVIATIONS

GSM - Global system for Mobile Communication

Wi-Fi - Wireless fidelity

LCD - Liquid crystal display

IOT - Internet of Things

IP - Internet Protocol

WSN - Wireless Sensor Network

AC - Alternating Current

DC - Direct Current

BLE - Bluetooth Low Energy

RAM - Random Access Memory

EEPROM - Electrically Erasable Programmable Read Only Memory

PC - Personal Computer

iv
TABLES OF CONTENTS

CHAPTER NO TITLE PAGE NO

ABSTRACT i

LIST OF FIGURES ii

LIST OF ABBREVIATIONS iv

1 INTRODUCTION 1

1.1 BACKGROUND 1

2 LITERATURE SURVEY 2

2.1 LITERATURE REVIEW 2

3 EXISTING METHODOLOGY 5

3.1 LIMITATIONS 5

4 PROPOSED SYSTEM 6

4.1 ADVANTAGES 6

4.2 BLOCK DIAGRAM 7

4.3 APPLICATIONS 9

5 HARDWARE DESCRIPTION 10

5.1 MICRCONTROLLER 10

5.2 AT89S52 MICRONTROLLER 12

5.2.1 Features of AT89S52

microcontroller 14
5.2.2 Block diagram of AT89S52 15

5.2.3 Pin diagram of AT89S52 16

5.2.4 Pin description 17

5.3 ZIG-BEE 21

5.3.1 Features of Zig-Bee 21

5.4 SENSORS 22

5.4.1 Flame sensor 22

5.4.2 Gas sensor 24

5.4.3 Vibration sensor 25

5.4.4 Load cell 26

5.5 GSM MODULE 27

5.5.1 Features of GSM 28

5.6 MAX232 29

5.7 ADC0808 29

5.8 LIQUID CRYSTAL DISPLAY 30

5.9 BATTERY 32

5.10 POWER SUPPLY UNIT 33

5.11 CIRCUIT DIAGRAM 34

6 SOFTWARE 36

6.1 SOFTWARE DESCRIPTION 36


6.2 KEIL COMPILER 36

6.3 VIRTUAL BASIC 6.0 38

7 RESULT AND DISCUSSION 40

7.1 HARWARE RESULT 40

7.2 SOFTWARE RESULT 41

8 CONCLUSION 42

9 FUTURE SCOPE 43

REFERENCES 44

APPENDIX 46
CHAPTER 1

INTRODUCTION

1.1 BACKGROUND:

As of late, wireless communications, wireless control, remote


confinement and versatile computerized innovation develop increasingly every
now and again in our day by day lives. The remote correspondence innovation
is generally utilized as a part of building robotization, changing the customary
wired correspondence way. For the perplexing condition in building, the
utilization of remote sensor systems to a complete building observing has turned
into another pattern. Current building fire well-being framework predominantly
concentrates on the fire alarm. Be that as it may, the observing focus can’t take
successful departure and direction in time. At the point when the fire happens, it
is especially essential for individuals in threat to escape rapidly.

Consequently, this project outlines a long distance transmission method


of data inside the whole working by Zig-bee-GSM, and afterward the signals
identified by sensors are transmitted to the monitoring center. The configuration
can guarantee the security of structures and individuals exhaustively and viably.

1
CHAPTER 2

LITERATURE SURVEY

LITERATURE SURVEY:

SURVEY 1: G.Shanthi , M.Sundarambal , M. Dhivyaa, Design and


Implementation of Monitoring and Control System Based on Wireless
Sensor Network,January 2015.

The monitoring modes involve the reading of energy consumption and the
status of each node and display them in LabVIEW. The control mode involves
the control of nodes from LabVIEW based on the output from the sensor and
the status of the node. The nodes are linked through Ethernet and are given
individual IP address using which the individual node is identified and
controlled automatically through LabVIEW. It focuses on the two key
methodologies which are used to implement energy conservation in building is
achieved by monitoring and control mode. However, there exist shortages
inevitably as a result of exploratory research on applying WSNs to building
monitoring and controlling.

SURVEY 2: Tamzid-al-noor, MD. Farhad hossain, Micrcontroller Based

Automatic Fire Control & Monitoring System, Febraury 2014.

The project has three main systems, 1) the detection system, 2) the
monitoring system & 3) the appliance system. The detection system operates as
the fire detector. This detection system has components like flame detector,
smoke detector, light detector, heat detector etc. This paper discusses the design
and implementation of a fire alarm system using the microcontroller which
operates the entire system. The detectors are placed in parallel in different

2
levels. Any signal from each detector at any level is monitored using monitoring
system. The appliance system has components like buzzer for alarming and
motor pump to stop the fire. The entire system is controlled by microcontroller.
The microcontroller is programmed in such way by using C-Programming.
From the project done, the system can detects smoke, light, flame, heat etc.
sensed by the detector, followed by the monitoring system which indicates
smoke, light, flame, heat etc. at that particular level. Finally when the sensors
form each level triggered individually, the main buzzer operates and disconnect
the AC power supply. Then it shows in the control panel LCD display which
area is affected and which is safe. Then it runs the emergency exit motor to
escape and the water pump motor to the affected zone to stop the fire.

SURVEY 3: Changhai Peng, Kun Qian, Development and Application of a


ZigBee-Based Building Energy Monitoring and Control System,2014

ZigBee is designed for reliable wirelessly networked monitoring and


control networks. An example of comparison between ZigBee and BLE, two
most popular techniques for wireless measurement applications, demonstrates
the reason why the former is favorable for our application. BLE is more
oriented towards user mobility whereas ZigBee aims for automation and remote
control. Bluetooth supports 8 nodes per network whereas ZigBee supports up to
255 nodes per network. In addition, the advantage of ZigBee in mesh
networking capabilities allows itself to be very easy to install without the need
for any special installation services. Therefore, ZigBee is more suitable for
remote energy monitoring and control. The sensor node is comprised of a direct
current (DC) power module, a MCU, an alternating current (AC) power control
module, and a ZigBee module. The MCU module communicates with the power
measurement module by an analog front end (AFE) and with the ZigBee

3
module through universal asynchronous receiver/transmitter (UART) interfaces.
Communication between the ZigBee module and the control module is achieved
by the pulse width modulation (PWM) technique.

SURVEY 4: Luay Fraiwan, Khaldon Lweesy, Aya Bani-Salma, Nour Mani,


A Wireless Home Safety Gas Leakage Detection System,2011

The main function is to detect changes in gas concentration, activate an


audiovisual alarm, and transmit a signal to the receiver unit. It consists of a gas
detection sensor, a sensing circuit, a microcontroller, and an RF transmission
system. The gas detection is done using a solid state gas sensor (Model: MQ-5,
Hanwei Electronics Co., Ltd, China) that is sensitive to LPG, natural gas (or
methane) and other gases such as CO and H2 but not sensitive to air; therefore
the reading is not affected by the presence of air. The sensing part is made from
Tin Dioxide (SnO2) layer, which is a resistive element with a resistance (Rs)
that change with the change of concentration of gases like LPG, CH4, CO, and
alcohol. The sensor can detect small concentrations of the above mentioned
gases as small as 0.1 mg/L [11], which makes it suitable for gas leak detection.
It is worth mentioning that the sensor is also sensitive to room temperature and
humidity

4
CHAPTER 3

EXISTING METHODOLOGY

The existing system focus on building fire monitoring system it consists


of three modules namely data collecting module, wireless transmitting module,
and remote monitoring module. At data collecting module Zig-Bee wireless
sensor network nodes are employed, it collects signals from the sensors and
transmits them to monitoring center through zig-bee – Wi-Fi network called
wireless transmitting module. At remote monitoring module PC or monitoring
system is employed to monitor the building and also to locate the fire place . In
the existing system only fire monitoring is done and the information about the
fire accident is sent to the monitoring station

3.1 LIMITATIONS:

• Continuous monitoring is required at the monitoring center


• Only fire monitoring is done

5
CHAPTER 4

PROPOSED SYSTEM

The main aim of this project is to monitor the building or house from fire
accident, gas leakage, and increase in load capacity of the building and
vibrations.

In the proposed system, along with the fire, gas leakage, vibrations, load
capacity of building is concentrated. This system consists of three nodes in
which two nodes at the transmitter side and one at the receiver side.

For,

• Fire detection - Flame sensor(SR017)


• Gas leakage - gas sensor(MQ6)
• Vibrations - vibration sensor(LTC 1050)
• Load capacity - Load cell(Forsentek-10kg)

are used at the transmitter nodes. Node 1 consists of fire sensor and gas sensor,
similarly node 2 consists of vibration sensor and a load cell. Signals from the
sensors at each node is collected through the zig-bee and it is continuously
transmitted to the monitoring center, when the signals from the sensor reaches
the limit beyond the predefined values, then alert message will be sent to the
numbers which is stored, through GSM.

4.1 ADVANTAGES:

• Along with the fire monitoring in this system gas leakage,


vibrations, load capacity of building is concentrated.
• No need of continuous monitoring at the monitoring center
6
to ensure the safety of the building because when the sensor signals exceed
the limit of pre-defined values then the message will be sent to the user mobile
through GSM

• It ensures solace and safety of the building

4.2 BLOCK DIAGRAM:

Node 1(Transmitter):

Flame sensor

Gas sensor Microcontroller


(AT89S52)

Zig-bee

Fig: 4.1 Block diagram of Node 1

In node 1, we concentrate on fire detection and gas leakage. In node 1, it


consists of microcontroller (AT89S52), zig-bee, flame sensor (SR017), Gas
sensor (MQ6). In this node information about the gas and fire is collected and
the signal information is transmitted to the monitoring center through zig-bee. If
the signal limit exceeds the pre-defined values then the alert message will be
sent to the mobile numbers through the GSM.

7
Node 2(Transmitter):

Load cell

Vibration Microcontroller
sensor (AT89S52)

Zig-bee

Fig: 4.2 Block Diagram of Node 2

Similarly at node 2, we concentrate on load cell to examine the capacity


of the building and vibration detection. Node 2 consists of microcontroller
(AT89S52), load cell (Forsentek 10kg), vibration sensor (LTC1050). Here
information about the vibrations and load capacity is collected and the signal
information is transmitted to the monitoring center through zig-bee.

Node 3(Receiver):

Monitoring
system (PC)

Zig-bee GSM

Mobile
phone

Fig: 4.3 Block Diagram of Node 3

Signals from the sensors at each node is collected through the zig-bee and
it is continuously transmitted to the monitoring center, when the signals from
the sensor reaches the limit beyond the predefined values, then alert message
will be sent to the numbers which is stored, through GSM.

8
4.3 APPLICATIONS:

• It can be implemented in hospitals, schools in order to avoid fire


accidents and other such accidents
• It is used to ensure the safety and solace of the building

9
CHAPTER 5

HARDWARE DESCRIPTION

5.1 MICROCONTROLLER:

A microcontroller is a small computer on a single integrated circuit. In


modern terminology, it is a System on a chip or SoC. A microcontroller
contains one or more CPUs (processor cores) along with memory and
programmable input/output peripherals. Program memory in the form of
Ferroelectric RAM, NOR flash or OTP ROM is also often included on chip, as
well as a small amount of RAM. Microcontrollers are designed for embedded
applications, in contrast to the microprocessors used in personal computers or
other general purpose applications consisting of various discrete chips.

Microcontrollers are used in automatically controlled products and


devices, such as automobile engine control systems, implantable medical
devices, remote controls, office machines, appliances, power tools, toys and
other embedded systems. By reducing the size and cost compared to a design
that uses a separate microprocessor, memory, and input/output devices,
microcontrollers make it economical to digitally control even more devices and
processes. Mixed signal microcontrollers are common, integrating analog
components needed to control non-digital electronic systems. If ROM is added
as an external chip, the microcontroller is cheaper and the program can be
considerably longer. At the same time, a number of available pins are reduced
as the microcontroller uses its own input/output ports for connection to the chip.
Random Access Memory (RAM) is a type of memory used for temporary
storing data and intermediate results created and used during the operation of
the microcontrollers.

10
A microcontroller can be considered a self-contained system with a
processor, memory and peripherals and can be used as an embedded system.
The majority of microcontrollers in use today are embedded in other machinery,
such as automobiles, telephones, appliances, and peripherals for computer
systems.

While some embedded systems are very sophisticated, many have


minimal requirements for memory and program length, with no operating
system, and low software complexity. Typical input and output devices include
switches, relays, solenoids, LED's, small or custom liquid-crystal displays, radio
frequency devices, and sensors for data such as temperature, humidity, light
level etc. Embedded systems usually have no keyboard, screen, disks, printers,
or other recognizable I/O devices of a personal computer, and may lack human
interaction. Microcontrollers were originally programmed only in assembly
language, but various high-level programming languages, such as C, Python and
JavaScript, are now also in common use to target microcontrollers and
embedded systems. These languages are either designed especially for the
purpose, or versions of general purpose languages such as the C programming
language. Compilers for general purpose languages will typically have some
restrictions as well as enhancements to better support the unique characteristics
of microcontrollers. Some microcontrollers have environments to aid
developing certain types of applications. Microcontroller vendors often make
tools freely available to make it easier to adopt their hardware.

Many microcontrollers are so quirky that they effectively require their


own non-standard dialects of C, such as SDCC for the 8051, which prevent
using standard tools (such as code libraries or static analysis tools) even for
code unrelated to hardware features.

11
5.2 AT89S52 MICROCONTROLLER:

The AT89S52 is a low-power, high-performance CMOS 8-bit


microcontroller with 8K bytes of in-system programmable Flash memory.

The device is manufactured using Atmel’s high-density nonvolatile


memory technology and is compatible with the Indus-try-standard 80C51
instruction set and pin out.

The on-chip Flash allows the program memory to be reprogrammed in-


system or by a conventional nonvolatile memory pro-grammars. By combining
a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip,
the Atmel AT89S52 is a powerful microcontroller which provides a highly-
flexible and cost-effective solution to many embedded control applications.

The AT89S52 provides the following standard features: 8K bytes of


Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three
16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex
serial port, on-chip oscillator, and clock circuitry.

In addition, the AT89S52 is designed with static logic for operation down
to zero frequency and supports two software selectable power saving modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial
port, and interrupt system to continue functioning.

The Power-down mode saves the RAM con-tents but freezes the
oscillator, disabling all other chip functions until the next interrupt or hardware
reset. Random Access Memory (RAM) is a type of memory used for temporary
storing data and intermediate results created and used during the operation of
the microcontrollers.

12
All four ports in the AT89C51 and AT89C52 are bidirectional. Each
consists of a latch (Special Function Registers P0 through P3), an output driver,
and an input buffer. The output drivers of Ports 0 and 2, and the input buffers of
Port 0, are used in accesses to external memory. In this application, Port 0
outputs the low byte of the external memory address, time-multiplexed with the
byte being written or read. Port 2 outputs the high byte of the external memory
address when the address is 16 bits wide. Otherwise the Port 2 pins continue to
emit the P2 SFR content. All the Port 3 pins, and two Port 1 pins (in the
AT89C52) are multifunctional. The alternate functions can only be activated if
the corresponding bit latch in the port SFR contains a 1. Otherwise the port pin
is stuck at 0. It has less complex feature than other microprocessor.

Low-power, high-performance CMOS 8-bit microcontroller with 8KB of


ISP flash memory. The device uses Microchip high-density, nonvolatile
memory technology and is compatible with the industry-standard 80C51
instruction set and pin out. On-chip flash allows the program memory to be
reprogrammed in-system or by a conventional nonvolatile memory
programmer. This powerful microcontroller is suitable for many embedded
control applications.

In addition, the AT89S52 is designed with static logic for operation down
to zero frequency and supports two software selectable power saving modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial
port, and interrupt system to continue functioning. The Power-down mode saves
the RAM contents but freezes the oscillator, disabling all other chip functions
until the next interrupt or hardware reset. Even pulses generated by the oscillator
enable harmonic and synchronous operation of all circuits within the
microcontroller.

13
5.2.1 FEATURES OF AT89S52 MICROCONTROLLER:

• Compatible with MCS®-51 Products.

• 8K Bytes of In-System Programmable (ISP) Flash Memory –


Endurance: 1000 Write/Erase Cycles.

• 4.0V to 5.5V Operating Range

• Fully Static Operation: 0 Hz to 33 MHz

• Three-level Program Memory Lock

• 256 x 8-bit Internal RAM

• 32 Programmable I/O Lines

• Three 16-bit Timer/Counters

• Eight Interrupt Sources

• Full Duplex UART Serial Channel

• Low-power Idle and Power-down Modes

• Interrupt Recovery from Power-down Mode

• Watchdog Timer

• Dual Data Pointer

• Power-off Flag

• Fast Programming Time

• Flexible ISP Programming (Byte and Page Mode)

• Green (Pb/Halide-free) Packaging Option.

14
5.2.2 BLOCK DIAGRAM OF AT89S52:

Fig: 5.1 Block Diagram of AT89S52 Microcontroller

The 89S52 has 4 different ports, each one having 8 Input/output lines
providing a total of 32 I/O lines. Those ports can be used to output DATA and
orders do other devices, or to read the state of a sensor, or a switch. Most of the
ports of the 89S52 have 'dual function' meaning that they can be used for two
different functions.

The first one is to perform input/output operations and the second one is
used to implement special features of the microcontroller like counting external
pulses, interrupting the execution of the program according to external events,
performing serial data transfer or connecting the chip to a computer to update

15
the software. Each port has 8 pins, and will be treated from the software point of
view as an 8-bit variable called 'register', each bit being connected to a different
Input/output pin.

There are two different memory types: RAM and EEPROM. Shortly,
RAM is used to store variable during program execution, while the EEPROM
memory is used to store the program itself, that's why it is often referred to as
the 'program memory'. It is clear that the CPU (Central Processing Unit) is the
heart of the micro controllers. It is the CPU that will Read the program from the
FLASH memory and execute it by interacting with the different peripherals.

5.2.3 PIN DIAGRAM OF AT89S52:

Fig: 5.2 Pin Diagram of AT89S52

16
5.2.4 PIN DESCRIPTION:

VCC:

Supply voltage

GND:

Ground

Port 0:

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port,


each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins
can be used as high-impedance inputs.

Port 0 can also be configured to be the multiplexed low-order


address/data bus during accesses to external program and data memory. In this
mode, P0 has internal pull-ups.

Port 0 also receives the code bytes during Flash programming and outputs
the code bytes during program verification. External pull-ups are required
during program verification.

Port 1:

Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs. When 1s are written to Port 1
pins, they are pulled high by the inter-nal pull-ups and can be used as inputs.

As inputs, Port 1 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be

configured to be the timer/counter 2 external count input (P1.0/T2)

17
Port 1 also receives the low-order address bytes during Flash programming and
verification.

Port 2:

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2
pins, they are pulled high by the internal pull-ups and can be used as inputs.

As inputs, Port 2 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups. Port 2 emits the high-order
address byte during fetches from external program memory and during accesses
to external data memory that uses 16-bit addresses (MOVX @ DPTR).

In this application, Port 2 uses strong internal pull-ups when emitting 1s.
During accesses to external data memory that uses 8-bit addresses (MOVX @
RI), Port 2 emits the contents of the P2 Special Function Register.

Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.

Port Pin Alternate Functions P1.0 T2 (external count input to


Timer/Counter 2), clock-out P1.1 T2EX (Timer/Counter 2 capture/reload trigger
and direction control) P1.5 MOSI (used for In-System Programming) P1.6
MISO (used for In-System Programming) P1.7 SCK (used for In-System
Programming)

The Power-down mode saves the RAM con-tents but freezes the
oscillator, disabling all other chip functions until the next interrupt or hardware
reset. Even pulses generated by the oscillator enable harmonic and synchronous
operation of all circuits within the microcontroller

18
Port 3:

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port 3
pins, they are pulled high by the internal pull-ups and can be used as inputs.

As inputs, Port 3 pins that are externally being pulled low will source
current (IIL) because of the pull-ups. Port 3 receives some control signals for
Flash programming and verification. Port 3 also serves the functions of various
special features of the AT89S52, as shown in the following table.

RST:

Reset input. A high on this pin for two machine cycles while the
oscillator is running resets the device.

This pin drives high for 98 oscillator periods after the Watchdog times
out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this
feature. In the default state of bit DISRTO, the RESET HIGH out feature is
enabled.

ALE/PROG:

Address Latch Enable (ALE) is an output pulse for latching the low byte
of the address during accesses to external memory. This pin is also the program
pulse input (PROG) during Flash programming.

In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator


frequency and may be used for external timing or clocking purposes. Note,
however, that one ALE pulse is skipped during each access to external data
memory. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit
has no effect if the microcontroller is in external execution mode.

19
If desired, ALE operation can be disabled by setting bit 0 of SFR location
8EH. With the bit set, ALE is active only during a MOVX or MOVC
instruction.

PSEN:

Program Store Enable (PSEN) is the read strobe to external program


memory.

When the AT89S52 is executing code from external program memory,


PSEN is activated twice each machine cycle, except that two PSEN activations
are skipped during each access to external data memory.

EA/VPP:

External access enables. EA must be strapped to GND in order to enable


the device to fetch code from external program memory locations starting at
0000H up to FFFFH.

Note, however, that if lock bit 1 is programmed, EA will be internally


latched on reset. EA should be strapped to VCC for internal program
executions.

XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.

XTAL2:

It generates output from the inverting oscillator amplifier. The upper 128
bytes occupy a parallel address space to the Special Function Registers. The
AT89S52 implements 256 bytes of on-chip RAM.

20
5.3 ZIGBEE:

Zig-Bee is an IEEE 802.15.4-based specification for a suite of high-level


communication protocols used to create personal area networks with small, low-
power digital radios, such as for home automation, medical device data
collection, and other low-power low-bandwidth needs, designed for small scale
projects which need wireless connection.

The technology defined by the Zig-Bee specification is intended to be


simpler and less expensive than other wireless personal area networks
(WPANs), such as Bluetooth or Wi-Fi. Applications include wireless light
switches, electrical meters with in-home-displays, traffic management systems,
and other consumer and industrial equipment that require short-range low-rate
wireless data transfer.

Its low power consumption limits transmission distances to 10–100


meters line-of-sight, depending on power output and environmental
characteristics. Zig-Bee devices can transmit data over long distances by
passing data through a mesh network of intermediate devices to reach more
distant ones. Zig-Bee is typically used in low data rate applications that require
long battery life and secure networking. Zig-Bee has a defined rate of 250
Kbits/s, best suited for intermittent data transmissions from a sensor or input
device.

5.3.1 FEATURES OF ZIGBEE:

• Low cost and low battery consumption


• Low data rate. The maximum data rate for a Zig-Bee device is 250Kbps.
• Supports up to 65,000 nodes connected in a network.
• Zig-Bee can automatically establish its network.
21
5.4 SENSORS:

Sensor is an electronic component, module, or subsystem whose purpose


is to detect events or changes in its environment and send the information to
other electronics, frequently a computer processor. A sensor is always used with
other electronics, whether as simple as a light or as complex as a computer.

Sensors are used in everyday objects such as touch-sensitive elevator


buttons (tactile sensor) and lamps which dim or brighten by touching the base,
besides innumerable applications of which most people are never aware. With
advances in micro-machinery and easy-to-use microcontroller platforms, the
uses of sensors have expanded beyond the traditional fields of temperature,
pressure or flow measurement, for example into MARG sensors. Moreover,
analog sensors such as potentiometers and force-sensing resistors are still
widely used. Applications include manufacturing and machinery, airplanes and
aerospace, cars, robotics and many other aspects of our day-to-day life.

5.4.1 FLAME SENSOR (SR017):

It can detect the flame or wavelength at 760 nm to 760 nm range of light


sources. Detection point of flame sensor is about 60 degrees, particularly
sensitive to the flame spectrum. Sensitivity is adjustable, stable performance. Its
working voltage is 5V.

Fig: 5.3 Flame Sensor (SR017)

22
A flame detector is a sensor designed to detect and respond to the
presence of a flame or fire. Responses to a detected flame depend on the
installation, but can include sounding an alarm, deactivating a fuel line (such as
a propane or a natural gas line), and activating a fire suppression system. These
data were obtained by measuring the solutions in the optical cell with the HP
multi-meter connecting to a PC. The data logging function was paused during
solution change and restarted 5 minutes after the new buffer solution was
introduced to allow the sensor to reach equilibrium. When used in applications
such as industrial furnaces, their role is to provide confirmation that the furnace
is properly lit; in these cases they take no direct action beyond notifying the
operator or control system. A flame detector can often respond faster and more
accurately than a smoke or heat detector due to the mechanisms it uses to detect
the flame.

A fire emits radiation, which human eye experiences as the visible yellow
red flames and heat. In fact, during a fire, relatively sparsely UV energy and
visible light energy is emitted, as compared to the emission of Infrared
radiation. A non-hydrocarbon fire, for example, one from hydrogen, does not
show a CO2 peak on 4.3 µm because during the burning of hydrogen no CO2 is
released. The 4.3 µm CO2 peak in the picture is exaggerated, and is in reality
less than 2% of the total energy of the fire. A multi-frequency-detector with
sensors for UV, visible light, near IR and/or wideband IR thus have much more
"sensor data" to calculate with and therefore are able to detect more types of
fires and to detect these types of fires better: hydrogen, methanol, ether or
sulphur. It looks like a static picture, but in reality the energy fluctuates, or
flickers. This flickering is caused by the fact that the aspirated oxygen and the
present combustible are burning and concurrently aspirate new oxygen and new
combustible material. These little explosions cause the flickering of the flame.

23
5.4.2 GAS SENSOR (MQ-6):

MQ-6 is a simple-to-use liquefied petroleum gas (LPG) sensor, suitable


for sensing LPG (composed of mostly propane and butane) concentrations in
the air. The MQ-6 can detect gas concentrations anywhere from 200 to
10000ppm.

This sensor has a high sensitivity and fast response time. The sensor’s
output is an analog resistance. The drive circuit is very simple; all you need to
do is power the heater coil with 5V, add a load resistance, and connect the
output to an ADC.

Fig: 5.4 Gas sensor (MQ-6)

Gas detectors measure and indicate the concentration of certain gases in


an air via different technologies. Typically employed to prevent toxic exposure
and fire, gas detectors are often battery operated devices used for safety
purposes. They are manufactured as portable or stationary (fixed) units and
work by signifying high levels of gases through a series of audible or visible
indicators, such as alarms, lights or a combination of signals. While many of the
older, standard gas detector units were originally fabricated to detect one gas,
modern multifunctional or multi-gas devices are capable of detecting several
gases at once.

24
Although detectors are an essential application for home and commercial
safety, they are also employed in numerous industrial industries. Gas detectors
are used in welding shops to detect combustibles and toxics and in nuclear
plants, to detect combustibles. They are also commonly used to detect
hazardous vapors in wastewater treatment plants.

Gas detectors are very efficient in confined spaces where there is no


continuous employee occupancy. Such spaces include tanks, pits, vessels and
storage bins. Detectors may also be placed at a site to detect toxins prior to
occupant entry.

5.4.3 VIBRATION SENSOR:

A vibration sensor is a device that uses the piezoelectric effect to measure


pressure, acceleration, vibration, strain or force by converting them to an
electrical signal

If the module does not vibrate, the vibration switch was closed on state,
output of low output, and the green indicator light.

Fig: 5.5 Vibration sensor (LTC1050)

25
The output can be directly connected with the microcontroller, which to
detect high and low level, so as to detect whether the environment exist
vibration, play a role in the alarm.

5.4.4 LOAD CELL (FORSENTEK):

A load cell is a transducer that is used to convert a force into electrical


signal. This conversion is indirect and happens in two stages. Through a
mechanical arrangement, the force being sensed deforms a strain gauge. The
strain gauge measures the deformation (strain) as an electrical signal, because
the strain changes the effective electrical resistance of the wire. A load cell
usually consists of four strain gauges in a Wheatstone bridge configuration.
Load cells of one strain gauge (Quarter Bridge) or two strain gauges (half
bridge) are also available. The electrical signal output is typically in the order of
a few millivolts and requires amplification by an instrumentation amplifier
before it can be used.

Although strain gauge load cells are the most common, there are other
types of load cells as well. In industrial applications, hydraulic (or hydrostatic)
is probably the second most common, and these are utilized to eliminate some
problems with strain gauge load cell devices.

Fig: 5.6 Load Cell (Forsentek)

26
Other types include piezoelectric load cells (useful for dynamic
measurements of force), and vibrating wire load cells, which are useful in
geomechanical applications due to low amounts of drift, and capacitive load
cells where the capacitance of a capacitor changes as the load preses the two
plates of a capacitor closer together.

Every load cell is subject to "ringing" when subjected to abrupt load


changes. This stems from the spring-like behavior of load cells. In order to
measure the loads, they have to deform. As such, a load cell of finite stiffness
must have spring-like behavior, exhibiting vibrations at its natural frequency.
An oscillating data pattern can be the result of ringing. Ringing can be
suppressed in a limited fashion by passive means. Alternatively, a control
system can use an actuator to actively damp out the ringing of a load cell. This
method offers better performance at a cost of significant increase in complexity.

5.5 GSM MODULE:

GSM is a mobile communication modem; it is stands for global system


for mobile communication (GSM). The idea of GSM was developed at Bell
Laboratories in 1970. A GSM digitizes and reduces the data, then sends it down
through a channel with two different streams of client data, each in its own
particular time slot.

The coverage area of each cell varies according to the implementation


environment. It is widely used mobile communication system in the world.
GSM is an open and digital cellular technology used for transmitting mobile
voice and data services operates at the 850MHz, 900MHz, 1800MHz and
1900MHz frequency bands.

27
Fig: 5.7 GSM Module

GSM system was developed as a digital system using time division


multiple access (TDMA) technique for communication purpose. A GSM
digitizes and reduces the data, then sends it down through a channel with two
different streams of client data, each in its own particular time slot. The digital
system has an ability to carry 64 kbps to 120 Mbps of data rates.

There are various cell sizes in a GSM system such as macro, micro, pico
and umbrella cells. Each cell varies as per the implementation domain. There
are five different cell sizes in a GSM network macro, micro, pico and umbrella
cells. The coverage area of each cell varies according to the implementation
environment.

5.5.1 FEATURES OF GSM:

• Improved spectrum efficiency.


• International roaming.
• Compatibility with integrated services digital network (ISDN)
• Support for new services.
• SIM phonebook management.
• Fixed dialing number (FDN)
28
5.6 MAX 232:

The MAX232 has two receivers that convert from RS-232 to TTL voltage
levels, and two drivers that convert from TTL logic to RS-232 voltage levels.
As a result, only two out of all RS-232 signals can be converted in each
direction. Typically, the first driver/receiver pair of the MAX232 is used for TX
and RX signals, and the second one for CTS and RTS signals.

There are not enough drivers/receivers in the MAX232 to also connect


the DTR, DSR, and DCD signals. Usually, these signals can be omitted when,
for example, communicating with a PC's serial interface

Fig: 5.8 Pin Diagram of MAX232

5.7 ADC0808:

ADC0808 is an 8 bit analog to digital converter with eight input analog


channels, it can take eight different analog inputs. ADC0808 needs an external
clock to operate unlike ADC0804 which has an internal clock. The input which
is to be converted to digital form can be selected by using three address lines.
The voltage reference can be set using the Vref+ and Vref- pins.

29
The step size is decided based on set reference value. Step size is the
change in analog input to cause a unit change in the output of ADC. The default
step size is 19.53mV corresponding to 5V reference voltage. ADC0808 needs
an external clock to operate unlike ADC0804 which has an internal clock. The
ADC needs some specific control signals for its operations like start conversion
and bring data to output pins. When the conversion is complete the EOC pins
goes low to indicate the end of conversion and data ready to be picked up.

Fig: 5.9 Pin Diagram of ADC0808

5.8 LIQUID CRYSTAL DISPLAY:

LCD (liquid crystal display) is the technology used for displays in


notebook and other smaller computers. Like light-emitting diode (LED) and
gas-plasma technologies, Liquid crystal displays allow displays to be much
thinner than cathode ray tube (CRT) technology. Liquid crystal displays
consume much less power than Light emitting diodes and gas-display displays
because they work on the principle of blocking light rather than emitting it.

30
An LCD is made with either a passive matrix or an active matrix display
display grid. The active matrix LCD is also known as a thin film transistor
(TFT) display. The passive matrix LCD has a grid of conductors with pixels
located at each intersection in the grid. A current is sent across two conductors
on the grid to control the light for any pixel. An active matrix has a transistor
located at each pixel intersection, requiring less current to control the luminance
of a pixel. For this reason, the current in an active matrix display can be
switched on and off more frequently; improving the screen refresh time (your
mouse will appear to move more smoothly across the screen, for example).

Fig: 5.10 Diagram of LCD

Some passive matrix liquid crystal displays have dual scanning, meaning
that they scan the grid twice with current in the same time that it took for one
scan in the original technology. Liquid crystal displays doesn’t know about the
content (data or commands) supplied to its data bus. It is the user who has to
specify whether the content at its data pins are data or commands. However,
active matrix is still a superior technology.

31
5.9 BATTERY:

Nine volt battery is rectangular in shape having rounded borders with


connector on top. These batteries are used in smoke detectors, fire alarms, toys,
radios, electronic devices and clocks and many household items.

The battery has both terminals in a snap connector on one end. The
smaller circular (male) terminal is positive, and the larger hexagonal or
octagonal (female) terminal is the negative contact. The connectors on the
battery are the same as on the connector itself; the smaller one connects to the
larger one and vice versa.

The same snap-style connector is used on other battery types in the Power
Pack (PP) series. Battery polarization is normally obvious since mechanical
connection is usually only possible in one configuration. A problem with this
style of connector is that it is very easy to connect two batteries together in a
short circuit, which quickly discharges both batteries, generating heat and
possibly a fire.

Fig: 5.11 Nine volt Battery

32
5.10 POWER SUPPLY UNIT:

The +5 volt supply is useful for both analog and digital circuits. DTL,
TTL, and CMOS ICs will all operate nicely from a +5 volt supply. In addition,
the +5 volt supply is useful for circuits that use both analog and digital signals
in various ways.

More importantly for our purposes, the +5 volt supply will be used as the
primary reference for regulating all of the other power supplies that we will
build. We can do this very easily if we use operational amplifiers as the
controlling elements in the power supply circuits.

Fig: 5.12 Power Supply Unit

The power supply section is the important one. It should deliver constant
output regulated power supply for successfull working of the project. A 0-
12V/500 mA transformer is used for this purpose. The primary of this
transformer is connected in to main supply through on/off switch& fuse for
protecting from overload and short circuit protection.

33
5.11 CIRCUIT DIAGRAM:

Fig: 5.13 Circuit Diagram of Node 1

In node 1, we concentrate on fire detection and gas leakage. In node 1, it


consists of microcontroller (AT89S52), zig-bee, flame sensor (SR017), Gas
sensor (MQ6). Here information about the gas and fire is collected and the
signal information is transmitted to the monitoring center through zig-bee.

34
Fig : 5.14 Circuit Diagram of Node 2

Similarly at node 2, we concentrate on load cell to examine the capacity


of the building and vibration detection. Node 2 consists of microcontroller
(AT89S52), load cell (Forsentek 10kg), vibration sensor (LTC1050). Here
information about the vibrations and load capacity is collected and the signal
information is transmitted to the monitoring center through zig-bee.

35
CHAPTER 6

SOFTWARE

6.1 SOFTWARE DESCRIPTION:

In the software part, first comes the virtual basic 6.0. This is designed to
accommodate a steep learning curve. Programmers can create both simple and
complex GUI applications. Programming in VB is a combination of visually
arranging components or controls on a form, specifying attributes and actions
for those components, and writing additional lines of code for more
functionality. The software for this project is written in ‘C’ language and
compiled using Kiel μ vision 4 compiler. The finally obtained ‘.hex’ code is
burnt into the microcontroller using a suitable programmer. The program is easy
to understand

6.2 KEIL COMPILER:

The Atmel AT89C52 is an 8051-based fully Static 24MHz CMOS


controller with 32 I/O Lines, 3 Timers/Counters, 8 Interrupts/2 Priority Levels,
UART, Three-Level Program Memory Lock, 8K Bytes Flash Memory, 128
Bytes On-chip The Keil C51 C Compiler for the 8051 microcontroller is the
most popular 8051 C compiler in the world. It provides more features than any
other 8051 C compiler available today.

The C51 Compiler allows you to write 8051 microcontroller applications


in C that, once compiled, have the efficiency and speed of assembly language.

36
Keil development tools for the 8051 Microcontroller Architecture support
every level of software developer from the professional applications engineer to
the student just learning about embedded software development.

Common to all Keil software development tools, Keil's µVision IDE and
Debugger combines’ project management, make facilities, revision control,
source code editing, target program debugging, device simulation and Flash
programming in a single fully-integrated environment. With a simple and
logical Getting-Started process, the µVision development platform helps you to
quickly create embedded programs that work. The Editor and Debugger are
integrated in a single application that provides a seamless embedded project
development environment.

µVision is the Keil Integrated Development and Debugging Environment


that helps you quickly create, test and debug embedded applications for ARM7,
ARM9, Cortex-M3, C16x, ST10, XC16x, C251, and C51 embedded
microcontrollers.

The µVision Debugger supports simulation using only your PC or laptop,


and debugging using your target system and a debugger interface. µVision
includes all essential debugging capabilities, including simple and complex
breakpoints, watch windows, and execution control, together with industrial-
strength features that include Compilers are programs used to convert a High
Level Language to object code. Desktop compilers produce an output object
code for the underlying microprocessor, but not for other microprocessors. I.E
the programs written in one of the HLL like ‘C’ will compile the code to run on
the system for a particular processor like x86 (underlying microprocessor in the
computer).

37
Compiler translates C source files into locatable object modules which
contain full symbolic information for debugging with the µVision Debugger or
an in-circuit emulator. In addition to the object file, the compiler generates a
listing file which may optionally include symbol table and cross reference
information.

Features:

• Nine basic data types, including 32-bit IEEE floating-point,


• Interrupt functions may be written in C,
• Full use of the 8051 register banks,
• Complete symbol and type information for source-level debugging,
• Use of AJMP and ACALL instructions,
• Bit-addressable data objects,
• Built-in interface for the RTX51 Real-Time Kernel,
• Support for dual data pointers on Atmel, AMD, Cypress, Dallas
Semiconductor, Infineon, Philips, and Transcend microcontrollers,
• Support for the Philips 8xC750, 8xC751, and 8xC752 limited instruction
sets,
• Support for the Infineon 80C517 arithmetic unit.

6.3 VIRTUAL BASIC 6.0:

The Microsoft Visual Basic team still maintains compatibility for Visual
Basic 6.0 applications on Windows Vista, Windows Server 2008 including R2,
Windows 7, Windows 8, Windows 8.1, Windows Server 2012 and Windows 10
through its "It Just Works" program. In 2014, some software developers still
preferred Visual Basic 6.0 over its successor, Visual Basic .NET.

38
Visual Basic for Applications (VBA), is used as a macro or scripting
language within several Microsoft applications, including Microsoft Office.

Like the BASIC programming language, Visual Basic was designed to


accommodate a steep learning curve. Programmers can create both simple and
complex GUI applications. Programming in VB is a combination of visually
arranging components or controls on a form, specifying attributes and actions
for those components, and writing additional lines of code for more
functionality. Since VB defines default attributes and actions for the
components, a programmer can develop a simple program without writing much
code. Programs built with earlier versions suffered performance problems, but
faster computers and native code compilation has made this less of an issue.
Though VB programs can be compiled into native code executable from version
5 on, they still require the presence of around 1 MB of runtime libraries. Core
runtime libraries are included by default in Windows 2000 and later, but
extended runtime components still have to be installed. Earlier versions of
Windows (95/98/NT) require that the runtime libraries be distributed with the
executable.

39
CHAPTER 7

RESULT AND DISCUSSION

7.1 HARDWARE RESULT:

Fig: 7.1 Node 1(Transmitter) Fig: 7.2 Node 2(Transmitter)

Fig: 7.3 Node 3(Receiver)

40
7.2 SOFTWARE RESULT:

Fig: 7.4 Software result in virtual basic 6.0

41
CHAPTER 8

CONCLUSION

With the help of wireless sensor network, safety and continuous


monitoring of building is ensured. GSM assures the guarantee of continuous
delivery of information gathered at the sensor nodes to the monitoring center
and the delivery of message to the mobile numbers which is stored in GSM.
This project helps to quickly evacuate and safeguard the peoples in the building
during accidental situations.

42
CHAPTER 9

FUTURE SCOPE

In future, we can implement this same project with help of Internet of


Things (IOT) by making changes in the software part of this project, which will
be helpful for the user who present far away from the location in order to
monitor the building or house by making use of Internet facility.

43
REFERENCES

[1] G.Shanthi , M.Sundarambal , M. Dhivyaa, “Design and Implementation of


Monitoring and Control System Based on Wireless Sensor Network” ,January
2015.

[2] Tamzid-al-noor, MD. Farhad hossain, “Micrcontroller Based Automatic


Fire Control & Monitoring System”, Febraury 2014.

[3] Changhai Peng, Kun Qian, “Development and Application of a ZigBee-


Based Building Energy Monitoring and Control System”,2014

[4] Luay Fraiwan, Khaldon Lweesy, Aya Bani-Salma, Nour Mani, “A Wireless
Home Safety Gas Leakage Detection System”,2011

[5] Mahmadur Rahman,“Microcontroller based automatic fire control and


monitoring system”, Electrical engineering,2014

[6] P.N.Narendra Reddy, S.S.Manvi ,“Wireless sensor network based fire


monitoring and extinguishing system in real time environment”,Electronics and
communication engineering,2011

[7] Luay Fraiwan, Khaldon Lweesy, “A Wireless Home Safety Gas Leakage
Detection System”,2011

[8] M.Naveen, “Design and implementation of wireless network”, IIT


Kanpur,May 2007

[9] R.L. Bai. “The Analysis of Modern Building Fire Monitoring System,”
Automation Instrumentation, 2004

44
[10] Q.Q. Xiong, Y.Y. Deng. “The Status Analysis and Development Prospects
of Modern Wireless Communication Technology,” Science and Technology
Innovation Herald, 2012, 02: 31. (in Chinese)

[11] R.L. Bai. “The Analysis of Modern Building Fire Monitoring System,”
Automation Instrumentation, 1999, 09: 33-35. (in Chinese)

[12] Y.M. Liu. “The Impact and Control Measures of Fire Environmental,” Jilin
University, 2004.

[13] J.F. Wang. The Realization of ZigBee Wireless Sensor Networks [D].
University of Jinan, 2010.

[15] F.Viani, M. Salucci, F. Robol, et al. “Multiband fractal Zigbee/WLAN


antenna for ubiquitous wireless environments,” Journal of Electromagnetic
Waves and Applications, 2012, 2611-12.

[16] Y.G. Shao. “The Research of Bridge Wireless Monitoring System based on
Zigbee-WiFi Converter,” Xi'an University of Science and Technology, 2011.

[17] W.C. Zhang, X.W. Yu, Z.C. Li. “The Design of Wireless Sensor Network
Nodes based on CC2530 and ZigBee Protocol Stack.” Computer Systems &
Applications, 2011, 07: 184-187.

[18] X.Q. Li. “The Construction and Application of WiFi Network,” South
China University of Technology, 2012.

[19] T.B. Sun. “The Research of Wireless Sensor Network Localization


Algorithm,” Hefei: University of Science and Technology of China, 2008.

[20] Q.B. HE, F.Y. CHEN, S.M. CAI, et al. “An efficient range-free
localization algorithm for wireless sensor networks,” Science China
(Technological Sciences), 2011, 05: 1053-1060.

45
APPENDIX

PROGRAM:

If Val(Text5) > 60 Then


If oc1 = 0 Then
MSComm1.Output = "AT+CMGS=" + Chr(34) + Trim(Text8) + Chr(34) + vbCrLf
For l = 1 To 10000000
Next l
MSComm1.Output = "Gas Alert " + Text5 + Chr(26)
For l = 1 To 10000000
Next l
oc1 = 1
End If
Else
oc1 = 0
End If
If Val(Text4) = 1 Then
If oc2 = 0 Then
MSComm1.Output = "AT+CMGS=" + Chr(34) + Trim(Text8) + Chr(34) + vbCrLf
For l = 1 To 10000000
Next l
MSComm1.Output = "Fire Alert " + Text4 + Chr(26)
For l = 1 To 10000000
Next l
oc2 = 1
End If
Else
oc2 = 0

46
End If
If Val(Text7) = 1 Then
If oc3 = 0 Then
MSComm1.Output = "AT+CMGS=" + Chr(34) + Trim(Text8) + Chr(34) + vbCrLf
For l = 1 To 10000000
Next l
MSComm1.Output = "Vibration Alert " + Text7 + Chr(26)
For l = 1 To 10000000
Next l
oc3 = 1
End If
Else
oc3 = 0
End If
If Val(Text2) < 150 Then
If oc4 = 0 Then
MSComm1.Output = "AT+CMGS=" + Chr(34) + Trim(Text8) + Chr(34) + vbCrLf
For l = 1 To 10000000
Next l
MSComm1.Output = "Load Alert " + Text2 + Chr(26)
For l = 1 To 10000000
Next l
oc4 = 1
End If
Else
oc4 = 0
End If

47
CIRCUIT DIAGRAM
NODE 1:

48
NODE 2:

49
SENSORS PIN DIAGRAM DESCRIPTION

5V-5 Vdc supply Input


Out-Goes low when flame is detected
GND-Ground input
Flame indicator-Illuminates when
flame is sensed
Sensitivity Adjust- CW is more
FLAME sensitive,CCW is less sensitive
SENSOR IR Detector-Has a 60 degree view
angle and is sensitive to the
wavelengths typical of flames

The sensor needs to be put 2 voltages,


heater voltage (VH) and test voltage
(VC). VH used to supply certified
GAS
working temperature to the sensor,
SENSOR
while VC used to detect voltage (VRL)
on load resistance (RL) whom is in
series with sensor. The sensor has light
polarity, VC need DC power. VC and
VH could use same power circuit with
precondition to assure performance of
sensor. In order to make the sensor with
better performance, suitable RL value is
needed

50
The piezo speaker is connected to the
input of an op amp operated as a
comparator. This operation is achieved by
eliminating the usual feedback resistor
between the output (pin 6) and the
VIBRATION inverting input (pin 2). In operation, subtle
SENSOR vibrations cause the piezo element to
generate a small voltage. The LED glows
when the voltage exceeds that applied to
pin 3 of the op amp by sensitivity control
R2.

In bar strain gauge load cells, the cell is


set up in a “Z” formations so that torque is
applied to the bar and the four strain
gauges on the cell will measure the
bending distortion, two measuring
compression and two tension. When these
LOAD CELL four strain gauges are set up in a
wheatctone bridge formation, it is easy to
accurately measure the small changes in
resistance from the strain gauges.

51

You might also like