0% found this document useful (0 votes)
106 views

31 - Fire Detection System Using Raspberry Pi

Uploaded by

Surya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views

31 - Fire Detection System Using Raspberry Pi

Uploaded by

Surya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

2019 International Conference on Information Science and Communication Technology (ICISCT)

Fire Detection System using Raspberry Pi


Muhammad Noman Aqeel Khan Talha Tanveer Kiran Khurshid
Student of Computer Engg. Dept. Student of Computer Engg. Dept Student of Computer Engg. Dept.
Sir Syed University of Engg. and Tech. Sir Syed University of Engg. and Tech. Sir Syed University of Engg. and Tech.
Karachi, Pakistan Karachi, Pakistan Karachi, Pakistan
Email: [email protected] Email: [email protected] Email: [email protected]

Hassan Zaki Syed Sajjad Imam Zaidi


Assistant Professor Assistant Professor
Sir Syed University of Engg. and Tech. Sir Syed University of Engg. and Tech.
Karachi, Pakistan Karachi, Pakistan
Email: [email protected] Email: [email protected]

Abstract—Fire presents significant threat to life due to its work done for the project, Section IV consist of system model
severe hazards and ability to spread rapidly. Fire detection which describes the whole system of the fire detection, Section
systems, specially vision-based system offers flame detection prior V methodology behind the proposed system, and Section VI
to any loss or destruction. In this present model, new vision-based
device is designed which works on Raspberry Pi and detects consist of implementation of algorithm.
flame (visible part of fire) over remote regions. An immediate There aremany fire detection systems are working in differ­
alert is generated on android application. Here in, HSV color ent areas in different manners but mostly are sensored based
combination is used for proposed model and changes in flame and detect fire through heat and smoke.But the method of fire
color and texture is studied. detection by using sensors ar now not very effective becausce
Index Terms—Fire detection, flame color, flame texture, false
alarm
they generate alerts when fire has reached its maximum level
which is very dangerous that is why the system is proposed
that detects fire in the beginig which is very important to stop
I. I n t r o d u c t io n
it very before so the loss or damages can not be done by it.
Fire is a serious threat to life and property worldwide. It is
usually caused by combustion of materials which releases heat Rectifier Regulator
and light in large amounts. Fire detection systems have been
designed to detect fire via sensing different fire related change.
Two types of fire detectors have been used so far, namely:
traditional/sensor-based and vision-based systems. Former re­
sponds against smoke, heat, temperature and pressure, whereas
later rely on the light detection. Among the two systems used,
traditional detectors have several disadvantages associated
with them. These include high cost, slow response time and
limited detection range. Additionally, these systems are not
feasible as outdoor detectors due to excessive sunlight and
wind pressure.
Besides, vision-based detectors can respond flame quickly
and can analyzed location of fire. In these detectors, flame
which is the vision part of fire can be analyzed via its color,
shape and movement based on spectral and spatial models. Fig. 1. System Model
Although, vision-based detectors have several advantages,
however, false detections limit their utilities. Therefore, there is
II. L i t e r a t u r e Su r v e y
still dire to design new models that are more efficient and can
solve problems associated with previously reported models. A. Motivation
The reason behind proposing a system of like fire detection Internet of things (IoT) is the network of programmable
is to prevent from the loss and damages done by fire very software, sensors, electronics and communication facility that
before by generating an alert.This research paper consist of six helps to gather and transfer data. The objective of the designed
sections.Section I consist of introduction of project, Section system is to alert the remote user while the fire accidents occur.
II consist of literature survey, Section III consist of related This system can be easily installed at any remote locations

978-1-7281-0447-8/19/$31.00 ©2019 IEEE


from where fire can be easily detected by camera. Therefore, taken by camera are converted from RGB color space to XYZ
sensors are not required for this purpose. The Raspberry Pi and then partitioned using an isotropic diffusion segmentation.
controller processes the camera input and detects fire using Later, irregular shapes can be set based on algorithm functions.
heat signatures. By using image processing method, the report
is automatically generated and sends to the person immediately B. Color Conversion
after the fire is being detected using Wi-Fi. This interns In fire detection system each color combination responds to
triggers the emergency mode of system. Advantages including the basic spectrum factors of red R, green G, and blue B in
remote monitoring for immediate actions and sending the the RGB model. The color model is based on the Cartesian
information at anytime or place, are main attributes of this coordinate system. The images or video captured in the form
method. of framed by the Camera are then converted from RGB to
XYZ color space. The color conversion is very important
B. Generate Alert on Fire and in fire detection system the RGB model converted into
The main motive of using this system is to prevent from HSV(Hue,Saturation Value) that is very important for the
the loss of life or any other damages to the company or the detection of fire on very high scale because it gives the fire
organization.Few years back the system that were installed detection at very minimum to high scales.
are now obsolete because they detect fire or smoke when it
reaches the maximum level and until that time the loss was IV. Sy st e m Mo d e l

