Design of a Home Fire Detection System Using Arduino and SMS Gateway

: Fire is a problem that can happen at any time. Delay in coping with house ﬁres can induce in loss of human life or material. If the ﬁre is not held severely, incidents like house ﬁres can occur and create more signiﬁcant losses, especially with the increasing number of residents’ settlements in the formation of huddled houses, which will be more challenging to handle in case of a ﬁre. This research aims to build a prototype system that quickly helps house owners and ﬁreﬁghters to detect ﬁres and gas leaks. This home ﬁre detection system is utilized to measure room temperature and gas levels in a room, then the output of this system is sending information of short messages and alarms. The results revealed that the prototype room with a scale of 1:25, 1:50, and 1:75 which uses a temperature sensor and a gas sensor could run as desired. In 10 testing trials, the system works according to the designed plan, which means the system could interpret the temperature and gas leakage of a room, then the system will send a short message and ring the alarm.


Introduction
Fire is one of the tragedies that cannot be predicted. Besides being unwanted, it is also often uncontrollable when the fire spreads. Fire incidents are hazardous and disrupt people's lives and livelihoods. Fire is categorized as a form of disaster. According to the National Disaster Management Agency (BNPB) in Indonesia [1], a disaster is a series of cases that threatens and disrupts people's lives and livelihoods caused by natural factors, non-natural factors, or human factors, resulting in loss of life, environmental damage, property loss, and psychological impact.
Delay in coping with fires can cause in loss of human life or materials. Most of the fire cases occurred in residential houses. A house is an object that is vulnerable to fire because of its kind of activities. Human safety is an essential factor that must be taken into account and prioritized in a house fire. Therefore residents of houses affected by disasters must receive information in the form of early warnings when a fire happens so that the human can be evacuated independently [2]. Information about the fire location is necessary to provide information to the fire department for easier access to the fire location and prevent more significant losses [3].
The increasing number of residential houses, where houses are close to each other, will be more challenging to handle in a fire tragedy. A fire that occurs in a house will quickly spread to all elements of the house. House owners will identify the fire when it starts to spread, so there will be less time to rescue the human or house materials. The antecedent of the fire comes from various factors such as electric short circuits and others. For this reason, it is necessary to carry out handling efforts that can provide more information to house owners and firefighters so worthy action could be taken immediately as not to impact more significant losses.
Many types of research on fire detection systems using IoT have been carried out [4][5][6][7]. In 2017, "Research on the Design of an IoT-Based Fire Detection System and an SMS Gateway Using Arduino", which was applied to prevent forest fires, has been researched by the authors of [8], and the results of this research aid officers in identifying the real-time conditions that occur in the forest.
"Simulation of a Room Pollution Detection System Using Smoke Sensors With Notifications Via SMS (Short Message Service) and Arduino-Based Alarms" has further been carried out by the authors of [9] using a SIM900 modem. It is intended to send and receive SMS communications to users in a report on detection results using the AT-Command protocol by the GSM network [10]. In 2018, research on "LPG Tube Leak Detection Through an SMS Gateway Using an Arduino Uno-Based MQ2 Sensor" was implemented [11], and the research outcomes are that the MQ2 sensor is connected to an Arduino board to monitor LPG gas and cigarette smoke. However, gas detection is not based on the distance of identified gasses but the level of gas content. The thicker the gas, the faster it will be identified. The use of sensors to interpret temperature and humidity has been investigated in [12,13] with a prototype model, although their research did not reveal how information messages are processed and sent using short messages. Therefore, this study will compose a system using an Arduino microcontroller, an open-source electronic board. Arduino consists of the main components, particularly the ATMega 328 microcontroller. This board works according to the program flow that is uploaded to the board. This design also uses the MQ2 sensor, which is used to identify smoke, gas, and other things. The DS18B20 sensor is also used to measure the temperature in a room. The short message-based fire detector uses another device in the form of a GSM shield module. This device will be used as a device installed in the house and assists in sending messages that house owners and firefighters will receive to carry out an early evacuation immediately.

