EDIT Soundharya Report PDF
EDIT Soundharya Report PDF
EDIT Soundharya Report PDF
A PROJECT REPORT
Submitted by
R.SOUNDHARYA (421113106185)
Of
BACHELOR OF ENGINEERING
IN
APRIL 2017
ANNA UNIVERSITY :: CHENNAI 600 025
BONAFIDE CERTIFICATE
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………….
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
LIST OF FIGURES
MICROCONTROLLER 15
ii
5.14 CIRCUIT DIAGRAM OF NODE 2 35
iii
LIST OF ABBREVIATIONS
IP - Internet Protocol
AC - Alternating Current
DC - Direct Current
PC - Personal Computer
iv
TABLES OF CONTENTS
ABSTRACT i
LIST OF FIGURES ii
LIST OF ABBREVIATIONS iv
1 INTRODUCTION 1
1.1 BACKGROUND 1
2 LITERATURE SURVEY 2
3 EXISTING METHODOLOGY 5
3.1 LIMITATIONS 5
4 PROPOSED SYSTEM 6
4.1 ADVANTAGES 6
4.3 APPLICATIONS 9
5 HARDWARE DESCRIPTION 10
5.1 MICRCONTROLLER 10
microcontroller 14
5.2.2 Block diagram of AT89S52 15
5.3 ZIG-BEE 21
5.4 SENSORS 22
5.6 MAX232 29
5.7 ADC0808 29
5.9 BATTERY 32
6 SOFTWARE 36
8 CONCLUSION 42
9 FUTURE SCOPE 43
REFERENCES 44
APPENDIX 46
CHAPTER 1
INTRODUCTION
1.1 BACKGROUND:
1
CHAPTER 2
LITERATURE SURVEY
LITERATURE SURVEY:
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.
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.
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.
4
CHAPTER 3
EXISTING METHODOLOGY
3.1 LIMITATIONS:
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,
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:
Node 1(Transmitter):
Flame sensor
Zig-bee
7
Node 2(Transmitter):
Load cell
Vibration Microcontroller
sensor (AT89S52)
Zig-bee
Node 3(Receiver):
Monitoring
system (PC)
Zig-bee GSM
Mobile
phone
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:
9
CHAPTER 5
HARDWARE DESCRIPTION
5.1 MICROCONTROLLER:
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.
11
5.2 AT89S52 MICROCONTROLLER:
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.
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:
• Watchdog Timer
• Power-off Flag
14
5.2.2 BLOCK DIAGRAM OF AT89S52:
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.
16
5.2.4 PIN DESCRIPTION:
VCC:
Supply voltage
GND:
Ground
Port 0:
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
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.
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.
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:
EA/VPP:
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:
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):
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.
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.
If the module does not vibrate, the vibration switch was closed on state,
output of low output, and the green indicator light.
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.
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.
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.
27
Fig: 5.7 GSM Module
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.
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.
5.7 ADC0808:
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.
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).
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:
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.
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.
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:
34
Fig : 5.14 Circuit Diagram of Node 2
35
CHAPTER 6
SOFTWARE
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
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.
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:
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.
39
CHAPTER 7
40
7.2 SOFTWARE RESULT:
41
CHAPTER 8
CONCLUSION
42
CHAPTER 9
FUTURE SCOPE
43
REFERENCES
[4] Luay Fraiwan, Khaldon Lweesy, Aya Bani-Salma, Nour Mani, “A Wireless
Home Safety Gas Leakage Detection System”,2011
[7] Luay Fraiwan, Khaldon Lweesy, “A Wireless Home Safety Gas Leakage
Detection System”,2011
[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.
[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.
[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:
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
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.
51