0% found this document useful (0 votes)
289 views66 pages

Mini Project 1 1

Uploaded by

Addis Goshiye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
289 views66 pages

Mini Project 1 1

Uploaded by

Addis Goshiye
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER

SPRINKLER SYSTEM
2016

HARAMAYA UNIVERSTITY

INSTITUTE OF TECHNOLOGY

DEPARTEMENT OF ELECTRICAL AND COMPUTER ENGINEERING

STREAM OF INDUSTRIAL CONTROL

SEMESTER PROJECT

TITLE

DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH


AUTOMATIC WATER SPRINKLER SYSTEM

BY

NAME ID.NO

1) DEMEKE KASAYE ------------------------------------------------------------------------- 0478/05

2) GEBRE KAHSAY -------------------- --------------------------------------------------------1007/04

3) HABITIE AYENEW --------------------------------------------------------------------------0764/05

4) TEWODROS TSEGA ------------------ ----------------------------------------------------1533/05

SUBMITTED ON: JUNE, 2016 MAJOR ADVISOR: N.SUNANDA

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.2 Statement of the problem...............................................................................................2

1.3 Objectives......................................................................................................................2

1.3.1 General objective............................................................................................2

1.3.2 Specific objective............................................................................................2

1.4 Scope of the project.......................................................................................................3

1.5 Methodology..................................................................................................................3

1.6 Outline of the report.......................................................................................................5

Chapter Two.....................................................................................................................................6

2 Literature Review..........................................................................................................................6

Chapter Three...................................................................................................................................8

3 System Block Diagram.................................................................................................................8

4
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

3.1 Overview of Embedded System...................................................................................8

3.2 System block diagram........................................................................................9

3.3 Block diagrams and circuits.............................................................................10

3.3.1 Power supply..................................................................................10

3.3.2 Status monitoring...........................................................................11

3.3.3 Message sending............................................................................14

3.3.4 Sprinklemechanism........................................................................16

3.3.5 Alerting system.............................................................................18

Chapter Four.................................................................................................................................19

4 System Design and Implementation..........................................................................................19

4.1 Hardware requirements..................................................................................................19

4.1.1 Power Supply................................................................................................19

4.1.2 PIC16F877 Micro controller.........................................................................20

4.1.3 Temperature sensor (LM35).........................................................................23

4.1.4 Smoke/gas sensor (MQ2)..............................................................................24

4.1.5 16x2 LCD......................................................................................................26

4.1.6 GSM Modem.................................................................................................29

4.1.7 Simple dc motor.............................................................................................31

4.1.8 L293D motor driver IC..................................................................................31

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 Software Requirements and description..................................................................................37

4.2.1 Proteus design suit version 8.0.......................................................................37

4.2.2 MikroC.............................................................................................................37

4.2.3 Programing language: C Language..................................................................38

4. 3 Nonfunctional requirements....................................................................................................38

4.4 Overall working Algorithm......................................................................................................39

4.5 General flowchart of the system..............................................................................................40

4.6 Simulation Result and Discussion...........................................................................................41

4.6.1 Power Supply................................................................................................41

4.6.2 Sensors status monitoring section.................................................................42

4.6.3 SMS Sending section....................................................................................43

4.6.4 Water sprinkling section................................................................................44

4.6.5 Fire detection display section.........................................................................45

Chapter Five...................................................................................................................................47

5 Conclusions and Future Works...................................................................................................47

5.1 Conclusions.......................................................................................................47

5.2 Future Works....................................................................................................47

References......................................................................................................................................48

Appendices.....................................................................................................................................49

6
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Appendix A: Full circuit diagram..................................................................................................49

Sample Micro C Code....................................................................................................................49

Appendix B: message sending.......................................................................................................49

Appendix C: Rotation of motor.....................................................................................................50

Appendix D: Monitoring sensor values.........................................................................................52

7
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

List of figures

Figure 1 Phases of RAD model [9]..................................................................................................4

Figure 2 Block diagram of the system.............................................................................................9

Figure 3 Block diagram of power supply......................................................................................10

Figure 4 Power supply circuit diagram..........................................................................................11

Figure 5 Block diagram of status monitoring................................................................................12

Figure 6 Status monitoring circuit diagram...................................................................................13

Figure 7 Block diagram of message sending.................................................................................14

Figure 8 Message sending circuit diagrams...................................................................................15

Figure 9 Block diagram of sprinkler mechanism...........................................................................16