already done. The fire detection system is used to detect fire The purpose is to create a hardware which can detect fire
in air through camera in real time monitoring system based on from far away. This device supports the Raspberry Pi platform
Raspberry Pi. The main feature of system is to alert generate and android application. Fire is a dangerous thing which can
when fire is started or reached it minimum level to prevent bring a lot of harm to anything. To prevent from loss, sensors
from the loss of lives and damages of any other property or are installed but these sensors are not effective. Sometimes
valuable things that are useful for the company or any place they get destroyed by heat or fire or sometimes they generate
where it is installed. alert very late until the damage has been done. In contrast
Raspberry Pi is very useful because it consumes low power and
C. Surveillance system it is of low cost and it does not need any sensors because the
The fire detection system need surveillance to detect the fire camera will detect the fire and generate the alert immediately
and to control it by generating an alert to the registered users to the users or the members of the organization, where this
on the application. This can be achieved by using Raspberry system is installed.
Pi which control the fire detection s system and the android
application is very useful when fire is detected it generate
alert and give an alert to fire department. This system works
on Raspberry Pi and the Android application. The image
processing algorithm is working and it is designed on Python
programming language which detects fire and send alert on the
server which is connected to android.The android application
receives the alert and send notification or generate an alert on
the application which can be seen by registered users.

III. R e l a t ed Wo r k

Some of previously reported fire detection system are based Fig. 2. Raspberry Pi
on detecting smoke as a change and then sent response to
detector, which rings alarm. Some detectors sense heat as
change and after communicating with a detector emergency
mode is triggered which ends up in ringing the buzzers. How­
ever, after mentioned systems have problems which decrease
their importance and open the window to explore new systems.
Interestingly, only few reports are available in literature visual
based fire detection system. Most of reported problems are
system getting damaged due to heat or wire system get Fig. 3. Pi Camera
damaged.

A. Shape Representation V. M e t h o d o l o g y

System will detect the colors consistent with the basic Fire patterns with heat signature are used to detect fire which
spectrum factors used in the RGB model, which is based on are color patterns for representing the fire. Following are the
the Cartesian coordinate system. Initially, videos or images three types of filters used to find these signatures:
• RGB filter
• cieLAB filter
• Both
• HSV filter
A. RGB filter
This is used to extract Blue (B), Green (G) and Red (R)
component of each pixel. It is necessary for every pixel to
verify following conditions:
• If R>G>B
• If R>Rt
where Rt red threshold value ranging between (0,255). Its
value is dependent on light of the image. Rt=5 is used in
this method.
B. cieLAB filter
The LAB color model is used cieLAB color model are red,
yellow and related colors like orange. For each pixels in this
frame the mean value of L, A and Compnents are identified.
For each pixel four filters are used.

L >L
A >A
B >B Fig. 4. Flow Chart

B>A
C. HSV filter
HSV is Hue Saturation Value. It uses HSV component
and works well in image processing. Using this filter, an
object with a specific color can be detected and to reduce
the influence of light intensity from the outside.
VI. I M PLEM ENTATION OF ALG O R ITH M
Our implementation of fire detection is used to facilitates
the organizations or companies to prevent from the loss of
lives and damages of valuable assets. The moment when the
fire is detected and to generate an alert on it through mobile
application/android application to the users on the application.
The algorithm is designed in such a way so that every one can
understand it and the android application is also very easy to
use. The algorithm is defined below which is very important
part of this project or the main part of the project.
• Step 1: Start
• Step 2: Image is captured on real time
• Step 3: Camera captured video continuously on real time
• Step 4: The image frame is acquired from the real time
live video feed
• Step 5: Captured image is sent to Raspberry Pi on the
real time
• Step 6: Image processing is done on images Fig. 5. Use case Diagram

• Step 7: If valid ,then go to emergency mode or generate


