Potential Fire Hazard Detection System Based on Microcontroller
Using the Fuzzy Mamdani Method
Arif Budi Sampurna
1
, Edy Setiawan
1
, Imam Sutrisno
1
, Urip Mudjiono
1
, Boedi Herijono
1
,
Tri Mulyatno Budhi Hartanto
2
and Ignatius Kristianto Agung Nugroho
3
1
Politeknik Perkapalan Negeri Surabaya, Indonesia
2
Balai Pendidikan dan Pelatihan Transportasi Laut, Indonesia
3
Sekolah Tinggi Ilmu Pelayaran, Indonesia
Keywords: Fuzzy Mamdani, Arduino UNO, MQ-9, MQ-5, MQ-2, AMG8833.
Abstract: Early fire prevention is very important. Based on statistical data from the DKI Jakarta Provincial Fire and
Rescue Service. In 2016 there were 1,047 fire cases, while in 2017 it almost doubled to 2,055 cases. The
danger of a room is also influenced by the level of a gas (based on LEL and UEL values). Therefore, it is
necessary to have a tool to prevent or warn of potential fire hazards early. This final project research makes
potential fire hazard detection system. The sensors used include MQ-9, MQ-5, MQ-2, and thermal sensor
AMG8833. The working system of this tool is AMG8833 connect raspberry to detects fire, output from
AMG8833 will be sent to Arduino as input for Fuzzy Mamdani along with the values from the sensors MQ-
9, MQ-5, MQ- 2 (there are 4 inputs). The result or decision of Fuzzy is the level of potential fire hazard that
occurs. The results of the research are expected to be able to provide early warning or prevention of fire. In
addition, it is hoped that this research module can be used as a teaching module for fire hazard detection
systems to support a better vocational education system. From 10 trials, 90% of the system success was found
for detecting potential fire hazards, for detecting fires using AMG8833 also success and for the success of
sending information via LED-RBG by 90%, and via telegram 100%.
1 INTRODUCTION
Fire is an element that is very useful for humans if
you can control it, but fire can also be dangerous to
humans like fire. Fire is one of the disasters that often
occurs both in big cities and in rural areas that can
cause huge losses (Irawati, 2017). Fires can occur at
any time without anyone being able to predict them.
Many factors can affect the occurrence of fires,
including electrical short circuits, temperature
increases from mechanical processes that cause fires,
and human factors or human error (Wijaya, et al.,
2020).
In a company or housing, it is very important to
have a means of detecting the potential level of fire
hazard. This tool aims to detect the potential level of
fire hazard early on so that it can be overcome quickly
before a fire occurs. Many fire disasters have caused
many casualties and property losses. Fires in homes
often occur due to accidents in the kitchen
environment, or electrical problems in the installation
of electronic devices. Fires start at a small level but
can endanger large houses or surrounding buildings
(Irawati, 2017).
Based on statistical data from the DKI Jakarta
Provincial Fire and Rescue Service, there were 1,047
fire cases in DKI Jakarta province in 2016. A total of
754 cases were caused by electricity, 35 cases due to
cigarettes, 75 cases due to stoves and 183 cases due
to other factors and 0 for unknown cases, but in 2017
fire cases increased almost 2 times to 2,055 cases. A
total of 851 cases were caused by electricity, 33 cases
were caused by cigarettes, 156 cases were caused by
stoves, 1009 cases were caused by other factors, and
6 cases had no known cause. While the results of
statistical data on fire incidents in Indonesia in 2007,
most fire accidents occurred in residential areas,
namely 65.8%, shopping centers 9.8%, industrial
buildings by 8%, offices by 5.6%, markets by 4.8%,
hotels by 4.6 %, and other buildings by 0.4% (Agusri,
2021).
The room can be said to be flammable if a certain
volume of hazardous gas has passed the Lower
Explosive Limit (LEL) or the lower limit of the
300
Sampurna, A., Setiawan, E., Sutrisno, I., Mudjiono, U., Herijono, B., Hartanto, T. and Nugroho, I.
Potential Fire Hazard Detection System Based on Microcontroller Using the Fuzzy Mamdani Method.
DOI: 10.5220/0011762500003575
In Proceedings of the 5th International Conference on Applied Science and Technology on Engineering Science (iCAST-ES 2022), pages 300-306
ISBN: 978-989-758-619-4; ISSN: 2975-8246
Copyright © 2023 by SCITEPRESS Science and Technology Publications, Lda. Under CC license (CC BY-NC-ND 4.0)
explosion and can be said to be very dangerous or
very easy to fire if it has passed the Upper Explosive
Limit (UEL) or the upper limit of explosion.
According to data from CHRISALIS SCIENTIFIC
TECHNOLOGIES INC. the lower explosion limit
(LEL) of methane gas in a room is 5% of the total
volume and the upper limit (UEL) of 15% of the total
volume of the room, the lower limit of the explosion
(LEL) of carbon monoxide gas is 12.5% of the total
volume and above (UEL) 74% of the total volume of
the room. Therefore, a fire hazard detection system is
needed that works properly to prevent fires (Amanda,
2021).
In this study, a system that can detect the potential
level of fire hazard from an early age will be made
using 3 types of parameters using the Fuzzy Mamdani
method (Batubara, 2017). Information on the
potential level of fire hazard will be sent via telegram.
It is hoped that this system can reduce or prevent fires
so that they can reduce the number of fatalities and
minimize losses.
The formulation of the problem in this study
include:
How to detect potential fire hazard level with
Fuzzy Mamdani using AMG8833, MQ-9, MQ-5,
MQ-2, and DHT22 sensors?
How to detect fire using AMG8833 sensor?
How to convey information that there has been a
potential fire hazard?
2 METHOD
The stages carried out in this study are depicted in the
flow chart in Figure 1 below
Figure 1: Research Flowchart.
Based on the flow chart above, the detailed flow
of research activities will be described in the
following sub-chapters
2.1 System Analysis
The following are the hardware and software
requirements used to build the overall system.
Hardware Software
Sensor MQ-9
Sensor MQ-5
Sensor MQ-2
Sensor AMG8833
Raspberry Pi 4B
Arduino Uno
Buzzer SFM27
LED RGB
Water Pump
Smart
p
hone
Arduino IDE
Python
MATLAB
Eagle
Telegram
This system has four input parameters. In the
input or input section there are 4 sensors, namely the
MQ-9, MQ-5, MQ-2 sensors to detect dangerous
gases and the AMG8833 sensor to detect fire, the four
sensors are integrated using the Fuzzy Mamdani
method on the Arduino Uno to detect whether there is
a potential danger fire or not. (Febriany, 2016). The
results of the system will determine the potential fire
hazard level between levels 0 to 4, if the system states
a fire hazard potential level 0 then nothing happens,
while if the system states a fire hazard potential level
1 or 2 or 3 or 4 the LED will light up (green for level
1, yellow for level 2, orange/orange for level 3 and
red for level 4), the water pump will pour water (if
fire is detected) and the raspberry will send a
message/notification to the smartphone (telegram) .
Then when the level of one or more harmful gases or
exceeds the safe limit, the system will sound a buzzer.
The concept of the system is illustrated in the block
diagram in Figure 2 (Mahendra, 2021).
Figure 2: System Concept.
Potential Fire Hazard Detection System Based on Microcontroller Using the Fuzzy Mamdani Method
301
Figure 3: Mechanical Design Results.
The workflow of the system in this study can be seen
in Figure 4 below
Figure 4: System Workflow Diagram.
2.2 Fuzzy Logic
The application of fuzzy logic to the system is used to
identify the potential level of fire hazard. In this
study, the fuzzy mamdani method was used with 4
inputs and 1 output in the form of identification.
Fuzzy in this system will be processed by a
microcontroller with input in the form of carbon
monoxide gas from the MQ-9 sensor reading,
methane gas from the MQ-5 sensor reading, propane
gas reading from the MQ-2 sensor and the fire
temperature reading from the AMG8833 sensor.
While the output is in the form of identifying the level
of potential fire hazard from level 0 to level 4
(Muhathir, 2021).
3 RESULTS AND DISCUSSION
In this design, there are inputs in the form of carbon
monoxide gas from the MQ-9 sensor readings,
methane gas from the MQ-5 sensor readings, propane
gas readings from the MQ-2 sensor and fire
temperature readings from the AMG8833 sensor.
Then the output is in the form of identification of the
potential level of fire hazard from level 0 to level 4.
Here is the membership function of Fuzzy logic input
and its output.
Figure 5: Membership Function Gas CO.
Figure 6: Membership Function Gas CH4.
Figure 7: Membership Function Gas C3H8.
Figure 8: Membership Function Fire Temperature.
Figure 9: Fuzzy Logic Output.
iCAST-ES 2022 - International Conference on Applied Science and Technology on Engineering Science
302
3.1 Fuzzy Logic Test
In modeling the Fuzzy logic method that will be used
for the control process of the system in this final
project, a simulation is needed to determine the input,
output, or rules that will be used. Matlab software is
used for fuzzy logic simulations either with toolbox,
m-file, or simulink (Suyono, 2017).
Fuzzy testing is done by comparing the fuzzy
output with the results of matlab and the results of
manual calculations (Sutrisno, 2014).
Table 1: Fuzzy Logic Inference.
CO CH4 C3H8 Fire
Danger
Level
A A A None 0
A A A Small 1
A A A Big 2
A A B None 1
A A B Small 2
A A B Big 3
A A SB None 2
A A SB Small 4
A A SB Big 4
A B A None 1
A B A Small 2
A B A Big 3
A B B None 1
A B B Small 2
A B B Big 3
A B SB None 2
A B SB Small 4
A B SB Big 4
A SB A None 2
A SB A Small 4
A SB A Big 4
A SB B None 2
A SB B Small 4
A SB B Big 4
A SB SB None 3
A SB SB Small 4
A SB SB Big 1
B A A None 2
B A A Small 3
B A A Big 1
B A B None 2
B A B Small 3
B A B Big 2
B A SB None 4
B A SB Small 4
B A SB Big 1
B B A None 2
B B A Small 3
B B A Big 1
B B B None 2
B B B Small 3
B B B Big 4
B B SB None 3
B B SB Small 4
B B SB Big 4
B SB A None 2
B SB A Small 4
B SB A Big 4
B SB B None 3
B SB B Small 4
B SB B Big 4
B SB SB None 3
B SB SB Small 4
Potential Fire Hazard Detection System Based on Microcontroller Using the Fuzzy Mamdani Method
303
Table 1: Fuzzy Logic Inference (cont.).
CO CH4 C3H8 Fire
Danger
Level
B SB SB Big 4
SB A A None 2
SB A A Small 4
SB A A Big 4
SB A B None 2
SB A B Small 4
SB A B Big 4
SB A SB None 3
SB A SB Small 4
SB A SB Big 4
SB B A None 2
SB B A Small 4
SB B A Big 4
SB B B None 3
SB B B Small 4
SB B B Big 4
SB B SB None 3
SB B SB Small 4
SB B SB Big 4
SB SB A None 3
SB SB A Small 4
SB SB A Big 4
SB SB B None 3
SB SB B Small 4
SB SB B Big 4
SB SB SB None 4
SB SB SB Small 2
SB SB SB Big 4
3.2 Telegram Test
In this test, to find out whether the telegram message
that was sent was successfully sent by the system.
Figure 10: Telegram Test.
3.3 Water Pump Test
Table 2: Testing Water Pump.
Test Water Pump
There's a fire turn on
There's a fire turn on
There's a fire turn on
There's a fire turn on
There's a fire turn on
There's a fire turn on
There's a fire turn on
There's a fire turn on
There's a fire turn on
There's a fire turn on
In Table 2. shows the results of the Water Pump test
to pour water when a fire is detected. The results of
testing the condition that there is fire, it was found
that 10 attempts were made with 10 successes and 0
failures. The resulting error is 0% (Sutrisno,.2012).
iCAST-ES 2022 - International Conference on Applied Science and Technology on Engineering Science
304
3.4 Buzzer Test
Table 3: Buzzer Testing on Gas Levels.
Test Buzze
r
There is a dan
g
erous
g
as level turn on
There is a dan
g
erous
g
as level turn on
There is a dangerous gas level turn on
There is a dangerous gas level turn on
There is a dangerous gas level turn on
There is a dan
g
erous
g
as level turn on
There is a dan
g
erous
g
as level turn on
There is a dan
g
erous
g
as level turn on
There is a dan
g
erous
g
as level turn on
There is a dangerous gas level turn on
In Table 3. shows the results of the Buzzer test to give
a warning when gas levels are detected that exceed
the safe limit. The results of the condition test have
gas levels exceeding the safe limit, 10 trials were
found with 10 successes and 0 failures. The resulting
error is 0% (Jami'in 2014).
3.5 LED-RGB Test
LED-RGB is used as an indicator of the output of the
fuzzy mamdani method.
Table 4: LED-RGB Test.
Test LED-RGB
Hazar
d
Potential Level 0 No flame
Hazar
d
Potential Level 0 No flame
Hazar
d
Potential Level 1 Green Light
Hazar
d
Potential Level 1 Green Li
g
ht
Hazar
d
Potential Level 1 Green Li
g
ht
Hazar
d
Potential Level 2 Yellow Li
g
ht
Hazar
d
Potential Level 2 Yellow Light
Hazar
d
Potential Level 3 Re
d
Light
Hazar
d
Potential Level 4 Re
d
Light
Hazar
d
Potential Level 4 Re
d
Light
In Table 4. shows the results of the Buzzer test to give
a warning when gas levels are detected that exceed
the safe limit. The results of the condition test showed
that there was a potential fire hazard, 10 trials were
found with 9 successes and 1 failure. The resulting
error is 10%.
3.6 Overall System Test
In testing the overall system, a room is carried out by
giving fire and gas using a gas lighter.
Table 5: Overall System Test.
CO CH4 C3H8 Temp Lv LED Pump Buzz
19.08 1.15 6.60 28.25 0 Off M M
19.88 2.59 2739.7 28 2 K M N
1344.8 198.67 36.03 28.0 2 K M N
34.18 181.91 778.46 28.0 1 H M N
18.72 4.94 12.19 34.0 1 H N M
18.37 3.81 10.69 122.0 2 K N M
26.29 715.25 82.33 80.5 3 O N N
30.56 1254.5 51.58 86.0 4 Off N N
400.15 687.54 754.12 29.0 1 H M N
1694.1 50.17 954.87 28.25 3 O M N
In Table 5 shows the results of testing the entire
system. Output on the LED, K is yellow, H is green,
O is orange, M is red. Output at pump and buzzer, M
is off, N is on. It was found from the results of 10
tests, there was 1 incorrect result or a 90% success
rate (Sutrisno, 2014).
4 CONCLUSION
Based on the results of the tests that have been carried
out in this study, it can be concluded that:
The application of Fuzzy Mamdani on a system
with four input parameters including carbon
monoxide gas, methane gas, propane gas and fire
temperature can detect potential fire hazard levels
with an accuracy of 90%.
The application of the AMG8833 sensor to detect
fire, the AMG8833 sensor reads the heat value or
temperature of each pixel and then takes the hottest
value as the fire temperature input.
The application of delivering information on
potential fire hazards via LED-RGB has an accuracy
Potential Fire Hazard Detection System Based on Microcontroller Using the Fuzzy Mamdani Method
305
of 90% and the delivery of information via telegram
is sent once every 10 seconds with 100% accuracy.
SIM800l Communication Testing to databases and
websites does not occur sending data errors or
without errors with a delay of 10 seconds so there is
no you can say real time.
The suggestions that can be given from this
research include:
The use of thermal sensors to detect fire is good
enough, but it would be better if there is a camera
sensor that can detect fire in real.
Testing the sensor would be better to use a gas that
really matches the gas being detected.
REFERENCES
Agusri, E., Hasan, M. N. R. & Martini, R. S., 2021. Analisa
Kebutuhan Air Bersih Untuk Operasional Harian Dan
Sistem Pemadam Kebakaran Sprinkler Gedung Utama
Baru Rumah Sakit Bhayangkara Palembang. Volume
10, pp. 338-349.
Amanda, N., 2021. Rancang Bangun Alat Pendeteksi Titik
Api Dan Asap Menggunakan Metode Yolo Dan
Berbasis Android Untuk Deteksi Dini Kebakaran Pada
Gedung Bertingkat. Surabaya: Politeknik Perkapalan
Negeri Suarabaya.
Batubara, S., 2017. Analisis Perbandingan Metode Fuzzy
Mamdani Dan Fuzzy Sugeno Untuk Penentuan
Kualitas Cor Beton Instan. Medan: Universitas
Pembangunan Panca Budi Medan.
Febriany, N., 2016. Aplikasi Metode Fuzzy Mamdani
Dalam Penentuan Status Gizi Kebutuhan Kalori Harian
Balita Menggunakan Software Matlab. pp. 29-49.
Irawati, R., 2017. Model Peringatan Kebakaran Dengan
Fuzzy Mamdani. pp. 30-37.
Mahendra, A., 2021. Prototype Deteksi Kebakaran
Menggunakan Kamera Dengan Notifikasi Message
Telegram Berbasis Iot Di Bandara Mutiara Sis Al-
Jufrie. Surabaya: Politeknik Penerbangan Surabaya.
Muhathir, Santoso, M. h. & Lestari, D. A., 2021. Wayang
Image Classification Using SVM Method and GLCM
Feature Extraction. JITE (Journal of Informatics and
Telecommunication Engineering), pp. 373-382.
Suyono, H., Setyawati, O. & Dirgantara, W., 2017. Sistem
Peringatan Dini untuk Deteksi Kebakaran pada
Kebocoran Gas Menggunakan Fuzzy Logic Control.
pp. 27-32.
Wijaya, I. D., Anam, S. & Rismanto, R., 2020. Rancang
Bangun Sistem Deteksi Dan Pemadam Kebakaran Pada
Smart Home Menggunakan Metode Fuzzy. pp. 9-16.
Imam Sutrisno, Mohammad Abu Jami’in, Jinglu Hu.
(2014). Modified fuzzy adaptive controller applied to
nonlinear systems modeled under quasi-ARX neural
network, Artificial Life and Robotics, vol. 19, issue 1,
pp. 22-26.
Sutrisno, Imam. (2012). Neural predictive controller of
nonlinear systems based on quasi-ARX neural network,
ICAC 12 - 18th International Conference on
Automation and Computing.
Jami'in M.A., Sutrisno I. (2014). An adaptive predictive
control based on a quasi-ARX neural network model.
13th International Conference on Control Automation
Robotics and Vision, ICARCV
Sutrisno, Imam. (2014). An improved adaptive switching
control based on quasi-ARX neural network for
nonlinear systems. Artificial Life and Robotics.
iCAST-ES 2022 - International Conference on Applied Science and Technology on Engineering Science
306