Figure 10 Sprinkler mechanism circuit diagram............................................................................17

Figure 11 Block diagram of sound alarm......................................................................................18

Figure 12 Sound alarm circuit diagrams.......................................................................................18

Figure 13 PIC16F877 chips [7]......................................................................................................20

Figure 14 PIC16F877 Pin diagrams...............................................................................................21

Figure 15 LM35 temperature sensor Pin diagrams........................................................................23

Figure 16 MQ-2 smoke sensor chips [7]........................................................................................24

Figure 17 MQ-2 smoke sensor pin diagram [7].............................................................................25

Figure 18 16x2 LCD Pin diagram..................................................................................................27

Figure 19 GSM Modem [6]...........................................................................................................30

8
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Figure 20 L293D Driver Pin diagrams [2].....................................................................................32

Figure 21 MAX232 pin diagram [7]..............................................................................................34

Figure 22 Flow chart of system.....................................................................................................40

Figure 23 Power supply.................................................................................................................41

Figure 24 Status monitoring...........................................................................................................42

Figure 25 Warning display section................................................................................................43

Figure 26 Message sending...........................................................................................................44

Figure 27 Sprinkling mechanisms.................................................................................................45

Figure 28 Fire detection section.....................................................................................................46

Figure 29 Circuit diagram of the system........................................................................................49

9
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

List of tables

Table 1 Ports of PIC16F877..........................................................................................................22

Table 2 Pin description of 16X2 LCD...........................................................................................28

Table 3 Pin description of GSM mode..........................................................................................30

Table 4 Pin description of L293D driver.......................................................................................32

Table 5 MAX232 Pin description..................................................................................................35

10
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Acronyms

AC: Alternating Current

ADC: Analog to Digital Converter

AT: Attention

DC: Direct Current

GSM: Global System for Mobile Communications

IC: Integrated Circuit

LCD: Liquid Crystal Display

PIC: Programmable Interface Controller

PRO: Professional

RISC: Reduced Instruction Set Computer

SIM: Subscriber Identification Module

SMS: Short Message Sending

TTL: Transistor-transistor logic

UART: Universal Asynchronous Receiver Transmitter

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

1.2 Statement of the problem

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.

1.3.1 General objective

 To design and develop an intelligent fire detector and automatic water sprinkler system

1.3.2 Specific objectives

 To design an automatic fire accident detection system


 To design an automatic water sprinkler system that able to sprinkling the water on the fire
 To send an SMS message while a fire accident is occurred using GSM technology to the
owner phone number
 To design a system which announces a fire accident is occurred by generating sound
 To continuously check the presence of the fire without any delay
 To monitor the status of the fire detecting sensors at every time

13
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

1.4 Scope of the project

This project is designed and developed for those areas like industries, houses, shopping malls,
hospitals with the following most interesting features:

 It automatically extinguishes the water on the fire


 It sends SMS to the owner who is away from his/her house
 It generates an alarm to announce to the environment
 Monitoring the status of the fire detecting sensors at any time

1.5 METHODOLOGY

First we have focused on finding problems by observing our surrounding.

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.

Because of the following best advantages:

 Reduced development time


 More accurate requirements
 Frequent customer feedback and involvement
 The ability to track changing requirements
 Encourages code re use
 Constant testing promotes high=quality code and eases integration issues
 Greater chance of success

14
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Requirements

planning

User Design Construction

Cut over

Figure1.Phase of RAD model

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.

1.6 Outline of the project:

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

2.1 Literature Review

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

Taki, Naga. Padmaja, Tejavath.Renuka,Anantha. Sushmith.Srilakshmi (2013) designed a system


which is “Design of GSM Based Smoke Detection and Temperature Monitoring System” that
detects smoke or its manifestations such as light, heat etc. and provides alerting the occupants of
the building and people around it and controlling the fire alarm detectors installed in the affected
premises. AT89S52 micro controller is the main controlling device which controls and
synchronizes all operations by receiving the signals from the sensors such as smoke sensor,
LM35 (temperature sensor). The temperature is detected by the temperature sensor and smoke
sensor senses the smoke. A LCD display is used to display the high temperature which is
obtained from the signal conditioning unit. By using signals from the AT89S52 micro controller,
a GSM modem is used to send the appropriate alert message to the fire station as well as to the
persons responsible for the fire safety of the premises. Asif, O., Hossain, Md.B., Hasan, M.,
Rahman, M.T. and Chowdhury, M.E.H. (2014) studied ”Fire Detectors Review and Design of an
Automated, Quick Responsive Fire-Alarm System Based on SMS”.

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