an alert on server
• Step 8: Android Application Start and receives an alert A. Hardware Testing
• Step 9: Send notification message to all user which are The hardware testing consist of Raspberry Pi which is
registered to Android Application controlling the whole system and its very small but fast in
• Step 10: Stop processing. Pi Camera is also include in hardware testing.
(applink, None)

isFire = False
threshold = 400
start = None
font = cv2.FONT_HERSHEY_SIMPLEX

#fire detection
for frame in camera.capture_continuous
(rawCapture, format="bgr",
use_video_port=True):
image = frame.array
Fig. 6. Hardware Testing of Raspberry Pi
image = np.array(image, dtype=np.uint8)

Algorithm blur = cv2.GaussianBlur(image, (21,21), 0)


hsv = cv2.cvtColor(blur, cv2.COLOR_BGR2HSV)
The image processing algorithm which is working in our
project to make our hardware more smart. It also makes our
#fgmask = fgbg.apply(image)
camera more smarter to make visual more accurate.
lower = np.array([1,30,169],
dtype = "uint8")
import cv2 upper = np.array([36,255,255],
import numpy as np dtype = "uint8")
from firebase import firebase mask1 = cv2.inRange(hsv,lower,upper)
import RPi.GPIO as GPIO
from picamera.array import PiRGBArray lower = np.array([30,0,245],
from picamera import PiCamera dtype = "uint8")
import time upper = np.array([180,8,255],
dtype = "uint8")
def LED_alert(st): mask2 = cv2.inRange(hsv,lower,upper)
ct = time.time() fmask = cv2.bitwise_or(mask1,mask2)
if ct < (st + 10): firecount = cv2.countNonZero(fmask)
GPIO.output(7,True) output = cv2.bitwise_and(image, image,
time.sleep(0.25) mask = fmask)
else: if isFire:
GPIO.output(7,False) cv2.putText(image, "Fire detected!”,
time.sleep(0.25) (10, 230), font, 0.5, (0,0,255), 1)

#init GPIO cv2.imshow("Fire detector", image)


