Mini Project 1 1
Mini Project 1 1
SPRINKLER SYSTEM
2016
HARAMAYA UNIVERSTITY
INSTITUTE OF TECHNOLOGY
SEMESTER PROJECT
TITLE
BY
NAME ID.NO
1
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
1. Abstract
The aim of this project is to design an advanced fire accident detection system by using the fire
sensor (smoke and temperature sensor), the analog input of the two sensors is converted in to
digital form by the ADC (analog to digital converter) which is built inside the micro controller
such that it will reduce the size and the cost. As the micro controller process the system and it
performs three main activities as output.
The first one is the micro controller takes the control action by switching on or off the water
sprinkler. That means it automatically extinguishes the water on the fire in such a way that the
motor driver which is interfaced to the micro controller, drives the motor and water sprinkler
mechanism is connected to the shaft of the dc motor, which will sprinkle the water when the fire
is detected by the sensors.
The second output is it will send an SMS message to the specified phone number using via GSM
network that uses AT commands.
The third output is it will generate sound while the fire accident is occurred. In general this
project deals with the design and development of fire detection, smoke and temperature
monitoring, alerting system and automatic extinguishing system for area where fire accident is
occurred to warn and initiate measures for accidental fires. The GSM modem provides the
information in case a fire occurs. This is a reliable and efficient system for fire alert and
intimation to the responsible person for a fire through GSM mobile communication. Finally the
proposed system is simulated using proteus software for hardware design and by loading the
programming code which generates hex file, on the micro controller and it provides the required
outputs.
2
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Acknowledgement
First of all, we would like to express our gratitude to Haramaya University, Haramaya Institute
of Technology and Department of Electrical and Computer Engineering for giving this
opportunity to do our mini project on design and analysis of intelligent fire detector with
automatic water sprinkler system. We have a grateful thanks to our project advisor N.Sunanda
(M.Sc.) for her guidance and constructive suggestions that has been helpful to us in the
preparation of this project. Our special thanks goes to our stream chairman Mr. Dejene
Birille(M.Sc.) for his continuous motivation and support in the entire process of the project.
3
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Table of Contents
Abstract............................................................................................................................................i
Acknowledgement..........................................................................................................................ii
List of figures................................................................................................................................vii
List of tables....................................................................................................................................ix
Acronyms.........................................................................................................................................x
Chapter One.....................................................................................................................................1
1 Introduction...................................................................................................................................1
1.1 Backgroun......................................................................................................................1
1.3 Objectives......................................................................................................................2
1.5 Methodology..................................................................................................................3
Chapter Two.....................................................................................................................................6
2 Literature Review..........................................................................................................................6
Chapter Three...................................................................................................................................8
4
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
3.3.4 Sprinklemechanism........................................................................16
Chapter Four.................................................................................................................................19
4.1.9 MAX232.........................................................................................................33
4.1.10 Resistors........................................................................................................36
5
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
4.1.11 Capacitors....................................................................................................36
4.1.12 Crystal.........................................................................................................36
4.2.2 MikroC.............................................................................................................37
4. 3 Nonfunctional requirements....................................................................................................38
Chapter Five...................................................................................................................................47
5.1 Conclusions.......................................................................................................47
References......................................................................................................................................48
Appendices.....................................................................................................................................49
6
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
7
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
List of figures
8
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
9
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
List of tables
10
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Acronyms
AT: Attention
PRO: Professional
11
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
CHAPTER ONE
1. Introduction
1.1 Background:
With the advancement of human civilization, fire-safely has been a prime concern. Fire hazards
can be fatal for industrial and household security, also lose of human life. The best way to reduce
these losses is to respond to the emergency situation as quick as possible. So, there comes the
necessity of standalone autonomous fire detection systems. These systems render the works of
quick detection, alarm notification, and also initiation of fire extinguishing. The systems,
equipped with smoke and temperature can detect unfavorable accidental situations, as it happens,
and with help of a processing unit can alert instantly for undertaking cautious measures. In these
fatal situations, early detection and faster alert will yield lesser losses of property and life.
Therefore in order to overcome such a problem an embedded based project is needed. An
embedded based project consists of micro controller or any processor, input section and output
section. In this project, in the input section, it contains peripherals which are sensors and the
output section consists of LCD, motor, buzzers and GSM modem. Micro controller is the heart of
the present work. In this project, PIC16F877 is used. It controls the overall system interface
between input and output sections. The input section is having sensors which are temperature
sensor and smoke sensor. In this, sensors are used as input section for the micro controller i. e,
temperature sensors (LM35) and smoke sensor (MQ-2). Smoke sensor senses the smoke and the
temperature sensor detects the temperature or fire. Power supply is also used which generates
+5V to apply to the components. In order to provide +5V, it consists of bridge rectifier and
regulator. The bridge rectifier has more efficiency and high stability than full wave rectifier. So it
is used to operate the micro controller. And the output section, it is having LCD, motor, buzzer,
and GSM. LCD is used to display the smoke and the temperature level. A simple buzzer is an
audio signaling device used to alert the people in the environment. It produces sound when the
temperature and smoke level is high. GSM is used to send the appropriate alert message to owner
or to the person responsible for the safety.
12
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Most of the time fire accidents can take place increasingly in day to day activity more in areas
like industries, houses, shopping malls, hospitals etc.
Fire accident is occurred by the cause of different faults and it lead to the loss of money, even
human life. Fire hazards occurred throughout the world, especially in the developing countries
like in our country Ethiopia where the fire-safety measures are precarious and often inadequate.
Therefore in order to solve this problem an advanced fire detector and water sprinkler system is
designed by detecting the fire accident using sensors and it automatically extinguishes the water
on surface area of the fire.
1.3 Objectives
The objective of the project is categorized as a general objective and specific objectives which is
illustrated below.
To design and develop an intelligent fire detector and automatic water sprinkler system
13
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
This project is designed and developed for those areas like industries, houses, shopping malls,
hospitals with the following most interesting features:
1.5 METHODOLOGY
Since fire accident is occurred frequently and we are facing to this problem, we have decided to
design and develop a system which detects the fire and automatically extinguishes the water. The
proteus simulation was then developed with c code to show how the overall system works.
Therefore, in order to develop this overall system we have used a scientific approach
methodology. The methodology that we have used in our project design is RAD (Rapid
Application Development) model.
14
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Requirements
planning
Cut over
I. Requirement planning: During this phase all the group members, advisor and the
computer engineering stream chairman agree on the project‟s general goals and
15
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
requirements. More illustration project goal is on the objective part of this chapter and
hardware and software requirement are on chapter four.
II. User design: This phase is used to convert the requirements into a workable design. In
user design phase based on the requirements defined in the above phase we design
phase we design the hard ware with a block diagram as well as a flow chart.
II Construction: The developers go to work building the application. The advisor continues
to review our design as we build them to make corrections and suggestions for
improvements. Using the designed block diagram we construct the circuit diagram and we
write the embedded c code on micro c software. Based on the constructed circuit diagram and
the c code that we have written, by loading on the micro controller and it provides the desired
outputs which is elaborated on chapter three and four.
IV. Cutover: The developers deliver the finished application to the users. In this phase our
projects is limited to this phase that means since we don‟t do the prototype we does not deliver to
the users.
This report is explains about an intelligent fire detector with automatic water extinguishing
system by divide it into four main parts. Such that the first part is explains introduction, which is
discussed in chapter one, the second part of this report briefly explains the literature review,
which is in chapter two, the third part of this report explains system block diagram of the project
with the corresponding circuit diagrams and system design and implementation with simulation
results, which is in chapter three and four respectively, and finally the last part explains
conclusions of this system and some future works which will be added for our final project.
16
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
CHAPTER TWO
This section provides a previous study of related work regarding the application of SMS services
in a various fields. Some previous researches have been studied to gain more information about
current existing GSM control system that was previously implemented. It is necessary to know
and understand how the software and hardware were used in that currently being conducted
contribute at certain level of application thus it become more efficient and practical.
Mnny linhares, in (2010) uses GSM network for his study “Auto Dialer Wireless Smoke
Detector/ Alarm System” which is developed to detect the fire accident using smoke detector.
Most of the existing homes are still fitted with the normal smoke detectors either running out of
the 120V ac wiring or out of a 9V dc battery. These are perfectly fine to alert residents if there is
a fire while they are home.
But for people who are away from home when a fire occurs, it would be nice if they could be
alerted automatically of such an occurrence and therefore be able to act upon the event by either
calling the fire department, police or a neighbor to check on their house. With this in mind, the
idea to build a smoke detector/ alarm system that could alert a home owner while he is away
from home came about.
This system is a wireless smoke detector/ alarm system that will make an automatic phone call
via POTS if an alarm is triggered by smoke from a fire.
Upon smoke detection, the alarm will communicate the event to an access point wirelessly which
in turn will trigger an auto dialer with preprogrammed phone numbers and a message to
automatically call each of the numbers and relay the preprogrammed phone message.
17
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
In this work a review of existing fire-detector types has been carried out along with the
development of a low cost, portable, and reliable micro controller based automated fire alarm
system for remotely alerting any fire incidents in household or industrial premises. The aim of
the system designed is to alert the distant property-owner efficiently and quickly by sending
short message (SMS) via GSM network. A Linear integrated temperature beyond preset value
whereas semiconductor type sensor detects presence of smoke or gas from fire hazards. The
sensor units are connected via common data line to ATMega8L AVR micro controller.
ASIM300CZ GSM kit based network module, capable of operating in standard GSM bands, has
been used to send alert messages.
18
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
CHAPTER THREE
This chapter focuses on the system design and implementation of our project. The user design
and construction phase of our design methodology are elaborated in here, which includes block
diagrams and circuit diagrams to each block diagrams are illustrated in this section.
Nowadays, lots of embedded system application are developed by adding many features and
technologies so as to minimize size and cost, and to maximize system reliability. An intelligent
fire detector with automatic water sprinkler system is one of these technologies. This technology
is designed according to the concept of embedded system that integrated sensors to receive data
from the environment, microcontroller for data processing, LCD display to monitor the status of
the sensors, DC motor with sprinkler to extinguish the water on the fire and the GSM modem to
send an SMS to the owner.
19
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Input section: The input section is having sensors which are temperature sensor and
smoke sensor. In this, sensors are used as input section for the micro controller i.e.,
temperature sensor (LM35) and smoke sensor (MQ-2). Smoke sensor senses the smoke
and the temperature sensor detects the temperature or fire.
System control section: The micro controller controls the whole system. Process input
data from sensor unit and provide output to the display.
Output section: For the output section, it is having LCD, motor, buzzer, and GSM. LCD
is used to display the smoke and the temperature level. A simple buzzer is an audio
signaling device used to alert the people in the environment. It produces sound when the
temperature and smoke level is high. GSM is used to send the appropriate alert message
to owner or the person responsible for the fire safety. The general block diagram of the
system is given below
POWER LSD
SUPPLY DISPIAY
MOTOR
SMOKE
DRIVER
SENSOR
MICRO
CONTROLLER
TEMPERATURE
SENSOR DC SPRINKLER
MOTOR
GSM
MODULE
BUZZER
20
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
An intelligent fire detector with automatic water sprinkler system basically consists of the
following main blocks:
3.3.1 Power supply: This is the power supply unit we have used for the generation of +5V input
for all components.
230V/220
AC
21
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Description: In above circuit we have used a regulated power supply, a step-down transformer
TR2 is used which gives +5V AC from 230V AC. Four B 250C100 diodes are used which forms
a bridge. Three capacitors C1 of 470Nf,C2 of 0.018uf and C3 of 0.018Uf are used for filter
purpose. The regulated IC 7805 is used for voltage regulation purpose.
Working principle: a bridge rectifier which is made up of from four diodes rectifies the input
5volt from the step down transformer. This rectified output is given to C1 and C3 capacitors for
filtering purpose. The output from C3 is given to pin no.1 of7805 IC. The 7805 is regulated IC
which regulates the voltage from C3 capacitor. +5V DC output is taken from pin no.3 of 7805
IC. The ground is taken from pin no.2 of 7805 IC.
3.3.2 Status Monitoring: The temperature sensor LM35 is used for sensing the temperature.
LM35 is connected to the microcontroller which also acts as input. It produces signal which is
analog in nature but the microcontroller accepts the signals which are digital form. So ADC is
used to convert the signal from the temperature sensor into digital form. The smoke sensor is
used for detecting the smoke. The smoke sensor is also connected to the microcontroller act as
input to the microcontroller. It produces zero output when there is no smoke and when there is
smoke it produces an output signals according to intensity of smoke which is transmitted to the
22
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
microcontroller. The smoke sensor consists of heater internally which ionizes the smoke
particles, they will act as charge carries so a voltage will built up at output.
POWER
SUPPLY
LCD
P
DISPLAY
I
TEMPERATURE
C
SENSOR
1
8
SMOKE
7
SENSOR
7
23
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Description of Block Diagram: First the microcontroller, LCD and ADC are initialized by
using the commands which are given in the program. Then the input signals from smoke sensor
and temperature sensor are read. Next the A/D conversion takes place and the value is displayed
on the LCD.
24
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
The modem will communicate with microcontroller using serial communication. The modem is
interfaced to microcontroller using MAX 232, a serial driver. The microcontroller can
communicate with the serial devices using its single Serial Port. The logic levels at which this
serial port operates is TTL logics. But some of the serial devices operate at RS 232 Logic levels.
In order to avoid this mismatch, in other words to match the Logic levels, a Serial driver is used.
And MAX 232 is a Serial Line Driver used to establish communication between microcontroller
and GSM modem.
P
POWER
I MAX232
SUPPLY
C
8
GSM
7
MODEM
CLOCK 7
25
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
GSM modem interfacing with microcontroller for SMS control of for this application. The
SIM300 GSM module is a special type of modem which accepts a SIM card and operates like a
mobile phone subscribed to a cell phone operator.
Text message will be sent through the modem by interfacing only three signals of the serial
interface of modem with microcontroller i.e., TxD, RxD and GND.
26
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
The following block diagram mainly shows how to interface a dc motor with the microcontroller
for water extinguishing mechanism. Since we can‟t drive a DC Motor directly with a
Microcontroller, as DC Motors requires high current and high voltage than a Microcontroller can
handle. Microcontrollers usually operates at +5 or +3.3V supply and it I/O pin can provide only
up to 25mA current. Commonly used DC Motors requires 12V supply and 300mA current,
moreover interfacing DC Motors directly with Microcontrollers may affect the working of
Microcontroller due to the Back EMF of the DC Motor. Thus it is clear that, it not a good idea to
interface DC Motor directly with Microcontrollers. Therefore as the sprinkler is interfaced at the
shaft of the dc motor, while the motor rotates at will sprinkle the water.
Power I Motor
Supply C Driver
8 DC
Clock
7 Sprinkler
Motor
7
27
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Description:
The input signals from smoke sensor and temperature sensor are read as shown from figure 15.
Next the ADC conversion takes place. Then compare this value with the threshold value. If the
value is greater than the threshold value the motor is ON and when it rotates water will be
sprinkle on the fire. If it is less than the threshold value, since it is a normal condition the motor
does not rotate.
28
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
A simple buzzer is an audio signaling device used to alert the people in the environment. It
produces sound when the temperature and smoke level is high. And also a driving transistor is
used for driving the buzzer.
Power
Supply PIC16F877
Driving Buzzer
Transistor
Clock
Description:
As shown from the circuit above the driving transistor is used to drive the sounder. This an
audio signaling device used to alert the people in the environment as described earlier.
29
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
CHAPTER FOUR
This chapter describes for the phase two and three of the methodology that we use and it
includes the hardware requirements, software requirements, nonfunctional requirements,
algorithm of the project and flowchart which are very necessary issues for our project design
with simulation results.
A power supply is an electronic device that supplies electric power to an electrical load. The
primary function of a power supply is to convert one form of electrical energy to another and, as
a result, power supplies are sometimes referred to as electric power converters. In the AC/DC
power conversion a rectifier is used to convert the transformer output voltage (AC) to a varying
DC voltage, which in turn is passed through an electronic filter to convert it to an unregulated
DC voltage. The filter removes most, but not all of the AC voltage variations; the remaining
voltage variations are known as ripple to get +5V DC input for the Microcontroller.
30
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Pic16f877 is one of the most advanced microcontrollers from microchip. This controller is
widely used for experimental and modern applications because of its low price, wide range of
applications, high quality, and ease of availability. It is ideal for applications such as machine
control applications, measurement devices, study purpose, and so on. The PIC 16F877 features
all the components which modern microcontrollers normally have. [1]
Features of PIC16f877
Maximum operating frequency is 20MHz
Flash program memory (14 bit words), 8KB
Data memory (bytes) is 368
EEPROM data memory (bytes) is 256
5 input/output ports
3 timers
2 CCP modules
31
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Special features
Hundred thousand times erase/write cycle enhanced memory
Self-programmable under software control
In-circuit serial programming and in-circuit debugging capability
Single 5v, DC supply for circuit serial programming
Programmable code protection
Power saving sleep modes
Selectable oscillator option [7
Pic16f877pindiagram
U1
13 33
OSC1/CLKIN RB0/INT
14 34
OSC2/CLKOUT RB1
1 35
MCLR/Vpp/THV RB2
36
RB3/PGM
2 37
RA0/AN0 RB4
3 38
RA1/AN1 RB5
4 39
RA2/AN2/VREF- RB6/PGC
5 40
RA3/AN3/VREF+ RB7/PGD
6
RA4/T0CKI
7 15
RA5/AN4/SS RC0/T1OSO/T1CKI
16
RC1/T1OSI/CCP2
8 17
RE0/AN5/RD RC2/CCP1
9 18
RE1/AN6/WR RC3/SCK/SCL
10 23
RE2/AN7/CS RC4/SDI/SDA
24
RC5/SDO
25
RC6/TX/CK
26
RC7/RX/DT
19
RD0/PSP0
20
RD1/PSP1
21
RD2/PSP2
22
RD3/PSP3
27
RD4/PSP4
28
RD5/PSP5
29
RD6/PSP6
30
RD7/PSP7
PIC16F877
32
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Input/output ports
PIC 16F877 has 5 basic input/output ports. They are usually denoted by PORT A, PORT B,
PORT C, PORT D, and PORT E. these ports are used for input/output interfacing.
33
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
The LM35 temperature sensor is an integrated circuit sensor. Here the output voltage is linearly
proportional to temperature in centigrade, making the sensor perfectly suitable for our purpose.
The sensor is precise up to ±1/4˚C at room temperature with operation range from −55˚C to
150˚C, and is very low self-heating as it draws very small amount of current. The output of
LM35 module is also an analog voltage. The reference voltage of the comparator is adjusted to
500 mV using a variable resistor. The LM35 increases its output by 10 mV/˚C at the non-
inverting pin of the opamp. So when the temperature is greater than the pre-set temperature
(50˚C), the module will make its output high.
1 U1
27.0
2
VOUT
3 LM35
Features
Calibrated directly in Celsius(centigrade)
Linear +10-mv/0c scale factor
0.5°C Ensured Accuracy (at 25°C)
Rated for Full −55°C to 150°C Range
Suitable for Remote Applications
Low-Cost Due to Wafer-Level Trimming
Operates from 4 V to 30 V
Less than 60-μA Current Drain
Low Self-Heating, 0.08°C in Still Air
34
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
A smoke sensor is a device that senses smoke, typically as an indicator of fire. MQ2 is a
semiconductor type sensor, which can aptly sense presence of smoke, LPG, methane, butane,
propane and other hydrocarbon combustible gases. [6]
Specifications:
Dimension: 32mm x 22mm x 30mm Specification:
Operating voltage: 5v
Sensitivity: R in air/ R in typical gas > 5
Response Time: <10s
Recovery time: <30s
35
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
1) VCC
2) D0 Pin
3) A0 Pin
4) Ground
Working principle
These work by the principle of chemical reaction taking place between gas from fire
incident and semiconductor material present inside the sensor. The semiconductor
36
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
material used in these sensors is metal oxides, generally Tin dioxide (SnO2), Tungsten
oxide (WO3), etc. Under normal circumstances, the surface potential acts as a potential
barrier to restrict electron flow within the sensor circuitry. However, the deoxidizing
gases from fire incidents diminish the oxygen surface density, and thereby reduce barrier
potential to permit electron flow. The associated electrical circuitry detects the rise in
conductivity due to electron flow, and activates alarm to undertake necessary measures.
These semiconductor sensors have wide range of applications for their advantageous features.
They are small, compact, inexpensive, easy to install and maintain. These metal oxide type
detectors are used to detect fire incidents involving combustible gas, LP gas, methane, propane,
alcohol, carbon monoxide etc. for their reliability. These features make this detector best suited
for our purpose and hence we choose for it in our system.
For quick and efficient fire detection, two sensor units (MQ2 smoke/gas and LM35 temperature
detector) have been used for our system design.
A 16x2 LCD display is very basic module and is very commonly used in various devices and
circuits. These modules are preferred over seven segments and other multi segment LEDs. The
reasons being: LCDs are economical; easily programmable; have no limitation of displaying
special & even custom characters (unlike in seven segments), animations and so on. A 16x2
LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each
character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and
Data. The command register stores the command instructions given to the LCD. A command is
an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting
the cursor position, controlling display etc. The data register stores the data to be displayed on
the LCD. The data is the ASCII value of the character to be displayed on the LCD.
Features
LCD can add a lot to your application in terms of providing a useful interface for the user,
debugging an application. LCD has single line display, two-line display, and four line display.
37
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
38
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Pin
No Function Name
4 Selects command register when low; and data register when high Register
select
5 Low to write to the register; High to read from the register Read/Write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
12 DB5
13 DB6
14 DB7
39
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
A GSM modem is a specialized type of modem which accepts a SIM card, and operates over a
subscription to a mobile operator, just like a mobile phone. From the mobile operator
perspective, a GSM modem looks just like a mobile phone. [6], [7] GSM module requires a
Subscriber Identification Module (SIM) card from a wireless carrier to operate. To control the
module and process short messages AT commands are required, which are defined in the GSM
standard. The modem is coming with selectable interfacing voltage, which allows connecting 5V
and 3V3 microcontroller without any level conversion chips. Global system for mobile
communication (GSM) is also a wide area wireless communications system that uses digital
radio transmission to provide voice, data, and multimedia communication services. A GSM
system coordinates the communication between a mobile telephones (mobile stations), base
stations (cell sites), and switching systems. Each GSM radio channel is 200 kHz wide channels
that are further divided into frames that hold 8 time slots. GSM was originally named Group
Special Mobile. The GSM system includes mobile telephones (mobile stations), radio towers
(base stations), and interconnecting switching systems.
40
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
TXD Transmit Outputs data bytes at voltage level same as the V-interface
pin –usually connected to the Rx pin of the microcontroller.
RXD Receive Receive data bytes at voltage level same as the V-interface
pin, usually connected to the TX pin of the microcontroller.
41
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Motors convert electrical energy (from a battery or voltage source) into mechanical energy (used
to cause rotation). DC motor is an electrical motor that runs on direct current (DC) electricity.
Brushless DC electric motor also known as electronically commutated motors are synchronous
motors that are powered by a DC electric source via an integrated inverter/switching power
supply, which produces an AC electric signal to drive the motor. In this context, AC, alternating
current, does not imply a sinusoidal waveform, but rather a bidirectional current with no
restriction on waveform. Additional sensors and electronics control the inverter output amplitude
and waveform and frequency.
We can‟t drive a DC Motor directly with a Microcontroller, as DC Motors requires high current
and high voltage than a Microcontroller can handle. Microcontrollers usually operates at +5 or
+3.3V supply and it I/O pin can provide only up to 25mA current. Commonly used DC Motors
requires 12V supply and 300mA current moreover interfacing DC Motors directly with
Microcontrollers may affect the working of Microcontroller due to the Back EMF of the DC
Motor. Thus it is clear that, it not a good idea to interface DC Motor directly with
Microcontrollers.
42
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current
amplifiers since they take a low-current control signal and provide a higher-current signal. This
higher current signal is used to drive the motors. [2]
43
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
4.1.9 MAX232
MAX232 IC is used to convert the TTL/CMOS logic levels to RS-232 logic levels during serial
communication of microcontrollers with PC. The controller operate at TTL logic level (0 – 5V)
whereas the serial communication in PC works on RS2-32 standards (-25V to +25V). This
makes link between them to communicate with each other. The intermediate link is provided
through MAX232. It is a dual driver/receiver that includes a capacitive voltage generator to
supply RS-232 voltage levels from a single 5V supply. Each receiver converts RS-232 inputs to
5V TTL/CMOS levels. The drivers (T1 and T2), also called transmitter, convert the TTL/CMOS
input level into RS-232 level.
44
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
The transmitters take input from controller‟s serial transmission pin, TX, and send the output to
RS2332‟s receiver pin, RXD. The receiver, on the other hand, take input from transmit pin,
45
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
TXD, of RS-232 serial port and give serial output to the microcontroller‟s receiver pin, RX.
MAX232 need four external capacitors whose value ranges from 1µF to 22µF
7 T2 Out Output pin; output the serially transmitted data at RS-232 logic level;
connected to receiver pin of PC serial port
8 R2 In Input pin; receive serially transmitted data at RS-232 logic level; connected
to transmitter pin of PC serial port
9 R2 Out Output pin; output the serially data at TTL logic level; connected to receiver
pin of controller
10 T2 In Input pin; receive the serially data at TTL logic level; connected to serial
transmitter pin of controller
11 T1 In Input pin; receive the serially data at TTL logic level; connected to serial
transmitter pin of controller
46
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
12 RI Out Output pin; output the serially transmitted data at TTL logic level; connected
to transmitter pin of controller
13 R1 In Input pin; receive serially transmitted data at RS-232 logic level; connected
to transmitter pin of PC serial port
14 T1 Out Output pin; output the serially transmitted data at RS-232 logic level;
connected to receiver pin of PC serial port
4.1.10 Resistors
Resistor is a passive component that resists the flow of direct or alternating electric circuit. The
resistance of the resistor can be estimated by their color codes. There are some nonlinear
resistors whose resistance changes with temperature or light.
4.1.11 Capacitors
A capacitor is a passive two terminal electrical component used to store energy electrostatically
in an electric field. Contain at least two electrical conductors (plates) separated by a dielectric
(insulator). Capacitors are used for smoothing power supply variations, coupling the various
stages of audio system, tuning in radio circuits, and store energy like in camera flash.
4.1.12 Crystal
Even though microcontroller has built in oscillator, it cannot operate without external
components which stabilize its operation and determine its frequency (operating speed of the
microcontroller). Depending on which elements are used as well as their frequencies, there are
four different oscillator modes: LP, Low Power Crystal, XT, Crystal/Resonator, HS, High
speed/Resonator and RC, Resistor/Capacitor. Crystals provides high initial accuracy and a
moderately low temperature coefficient. Operation is guaranteed over a range of conditions.
47
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Crystal oscillator modules and fully integrated silicon oscillators are most common. Crystal
oscillator modules provide accuracy similar to discrete component circuits using crystals. Silicon
oscillators are more precise than discrete component RC oscillator circuits, and many provide
comparable accuracy to ceramic resonator-based oscillators.
4.2 Software Requirements and description
Software development tools used
Proteus, ISIS Professional version 8
MiKroC PRO for PIC
4.2.1 Proteus design suit version 8.0
For real design and simulation proteus is used. Proteus is a Virtual System Modeling (VSM)
that combines circuit simulation, animated components and microprocessor models to co-
simulate the complete microcontroller based designs. This is the perfect tool for engineers to test
their microcontroller designs before constructing a physical prototype in real time.
Features:
A new application framework lets you view modules of Proteus as tabs in a single window or,
via drag and drop, as separate windows for a side-by-side view
A new common parts database enables sharing of information between schematic and PCB so
that changes to data are instantly reflected across the software.
A new live net list means changes to connectivity in the schematic can be instantly reflected in
the PCB, the Bill of Materials and the Design Explorer.
The new integrated VSM Studio IDE binds your firmware project to your schematic design
and Active Popups bring the schematic into your VSM Studio debug session.
4.2.2 MikroC
The MikroC PRO for PIC is a powerful, feature-rich development tool for PIC microcontrollers.
It is designed to provide the programmer with the easiest possible solution to developing
applications for embedded systems, without compromising performance or control. The software
is written in „C‟ language and compiled using micro „C‟ compiler. The source program is
converted into hex code by the compiler. PIC and C fit together well: PIC is the most popular 8-
48
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
bit chip in the world, used in a wide variety of applications, and C, prized for its efficiency, is the
natural choice for developing embedded systems.
Features:
Write your C source code using the built-in Code Editor (Code and Parameter assistants, Code
Folding, Syntax Highlighting, Auto Correct, Code Templates, band more.)
Monitor your program structure, variables, and functions in the Code Explorer.
Generate commented, human-readable assembly, and standard HEX compatible with all
programmers.
Use the integrated mikroICD (In-Circuit Debugger) Real-Time debugging tool to flow graph
for the Overall working principles of the motor driving Software monitor program execution on
the hardware level.
Inspect program flow and debug executable logic with the integrated Software simulator.
Get detailed reports and graphs: RAM and ROM map, code statistics, assembly listing, calling
tree, and more.
MicroC PRO for PIC provides plenty of examples to expand, develop, and use as building
bricks in your projects.
4.2.3 Programing language: C Language:
C has now become a widely used professional language for various reason:
It has high level constructs
It has handle low level activities
It produces efficient programs
Nonfunctional requirements are statements about the quality of the application‟s behavior or
constraints on how it produces a desired result. They specify things such as the application‟s
performance, reliability, and security characteristics. [9] Features of the project:
Automatic fire accident detection system
An automatic water sprinkler system that able to sprinkling the water on the fire
Sending an SMS message while a fire accident is occurred using GSM technology to the
owner phone number
49
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
50
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Start
End
51
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
In this chapter, based on the circuit diagrams that we construct on chapter three we have
achieved the following desired results. And this chapter is also included under the construction
phase of our design methodology.
This is the power supply unit we have used for the generation of +5v input for all components.
Description
In above circuit we have used a regulated power supply, a Step-down transformer TR2 is used
which gives 5 volt ac from 230V ac. Four IN 4007 diodes are used which forms a bridge. Three
capacitors C1 of 470µf, C2 of 0.01nf and C3 of 0.01nf are used for filter purpose. The regulated
IC 7805 is used for voltage regulating purpose.
Working principle:
A bridge rectifier which is made up of from four diodes rectifies the input 5 volt from the step
down transformer. This rectified output is given to C1 & C3 capacitors for filtering purpose. The
52
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
output from C3 is given to pin no.1 of 7805 IC. The 7805 is regulated IC which regulates the
voltage from C3 capacitor. +5V DC output is taken from pin no 3 of 7805 IC. The ground is
taken from pin no 2 of 7805 IC.
Normal condition: when the temperature and smoke level is less than the threshold value it is
at normal condition that means no fire is occurred. And the code is shown in Appendix D.
Warning display section: the LCD display displays a warning message if the level of the
sensors is approaching to the preset/threshold value.
53
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
The microcontroller takes the controlling unit, the data that read from the sensors compared it to
the threshold value and if this value is higher than the threshold value SMS has to be sent to the
authorized person via GSM network for mobile communication. As you see from the figure
below the sent message is displayed on the virtual terminal which is illustrated below. AT: mean
that attention which is initialization for GSM modem AT+CMGF=1: message format is in text
mode AT+CMGS= “+251918648719”: message sending e.g. this phone number Fire is detected:
text to be sent The code that we have written is shown on appendix B.
54
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
In this section the system automatically extinguishes the water, which means a sprinkler
mechanism is interfaced with the shaft of the DC motor, as the motor rotates it sprinkles the
water on the fire. And the code is shown on appendix C.
55
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
In this section as the two sensor values greater than the threshold value the controller take three
basic actions. It automatically extinguishes the water (in this case a sprinkler mechanism is
interfaced with the shaft of the DC motor, as the motor rotates it sprinkles the water on the fire)
It sends SMS message to the owner (the message that has to be sent is displayed on the virtual
terminal with the specified phone number)
56
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
It generates sound alarm using sounder LCD displays as “fire is detected” and also it
monitors the sensor values as shown below from the figure.
57
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
CHAPTER FIVE
This paper deals with the design and development of fire detection, smoke and temperature
monitoring, alerting system and automatic extinguishing system for area where fire accident is
occurred to warn and initiate measures for accidental fires. The GSM modem provides the
information in case a fire occurs. This is a reliable and efficient system for fire alert and
intimation to the responsible person for a fire through GSM mobile communication. Using this
system, quick and reliable alert response is possible and it takes preventive measures
automatically to prevent danger of fire hazards and minimize losses of life and property.
As fire accident is a serious problem in our country Ethiopia this system has to be implemented
in order to eliminate loss of money and some others. Even though this proposed system has
many features further the system can also be developed for theft detection in addition to that of
fire detection. And we will include and elaborate it how the system work for theft detection for
our final year project.
58
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
References
[1]Introduction to Pic16f877(http://www.circuitstoday.com/introduction-to-pic-16f877).
Retrieved December 9, 2015
[4] Manny Linhares, “Auto Dialer Wireless Smoke Detector/Alarm System”, California
Polytechnic State University, San Luis Obispo, 2010.
[5] Teki. Naga. Padmaja, Tejavath. Renuka, Anantha. Sushmitha. Srilakshmi, “Design of
GSMBased Smoke Detection and Temperature Monitoring System”, International Journal of
Engineering Research & Technology (IJERT) Vol. 2 Issue 4, April – 2013.
[6] Asif, O., Hossain, Md.B. Hasan, M., Rahman, M.T. and Chowdhury, M.E.H. (2014)
“FireDetectors Review and Design of an Automated, Quick Responsive Fire-Alarm System
Based on SMS”. Int. J. Communications, Network and System Sciences, page 386-395.
[7] PIC16f877, LM35 Temperature sensor, MQ-2 Smoke sensor, MAX232 Data Sheet
[8] MikroC PRO for PIC, Proteus ISIS Professional 8 SP2 help manuals
[9] R.Stephens, “Beginning Software Engineering”, Copyright © 2015 by John Wiley & Sons,
Inc., Indianapolis, Indian
59
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
Appendices
Appendix A: Full circuit diagram
void send_sms_t0_cellphone(){
Delay_ms(2000);
60
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
UART1_Write_Text("AT+CMGS=");
Delay_ms(1000);
Delay_ms(2000);
Delay_ms(2000);
UART1_Write(0x0D);
UART1_Write(0x22);
Delay_ms(2000);
UART1_Write(26); //Ctr +Z
Delay_ms(2000); //
Delay_ms(2000);
void motor_rotation_high(){
61
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
do
PORTC.F0 = 1;
PORTC = 0; // or PORTB = 3
PORTC.F1 = 1;
}while(1);
void motor_rotation_low()
62
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
// Variable declaration
char value1[8];
char value2[8];
// Main Function
63
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
void main(){
Sound_Init(&PORTD, 7);
//TRISA.RA2=1;
TRISA.RA0=1;
TRISA.RA1=1;
Trisd=0;
Lcd_Cmd(_LCD_CURSOR_OFF);
lcd_out(1,1,"Fire Detector");
delay_ms(1000);
lcd_cmd(_lcd_clear);
while(1){
temp_value=adc_read(0);
temp_value=temp_value*500/1023;
inttostr(temp_value,value1);
smoke_value=adc_read(1);
64
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
smoke_value=smoke_value*500/1023;
inttostr(smoke_value,value2);
lcd_cmd(_lcd_clear);
lcd_out(1,1,"FIRE IS DETECTED");
lcd_out(2,1,"T=");
lcd_out(2,3,LTRIM(value1));
delay_ms(1000);
lcd_out(2,7,"S=");
lcd_out(2,10,LTRIM(value2));
Delay_ms(2000);
//sound_play(600,2000);
send_sms_t0_cellphone();
motor_rotation_ high();
delay_ms(10000);
else if((temp_ value>45 && temp_ value<=50) && (smoke_ value>90 &&
smoke_value<=100))
motor_rotation_ low();
lcd_out(1,1,"WARNNING");
65
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016
lcd_out(2,1,"temp=");
lcd_out(2,6,value1);
delay_ms(1000);
lcd_out(2,9,"smoke=");
lcd_out(2,15,ltrim(value2));
lcd_out(1,1,"NORMAL CONDITION");
lcd_out(2,1,"temp=");
lcd_out(2,6,ltrim(value1));
delay_ms(1000);
lcd_out(2,9,"smoke=");
lcd_out(2,15,ltrim(value2));
else{
lcd_out(2,1,"temp=");
lcd_out(2,6,ltrim(value1));
delay_ms(1000);
lcd_out(2,9,"smoke=");
lcd_out(2,15,ltrim(value2)); } } }
66