System Analysis
System analysis is a representation of the current system that aims to find out how the system works. It can also define and evaluate obstacles, opportunities, problems, or needs to be expected to propose improvements [14,15].

Running System Analysis
The current fire management system still uses conventional methods with assistance, where information related to fires is obtained based on field observations. The following are the steps in the fire handling process that are currently being carried out: 1.
The first step for the community or building owner is to detect a fire by looking at the smoke and flames coming from the building.

2.
The second step is the building owner/local community looking for contact information/phone number for firefighters.

3.
The second step is the building owner/community contacting the firefighters by telephone to ask for help (phone calls will continue until the firefighters are successfully contacted).

4.
The fire brigade responds to the community/fire victims. The current fire fighting process does not involve an early detection of fires so that actions are taken based on reports that a fire has occurred. Thus, it has been confirmed that a serious fire has occurred and property damage has occurred, and there may even be fatalities before the officers respond to fire information. Thus, it is necessary to involve a mechanism to be able to provide early warning information about a fire.

Proposed System Analysis
System analysis conveys the solution of an obstacle that happens in the running system [16,17].
In the analysis of the proposed system as shown in Figure 1, the fire detection and handling process are divided into 4 (four) stages which are all automated using a microcontroller based on Arduino Uno. The following is an explanation of the proposed system flowchart, as follows: 1.
In the first stage, the tool detects the presence or absence of a potential fire by measuring the temperature in the room using a temperature sensor.

2.
In the second stage, if the room temperature is detected above >45 • C, the system will activate the siren/alarm indicating a potential fire as well as sending a text message containing information on potential fires and also the coordinates for the detection of potential fires via the GSM module to the homeowner and also the fire department's office whose calling number has been registered on the device.

3.
The next step is if the detected room temperature is not more than 45 • C, the system will detect the potential for an explosion/or fire by measuring the level of LPG gas in the room using an LPG gas sensor.

4.
The next step is if it is detected that LPG gas spreading in the room is at 220 ppm, the system will activate the siren/alarm per sign of a potential explosion as well as send a text message containing information on the potential for an explosion to occur to the homeowner via the GSM module.

Requirement Analysis
There are two systems requirements analyses: the analysis of functional requirements and the analysis of non-functional requirements.
Functional Requirements: Analysis of functional requirements is stages or processes which will be provided by the system overall. The stages are as follows:

•
A short message will be sent automatically if the system has recognized a potential fire.

•
The system will send a short message to the house owner and the fire department containing the house fire location.
Non-Functional Requirements: Non-functional requirements are used in the form of hardware and software requirements, as shown in Table 1. The hardware and software specified in the following table are required to design this system: occurred and property damage has occurred, and there may even be fatalities before the officers respond to fire information. Thus, it is necessary to involve a mechanism to be able to provide early warning information about a fire.

Proposed System Analysis
System analysis conveys the solution of an obstacle that happens in the running system [16,17]. In the analysis of the proposed system as shown in Figure 1, the fire detection and handling process are divided into 4 (four) stages which are all automated using a microcontroller based on Arduino Uno. The following is an explanation of the proposed system flowchart, as follows:

Software Design
The software for the system design to be built is a context diagram (a description of the system designed), called DFD (Data Flow Diagram) level 0 [18]. The context diagram shown in Figure 2 is a general explanation of the entities involved. The entities in this system are the admin, community, and firefighters. The admin will input the data required to design this system and receive the information contained in the system. The citizens will receive notifications of gas leaks. Notification of house fires will be sent by text message and alarm if there is a fire. The fire brigade will receive information on the occurrence of fires and confirm fires in people's houses.
DFD (Data Flow Diagram) level 0 on the home fire detection system built is shown in Figure 3. In this perspective, there are three processes, 1.0-process, 2.0-tool checking, and 3.0-confirmation. The admin aims to input the data needed for the system configuration to be built and collected on the Arduino system. After the data is stored on the Arduino system, people only need to check the tools installed at their houses. The citizens will receive notification of gas leaks and potential fires that occur. The last process is when a house fire happens, the Arduino system will send information in the form of an SMS to the fire department, and then it will be confirmed that the fire incident occurred. and 3.0-confirmation. The admin aims to input the data needed for the system configuration to be built and collected on the Arduino system. After the data is stored on the Arduino system, people only need to check the tools installed at their houses. The citizens will receive notification of gas leaks and potential fires that occur. The last process is when a house fire happens, the Arduino system will send information in the form of an SMS to the fire department, and then it will be confirmed that the fire incident occurred.