3. System Block Diagram

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.

3.1 Overview of Embedded System

Embedded system are electronic devices that in corporate microprocessors in corporate


microprocessors with in their implementations. The main purposes of the microprocessors are to
simplify the system design and provide flexibility. Embedded system applications are application
that include either hardware or software based system. Having a microprocessor or
microcontrollers in a system means that removing the bugs, making modifications, adding new
features, or upgrading system are only matters of rewriting or reprogramming the software that
controls the device without modifying the system. Embedded systems are electronic systems that
include a microcomputer to perform a specific or dedicated task or activity.

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

3.2 System block diagram

 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

Figure 2 Block Diagram of the System

20
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

3.2.1 Block Diagram Description:

An intelligent fire detector with automatic water sprinkler system basically consists of the
following main blocks:

 Power supply: a +5 regulated voltage is applied to all components


 Smoke and temperature sensor: This block is to check the presence of the fire
from the environment
 Micro controller: To control the whole system. Process input data from sensor
unit and provide output to the display
 Buzzer: To provide the sound while the fire is occurred
 LCD: Character display to notify the fire is detected or not and also for the sensor
values
 DC motor: It allows to sprinkling mechanism on the fire
 GSM module: To send an SMS message while the fire is occurred

3.3 Block diagrams and circuit

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

Step down Bridge


Filter circuit Regulator
Transformer circuit

Figure 3 Block diagram of power supply +5V

21
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Figure 4 Power supply circuit diagram

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

Figure 5 Block Diagram of Status Monitoring

23
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Figure 6 Status Monitoring Circuit Diagram

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

3.3.3 Message sending:

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

Figure 7 Block Diagram of Message Sending

25
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Circuit diagram for message sending

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.

Figure 8 Message sending circuit diagram

26
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

3.3.4 Sprinkler mechanism

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

Figure 9 Block diagram of sprinkler mechanism

27
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Figure 10 Sprinkler mechanism circuit diagram

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

3.3.5 Alerting system:

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

Figure 11 Block diagram of sound alarm

Figure 12 Sound alarm circuit diagram

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

4 System Design and Implementation

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.

4.1 Hardware requirements


 Power Supply
 PIC16F877 Microcontroller
 LM35 Temperature sensor
 MQ-2 Smoke sensor
 16x2 LCD
 GSM Modem
 MAX232
 Buzzer
 Motor-DC
 L293D Motor Driver IC
 Resistors
 Capacitors

4.1.1 Power Supply

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

4.1.2 PIC16F877 Micro controller

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]

The figure of the chip is shown below.

Figure 13 PIC16F877chiP [7]

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

 2 serial communication ports (MSSP, USART)


 PSP parallel communication port

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

Figure 14 PIC16F877 Pin diagram

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.

Table 1 Ports of PIC16F877

PORT Pin number

PORT A RA-0 to RA-5

PORT B RB-0 to RB-7

PORT C RC-0 to RC-7

PORT D RD-0 to RD-7

33
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

4.1.3 Temperature sensor (LM35)

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

Figure 15 LM35 Temperature sensor pin diagram

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

 Non-Linearity Only ±¼°C Typical


 Low-Impedance Output, 0.1 Ω for 1-mA Load [7]

4.1.4 Smoke/gas sensor (MQ2)

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]

Figure 16 MQ-2 smoke sensor chip [7]

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

 Heating Resistance: 31ohm


 Heating Current: <181mA

35
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

 Heating Power: <900mW


 Measuring Voltage: <24
 Ambient Temperature: -20C - 55C
 Humidity: <95%
 Oxygen Content: 21% [7]

Pin diagram of smoke sensor

Figure 17 MQ-2 smoke sensor pin diagram [7]

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.

Why MQ2 smoke sensor?

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.

4.1.5 16x2 LCD

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

Every line has 16 characters.


 Here we use two line 16 character i.e. 16x2 LCD. The total number of objects is display on the
LCD module.
 5 x 8 dots with cursor
 Built-in controller (KS 0066 or Equivalent)
 + 5V power supply (Also available for + 3V)

Figure 18 16x2 LCD Pin diagram

38
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Table 2 Pin description of 16X2 LCD

Pin

No Function Name

1 Ground (0V) Ground

2 Supply voltage; 5V (4.7V – 5.3V) VCC