GPIO.setmode(GPIO.BOARD) key = cv2.waitKey(1) & 0xFF
GPIO.setup(7, GPIO.OUT)
rawCapture.truncate(0)
#init picamera
camera = PiCamera() if key == ord("q"):
camera.resolution = (320, 240) break
camera.framerate = 32
rawCapture = PiRGBArray(camera, wasFire = isFire
size=(320, 240)) isFire = firecount > threshold
time.sleep(0.1)
#fgbg = cv2.BackgroundSubtractorMOG2 if isFire:
(history=1, varThreshold=16, start = time.time()
bShadowDetection=True)
if start == None: continue
#init firebase App LED_alert(start)
applink =
'https://firedet-e7f8e.firebaseio.com/' if wasFire != isFire:
firebase = firebase.FirebaseApplication firebase.put('fire-state', 'isFire isFire)
cv2.destroyAllWindows()
GPIO.cleanup()

B. Software Testing
The software testing consist of android application working
and testing part which is essential and is very useful. Following
are the User Interface of android application given down below
to understand the android application designing and the use of
it.

Fig. 8. Working result of fire detection system

idea to replace the sensors and to detect fire through internet


or by another means that was cheap and useful and beneficial
for others.
IoT is very useful way to detect fire and to detect fire by
using computer vision.The idea is that is to give a camera a
power of human eye and to detect fire when it starts but that
Fig. 7. Android Application is not a easy job. The researchers then design and implement
different algorithms using programming languages and they
Re s u l t s
come up with a algorithm of fire detection using camera but it
has some flaws. The algorithm that are design until now are not
The final result of our fire detection system is that it started
able to detect fire completely but they also detect some other
detecting fire when fire comes up in front of camera and the
objects in the color combination of fire and generate a false
system is working correctly and without any delay. But we are
alarms or notification. The working on it are still going and
still working on the system to overcome the false alerts as the
researchers are working to minimize the rate of false alarms
system doesn't know the exact shape and color of fire so its
or notifications.
detects the other objects of same color and fire and generate
A fire detection system is proposed using Raspberry Pi
an alert. We are working on our algorithm and making it more
connected with a camera and operates via image processing
efficient so it can detect the exact shape and color of fire and
algorithm. This system uses RGB color models to detect fire
don't get confuse between another shape of other objects and
color and texture. Proposed model works well and we are
don’t generate false alerts.
working on its fire detection algorithm for more effective
The fire detection system is very good approach in modern
results and to overcome the problems of false alarms. False
world so that the losses and damages done by fire before will
alarms are generated sometimes due to objects of orange color
not be repeated again and no other lives will be harm. The
and shapes. Consequently, the proposed system will result in
main advantage of system is that it is portable and can be
the reduction of loss and destruction. In future, this system
carry anywhere but very carefully and is very cost effective
will help the fire fighters or rescue team to rescue someone
and is working very well.
immediately and fire fighters will stop the fire immediately by
Here is a snapshot of out final working result on andoird
tracing the source or location of fire.
application and you can see changing conditions in firebase
aswell. Re f e r e n c e s

Co n c l u s io n [1] Yamagishi, H. and Yamaguchi, J.(n.d.). A contour fluctuation data


Few years back the fire is detected through sensors or any processing method for fire flame detection using a color camera.
26th Annual Conference of the IEEE Industrial Electronics Society.
other method or by smoke. But these methods are now old IECON.IEEE International Conference on Industrial Electronics, Control
and are not effective because in these methods the fire detects and Instrumentation. 21st Century Technologies and Industrial, pp.824­
when it reaches maximum level and it was sometimes too late 829, 2000.
[2] Pritam, D., and Dewan, J. H. (2017). Detection of fire using image pro­
because the damage was already done. To prevent from this cessing techniques with LUV color space. 2nd International Conference
and to stop fire when it starts researchers have explored the for Convergence in Technology (I2CT), pp.1158-1162, 2017.
[3] Seebamrungsat, J., Praising, S., and Riyamongkol, P. (2014). Fire
detection in the buildings using image processing. 2014 Third ICT
International Student Project Conference (ICT-ISPC), pp.95-98, 2014.
[4] Azmil, M. S. A., Ya’acob, N., Tahar, K. N., and Sarnin, S. S. (2015).
Wireless fire detection monitoring system for fire and rescue application.
2015 IEEE 11th International Colloquium on Signal Processing and Its
Applications (CSPA), pp.84-89, 2015.
[5] Md Saifudaullah Bin Bahrudin and Rosni Abu Kassim “Development
of Fire Alarm System using Raspberry Pi and Arduino Uno” in Inter­
national Conference on Electrical, Electronics and System Engineering
,2013, pp. 43-47, 2013.
[6] Ku. R.A.Agrawal and Prof. S.T.Khandare “Fire Detection Using Image
Processing” in International Journal of Advanced Engineering and
Global Technology I Vol-03, Issue-12,pp. 1499-1503, 2015.
[7] Nurul Shakira Bakri, Ramli Adnan, Abd Manan Samad and Fazlina
Ahmat Ruslan “A Methodology for Fire Detection Using Color Pixel
Classification” in IEEE 14th International Colloquium on Signal Pro­
cessing and its Applications (CSPA 2018), Penang, Malaysia, pp. 94-98,
2018.
[8] Noorinder, Student Member IEEE, Jaspreet Singh,Member IEEE and
Ekambir Sidhu,Member IEEE/IETE Raspberry Pi based Smart Fire
Management System employing Sensor based Automatic Water Sprin­
kler in International Conference on Power and Embedded Drive Control
(ICPEDC), 2017, pp.102-107.
[9] Ahmed Imteaj, Tanveer Rahman, Muhammad Kamrul Hossain, Mo­
hammed Shamsul Alam and Saad Ahmad Rahat An IoT based Fire
Alarming and Authentication System for Workhouse using Raspberry
Pi 3 in International Conference on Electrical, Computer and Com­
munication Engineering (ECCE), February 16-18, 2017, Coxs Bazar,
Bangladesh, pp. 899-904.
[10] K. Ramya, ’’Survey on an Intelligent AAA Device for Fire Detection”
in International Journal of Advance Research, Ideas and Innovations in
Technology (Volume 4, Issue 1), pp. 669-673,2018.
[11] Priyadarshini M Hanamaraddi* et al, “A Literature Study on Image
Processing for Forest Fire Detection”, in (IJITR) INTERNATIONAL
JOURNAL OF INNOVATIVE TECHNOLOGY AND RESEARCH Vol­
ume No.4, Issue No.1, December - January 2016, 2695 - 2700.
[12] Turgay Celik Fast and Efficient Method for Fire Detection Using Image
Processing in ETRI Journal, Volume 32, Number 6, December 2010,
pp. 881-890.

You might also like