Results and Discussion
The results of the research that has been done will be discussed clearly. Two subjects that will be explained are system implementation and system testing that has been done.

System Implementation
From the results of this research, there are three steps to designing a home fire detection system: the research concept, design of the device, and scheme of the program flow

Results and Discussion
The results of the research that has been done will be discussed clearly. Two subjects that will be explained are system implementation and system testing that has been done.

System Implementation
From the results of this research, there are three steps to designing a home fire detection system: the research concept, design of the device, and scheme of the program flow of the home fire detection system. Further explanation will be explained as follows: 1.
Research concept Research on the fire detection system that has been carried out uses two sensors for detection, the first is the DS18B20 sensor (temperature sensor), and the second is the MQ2 sensor (gas sensor). These two sensors are media to provide input to the Arduino microcontroller. The results that are inputted from the two sensors provide information to Arduino at the location. In the event of an unnatural condition (increased temperature and gas detected), Arduino will process the data to produce an output in the form of an alarm sound and provide information to homeowners and firefighters via short messages sent via the GSM module. This mechanism is a faster solution to find out the potential for a fire to occur in a building/house. This home fire detection system identifies the potential for a house fire, where the detection is carried out when receiving input from the DS18B20 temperature sensor and MQ2 sensor, then the data will be processed on the Arduino. If the heat exceeds the standard room temperature limit that has been determined, Arduino will instruct the GSM module to send a short message to the homeowner and the fire department regarding the potential that can cause a fire. This makes it easier for firefighters and homeowners to carry out rescues, thereby reducing the potential for greater casualties.

2.
Device design used The device used for the prototype of the Arduino-based home fire detection system and SMS gateway consists of the Arduino Uno microcontroller board, temperature sensor, gas sensor, buzzer, GSM module, power adapter, and power supply (battery). The following is a specification of each tool used: Tool design Figure 4 is a photo of a series of fire detectors that will be used to detect fires.
The following is an explanation of the function of each device used: • Arduino UNO R3: The function of Arduino UNO R3 itself is as the control and decision-making center of the fire detection system. The operation of the system is made from a program and then uploaded to the Arduino Uno R3 to be done so that the connected input and output devices can operate according to the previously uploaded program. • DS18B20 sensor: The function of the DS18B20 sensor is to identify the room temperature in the home fire detection system. After detecting an increase in temperature above >45 • C in the room, the data becomes the input for Arduino Uno R3 and further action will be taken for the next process. • MQ2 sensor: The function of the MQ2 sensor is to identify gas levels in the room. Detection of this sensor will be input for Arduino Uno R3 and further action will be taken for the next process.
• GSM module: The GSM function used in the design of this system is to send information in the form of a short message ordered by Arduino Uno R3 when Arduino gets input from both sensors, namely the MQ2 sensor and the DS18B20 sensor. • Buzzer: Serves as a warning so that homeowners can hear or be aware of the condition of the house. • Adapter 12 V-1 A: Serves to convert AC voltage to mid-DC, which provides power so that the Arduino Uno R3 and GSM modules can work properly. • 9 V battery: Serves to supply and provide electricity to the Arduino system and GSM module when the adapter does not work. In this step, the system will initialize the buzzer on the Arduino device, which will be applied for home fire detection and SMS gateway that functions as an alarm in the case of a fire.

•
Stage 5: Room temperature identification The fifth step is the DS18B20 sensor interpreting process when the detection system is on.

1.
Program flow design The program flow plan that has been performed on the design of a home fire detection system and the SMS gateway is more detailed, as follows:

•
Stage 1: Microcontroller initialization The first stage is the step when the home fire detection system and SMS gateway are operated. In this stage, when the Arduino system is ON, it will proceed to the next stage.

•
Stage 2: Initialization of DS18B20 and MQ2 sensors In this step, a prototype of a home fire detection system and an SMS gateway will discover room temperature and LPG gas in a room initialized on an Arduino device. Both of these devices will be available and set for the next stage.

• Stage 3: GSM module initialization
In the third stage, the system will initialize the GSM module on the Arduino device, which transfers short messages.

• Stage 4: Buzzer initialization
In this step, the system will initialize the buzzer on the Arduino device, which will be applied for home fire detection and SMS gateway that functions as an alarm in the case of a fire.

•
Stage 5: Room temperature identification The fifth step is the DS18B20 sensor interpreting process when the detection system is on.
Testing the process of identifying fire early warnings through the temperature sensor DS18B20, as shown in Figure 5 is performed as follows:

•
The initial stage is the presence of a fire source in a box that has been fitted with a heat detection sensor as shown in the photo in the chart above. The fire was lit for a while until the temperature in the room increased. The temperature sensor then detects an increase in room temperature, the temperature sensor will tolerate an increase in temperature up to 45 • C, if the temperature has exceeded that value (>45 • C), then the temperature sensor will send that value to the Arduino microcontroller board which then responds to the input by doing two actions at once. • The first action is the buzzer activation command. The buzzer will sound an alarm signaling a potential fire in the room.

•
The second action is an order to send a short message through the GSM model with the SMS gateway method to homeowners and fire officers, which contains messages in the form of information on potential fires and the coordinates of the potential fire points.

•
The system will again take temperature measurements and will not give orders to turn on the buzzer and send short messages if the detected temperature has not exceeded the value of 45 • C. Testing the process of identifying fire early warnings through the temperature sensor DS18B20, as shown in Figure 5 is performed as follows: • The initial stage is the presence of a fire source in a box that has been fitted with a heat detection sensor as shown in the photo in the chart above. The fire was lit for a Testing the process of identifying fire early warnings through the temperature sensor DS18B20, as shown in Figure 6 is performed as follows:

•
The initial stage is the presence of a gas source (LPG) in a box that has been fitted with a heat detection sensor as shown in the photo above. The gas valve is opened for a while until the gas fills the space/box. The gas sensor then detects an increase in the volume of gas in the room/box, the gas sensor will tolerate an increase in gas volume up to 220 ppm, if the gas volume has exceeded this value (>220 ppm), then the gas sensor will send the value to the Arduino microcontroller board which then responds to the input by performing two actions at once. • The first action is the buzzer activation command. The buzzer will sound an alarm signaling a potential fire in the room.

•
The second action is an order to send a short message through the GSM model with the SMS gateway method to the homeowner, which contains a message in the form of information on potential explosions/fires due to gas leaks.

•
The system will again measure the gas volume and will not give the order to turn on the buzzer and send a short message if the detected gas volume has not exceeded the 220 ppm value. Testing the process of identifying fire early warnings through the temperature sensor DS18B20, as shown in Figure 6 is performed as follows: • The initial stage is the presence of a gas source (LPG) in a box that has been fitted with a heat detection sensor as shown in the photo above. The gas valve is opened for a while until the gas fills the space/box. The gas sensor then detects an increase in Figure 6. LPG gas identification.

Sensor calibration test
Sensor calibration is the process of checking and adjusting the accuracy of the measuring instrument needed to ensure that the measurement results are carried out and are consistent with other tools. The calibration process is carried out to test for gas leaks using 3 (three) test scenarios based on the room/box comparison scale used to test the system.

•
The first scenario testing is on a scale of 1 to 75 MQ2 sensor calibration is sensor calibration with a gas lighter tool. This test was carried out with a room size of 4 cm wide, 4 cm long, and 5.3 cm high with a scale ratio of 1 to 75 from the original size. Tests at this scale will send a short message warning at a gas level of 270 ppm, which refers to the gas volume scheme in Table 2. When checking the DS18B20 sensor with a scale of 1 to 75, the system will immediately send an SMS because the standard room temperature ranges from 30.12 to 31.56 degrees, as shown in Figure 7.
Knowledge 2021, 1, FOR PEER REVIEW 11 of 16 • The system will again measure the gas volume and will not give the order to turn on the buzzer and send a short message if the detected gas volume has not exceeded the 220 ppm value.