3 Contrast adjustment; through a variable resistor VEE

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

11 8-bit data pins DB4

12 DB5

13 DB6

14 DB7

39
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

15 Backlight VCC (5V) Led+

16 Backlight Ground (0V) Led-

4.1.6 GSM Modem

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

Figure 19 GSM Modem [6]

Table 3 Pin description of GSM modem

PIN PIN Name Details

VCC Power Supply Power supply input (4.2-13V DC,1A)

GND Ground Ground level of power supply.

V-Interface Interfacing 5V DC for interfacing with 5V µC 3.3V DC for interfacing


Voltage with 3V3µC.

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.

GND Ground Ground level of interfacing signals.

41
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

The specifications and characteristics for GSM:


 Frequency band: the frequency range specified for GSM is 1,850 to 1,990 MHz (mobile
station to base station).
 Duplex distance: the duplex distance is 80 MHz. Duplex distance is the distance between the
uplink and downlink frequencies. A channel has two frequencies, 80 MHz a part.
 Channel separation: the separation between adjacent carrier frequencies, In GSM, is 200 kHz.
 Modulation: Modulation is the process of sending a signal by changing the characteristics of a
carrier frequency. This is done in GSM via Gaussian minimum shift keying (GMSK).
 Transmission rate: GSM is a digital system with an over-the-air bit rate of 270 kbps.

4.1.7 Simple dc motor

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.

4.1.8 L293D motor driver IC

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]

Figure 20 L293D Driver Pin diagram [2]

Table 4 Pin description of L293D driver

Pin number Function Name

1 Enable pin for motor1; output high Enable1,2

2 Input 1 for motor 1 Input 1

3 Output 1 for motor 1 Output 1

4 Ground (0v) Ground

43
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

5 Ground (0v) Ground

6 Output 2 for motor 1 Output 2

7 Output 2 for motor 1 Input 2

8 Supply voltage for motors; 9-12v VCC 2

9 Enable pin for motor 2; active high Enable 3,4

10 Input 1 for motor 1 Input 3

11 Output 1 for motor 1 Output 3

12 Ground (0v) Ground

13 Ground (0v) Ground

15 Output 2 for motor 1 Output 4

16 Input 2 for motor 1 Input 4

17 Supply voltage; 5v VCC 1

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

Figure 21 MAX232 pin diagram [7]

Working principles of MAX232:

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

Table 5 MAX232 Pin description

Pin No Name Function

1 C1+ Capacitor connection pins

2 C3+ Capacitor connection pins

3 C1- Capacitor connection pins

4 C2+ Capacitor connection pins

5 C2- Capacitor connection pins

6 C4- Capacitor connection pins

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

15 CND Signal ground(0v)

16 VCC Signal ground(0v)

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

4.3 Nonfunctional requirements

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

 Announces a fire accident is occurred by generating sound


 Continuously check the presence of the fire without any delay
 Monitoring the status of the fire detecting sensors at every time 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. And the simulation of this
features is included in the next section.
4.4 Overall working Algorithm

1. Initialize microcontroller, LCD, ADC, UART


2. Read the input signal from the smoke sensor and the temperature sensor
3. Start analog to digital conversion since, the output of the two sensors values is analog it
has to be digitalized
4. Display the values on LCD
5. Compare data with its preset value which is 50c for temperature sensor and 100 ppm for
the smoke level for the fire to be detected.
For warning message display the value for temperature is 45c and 100 ppm for smoke
level
 Condition 1: temp < 45 and smoke < 100 Result Fire not detected, only display the
status of the sensor values
 Condition 2: temp > 45 & temp < 50 and smoke > 90 & smoke < 100 Results Display
warning message
 Condition 3: temp > 50 and smoke > 100 Results
 The sprinkler sprinkle or extinguishes the water
 SMS sent to the specified phone number
 Buzzer generates sound

50
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

4.5 General flowchart of the system

Start

Initialize LCD,ADC& UART

Read the input signal for temperature and


smoke sensor

Start A/D Conversion

Display the value on LCD

Fire Not Is smoke &


Fire Detected
Detected T0

1. Sprinkle the water


2. SMS Sent

3. Switch on the buzzer

End

Figure 22 Flow chart of system

51
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

4.6 Simulation Result and Discussion

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.

4.6.1 Power Supply

This is the power supply unit we have used for the generation of +5v input for all components.

Figure 23 Power supply

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.

4.6.2 Sensors status monitoring section

 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.