Sensor calibration test
Sensor calibration is the process of checking and adjusting the accuracy of the measuring instrument needed to ensure that the measurement results are carried out and are consistent with other tools. The calibration process is carried out to test for gas leaks using 3 (three) test scenarios based on the room/box comparison scale used to test the system.

•
The first scenario testing is on a scale of 1 to 75 MQ2 sensor calibration is sensor calibration with a gas lighter tool. This test was carried out with a room size of 4 cm wide, 4 cm long, and 5.3 cm high with a scale ratio of 1 to 75 from the original size. Tests at this scale will send a short message warning at a gas level of 270 ppm, which refers to the gas volume scheme in Table 2. When checking the DS18B20 sensor with a scale of 1 to 75, the system will immediately send an SMS because the standard room temperature ranges from 30.12 to 31.56 degrees, as shown in Figure 7. This test is carried out with a room size of 6 cm wide, 6 cm long, and 8 cm high with a scale ratio of 1 to 50 from the original size, as shown in Figure 8. In this test, the system will send a short warning message at a gas level of 400 ppm, which refers to the gas volume scheme in Table 3. When checking the DS18B20 sensor with a scale of 1 to 50, the system will immediately send a short message because the standard room temperature ranges from 30.12 to 31.56 degrees. This test is carried out with a room size of 6 cm wide, 6 cm long, and 8 cm high with a scale ratio of 1 to 50 from the original size, as shown in Figure 8. In this test, the system will send a short warning message at a gas level of 400 ppm, which refers to the gas volume scheme in Table 3. When checking the DS18B20 sensor with a scale of 1 to 50, the system will immediately send a short message because the standard room temperature ranges from 30.12 to 31.56 degrees.

•
Testing the third scenario with a scale of 1 to 25 In testing the DS18B20 sensor, the scale used is 1 to 25. The standard room temperature to be tested is 45 degrees. When the temperature reaches 45 degrees, the system immediately sends a short message to the homeowner and the fire department. MQ2 sensor calibration is sensor calibration with a gas lighter tool. This test was carried out with a room size of 12 cm wide, 12 cm long, and 16 cm high with a scale ratio of 1 to 25 from the original size, as shown in Figure 9. Tests at this scale will send a short message warning at a gas level of 800 ppm, which refers to the gas volume scheme in Table 4. • Testing the third scenario with a scale of 1 to 25 In testing the DS18B20 sensor, the scale used is 1 to 25. The standard room temperature to be tested is 45 degrees. When the temperature reaches 45 degrees, the system immediately sends a short message to the homeowner and the fire department. MQ2 sensor calibration is sensor calibration with a gas lighter tool. This test was carried out with a room size of 12 cm wide, 12 cm long, and 16 cm high with a scale ratio of 1 to 25 from the original size, as shown in Figure 9. Tests at this scale will send a short message warning at a gas level of 800 ppm, which refers to the gas volume scheme in Table 4.    • Testing the third scenario with a scale of 1 to 25 In testing the DS18B20 sensor, the scale used is 1 to 25. The standard room temperature to be tested is 45 degrees. When the temperature reaches 45 degrees, the system immediately sends a short message to the homeowner and the fire department. MQ2 sensor calibration is sensor calibration with a gas lighter tool. This test was carried out with a room size of 12 cm wide, 12 cm long, and 16 cm high with a scale ratio of 1 to 25 from the original size, as shown in Figure 9. Tests at this scale will send a short message warning at a gas level of 800 ppm, which refers to the gas volume scheme in Table 4.    3 201-300 ppm or over 300 ppm Watch out This condition is possible when the gas finds the source of the fire, a fire will occur and an explosion may happen. 3 251-400 ppm or over 400 ppm Watch out This condition is possible when the gas finds the source of the fire, a fire will occur and an explosion may happen. 3 400-800 ppm or over 800 ppm Watch out This condition is possible when the gas finds the source of the fire, a fire will occur, and an explosion may happen.