Figure 24 Status monitoring

 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

Figure 25 Warning display section

4.6.3 SMS Sending section

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

Figure 26 Message sending

4.6.4 Water sprinkling section

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

Figure 27 Sprinkling mechanism

4.6.5 Fire detection display section

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.

Figure 28 Fire detection section

57
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

CHAPTER FIVE

5 Conclusions and Future Works


5.1 Conclusions:

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.

5.2 Future Works

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

[2] L293d motor driver IC (http://www.engineersgarage.com/electroniccomponents/l293dmotor-


driver-ic). Retrieved December 9, 2015

[3]Advantages of picoverAtmega16(http://www.crazyengineers.com/threads/advantages-of pic -


over- atmega16/). Retrieved December 18, 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

[10] MikroElektronika, (2009). PIC Microcontrollers Programming in C by Milan Verle, 1st


edition

59
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Appendices
Appendix A: Full circuit diagram

Figure 29 Circuit diagram of the system


Sample MicroC Code
Appendix B: message sending

void send_sms_t0_cellphone(){

UART1_Write_Text("AT"); // initialize GSM modem UART1_Write(0x0D); delay_ ms(2000);

UART1_Write_Text("AT+CMGF=1"); //Mean that text mode

Delay_ms(2000);

UART1_Write(0x0D); // mean Enter

60
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

UART1_Write_Text("AT+CMGS=");

Delay_ms(1000);

UART1_Write(0x22); //" double qoute

Delay_ms(2000);

UART1_Write_Text("+251918648719"); // Owner Telephone Number

UART1_Write(0x22); //" double qoute

UART1_Write(0x0D); // mean Enter

Delay_ms(2000);

UART1_Write(0x0D);

UART1_Write(0x22);

UART1_Write_Text("FIRE IS DETECTED "); // Text to be sent

UART1_Write(0x22); //" double qoute

Delay_ms(2000);

UART1_Write(26); //Ctr +Z

Delay_ms(2000); //

UART1_Write(0x0D); // mean Enter

Delay_ms(2000);

Appendix C: Rotation of motor

void motor_rotation_high(){

TRISC = 0; // PORT C as output port

61
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

PORTC = 1; // Set RC to high

do

//To turn motor clockwise

PORTC.F0 = 1;

Delay_ms(3000);//3 seconds delay

//To Stop motor

PORTC = 0; // or PORTB = 3

Delay_ms(1000);//1 seconds delay

//To turn motor anticlockwise direction

PORTC.F1 = 1;

Delay_ms(3000);//3 seconds delay

//To Stop motor

PORTC = 0; // or PORTB = 3 (3 = 0b00000011)

Delay_ms(2000); // 2 seconds delay

}while(1);

void motor_rotation_low()

PORTC = 0; //make the motor off

62
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

Appendix D: Monitoring sensor values

// Variable declaration

unsigned int temp_ value;

unsigned int smoke_ value;

char value1[8];

char value2[8];

// LCD Port declaration PORTB

sbit LCD_RS at Rb0_bit;

sbit LCD_EN at Rb1_bit;

sbit LCD_D4 at Rb2_bit;

sbit LCD_D5 at Rb3_bit;

sbit LCD_D6 at Rb4_bit;

sbit LCD_D7 at Rb5_bit;

sbit LCD_RS_ Direction at TRISb0_bit;

sbit LCD_EN_ Direction at TRISb1_bit;

sbit LCD_D4_Direction at TRISb2_bit;

sbit LCD_D5_Direction at TRISb3_bit;

sbit LCD_D6_Direction at TRISb4_bit;

sbit LCD_D7_Direction at TRISb5_bit;// End LCD module connections

// Main Function

63
DESIGN AND ANALAYSIS OF INTELLIGENT FIRE DETECTOR WITH AUTOMATIC WATER
SPRINKLER SYSTEM
2016

void main(){

LCD_ Init(); // Initialize LCD

Adc_ init(); // Initialize analog to digital converter

UART1_INIT(9600); //paud rate with 9600

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);

//main while loop

while(1){

temp_value=adc_read(0);

temp_value=temp_value*500/1023;

inttostr(temp_value,value1);

// lcd chr(1,8,0xdf); //39 ascii value for '

//Lcd_Chr_Cp('c'); //dispaly c at the current cursor of lcd

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);

if(temp_value>50 && smoke_ value>100) {

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));

else if (temp_value<=45 && smoke_value<=90)

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

You might also like