Black box test
Black box testing is a method used to test the functionality of a system based on its functional requirements in order to find out whether a device or system is working properly based on pre-defined requirements, without having to know the internal structure of the code or program on the system being created.
In accordance with the calibration tests carried out above, it was explained that the system calibration testing was running as desired.
-MQ2 sensor interpretation went well, and output worked as planned. The system sends a short message to the homeowner. - In the DS18B20 reading test, the sensor can read and measure the condition of the room at the time of measurement in a standard temperature room and a hot room (>45 • C). The measurements taken have sent a short message to homeowners and firefighters. - The buzzer can work according to the instructions given, which is to sound an alarm when the room temperature reaches the maximum limit.

System test
This stage is testing the systems and tools that have been calibrated in the actual environment with the sizes as we have previously stated, namely based on the general size of the rooms in our area, both rooms and kitchens. The test scenario includes two parts, namely temperature detection and LPG gas detection. The following is a detailed test scenario: We use the JL-269-C gas pressure gauge to monitor the actual movement of gas pressure because the MQ sensor we use can only work at the lowest gas pressure of 220 ppm. Figure 10 is a test graph of the performance of the tool in the actual environment based on the above scenario.
-Gas source, 12 kg LPG cylinder -SNI standard regulator gas valve (Indonesian national standard) -JL-269-C. gas detector gauge We use the JL-269-C gas pressure gauge to monitor the actual movement of gas pressure because the MQ sensor we use can only work at the lowest gas pressure of 220 ppm. Figure 10 is a test graph of the performance of the tool in the actual environment based on the above scenario. Figure 10. Testing at room temperature to the heat limit >45 °C. Figure 11 shows the temperature moved slowly towards the threshold >45 °C, then the system responds by activating an alarm when the temperature is above the threshold. Based on the tests carried out in a more realistic environment, it can be concluded that the readings of the temperature detection sensor and the LPG gas detection sensor can work according to predetermined requirements, where the device successfully sends a short message and sounds an alarm. The testing time for detecting room temperature is  Figure 11 shows the temperature moved slowly towards the threshold >45 • C, then the system responds by activating an alarm when the temperature is above the threshold.
-Gas source, 12 kg LPG cylinder -SNI standard regulator gas valve (Indonesian national standard) -JL-269-C. gas detector gauge We use the JL-269-C gas pressure gauge to monitor the actual movement of gas pressure because the MQ sensor we use can only work at the lowest gas pressure of 220 ppm. Figure 10 is a test graph of the performance of the tool in the actual environment based on the above scenario. Figure 10. Testing at room temperature to the heat limit >45 °C. Figure 11 shows the temperature moved slowly towards the threshold >45 °C, then the system responds by activating an alarm when the temperature is above the threshold. Based on the tests carried out in a more realistic environment, it can be concluded that the readings of the temperature detection sensor and the LPG gas detection sensor can work according to predetermined requirements, where the device successfully sends a short message and sounds an alarm. The testing time for detecting room temperature is Based on the tests carried out in a more realistic environment, it can be concluded that the readings of the temperature detection sensor and the LPG gas detection sensor can work according to predetermined requirements, where the device successfully sends a short message and sounds an alarm. The testing time for detecting room temperature is longer, which is 60 min, while for gas detection testing, it is only 30 min because the time we need to heat the room is longer than the time to release gas into the room.

Conclusions
Based on the tests and outputs that have been carried out, it can be concluded that the design of an Arduino-based home fire detection system and SMS gateway can provide information on fires that occur quickly to homeowners and rescue fires to reduce losses and minimize possible fatalities. When tested in the actual environment, it runs as desired, with ten successful attempts to send SMS and sound the alarm. Thus, if the test is carried out in something similar to our test environment, then the system is expected to run according to what has been determined.