Design of IoT-Based Home Fire Detection System Equipped with a Data Logger

In Industrial Era 4.0, one of the solutions to secure a house from potential fires is to design a smart home. The smart home design described in this paper is the design of a home monitoring system for potential fires. Home fire early detection monitoring system is designed based on the IoT concept and is equipped with a data logger. Data loggers function as data logging and data recorders from time to time. The hardware system design consists of Arduino Mega2560, ESP8266, fire sensor, gas sensor and datalogger module as data storage. The software design that also functions as a system monitoring display is the Blynk application on Android smartphones. Fire sensor and gas sensor activities were recorded on the data logger module. The system test was carried out around the gas stove in the kitchen room. The system design results were displayed via the Blynk application on a smartphone. Fire detection system is a change in the Virtual Button from the initial color to red. While the monitoring display of the gas detection system is in the form of moving the Virtual Level when a gas leak is detected. Fire sensor activity recording data from the datalogger is displayed in the form of a graph of the relationship of the working voltage of the fire sensor versus time. While the data recording of gas sensor activity from the datalogger is displayed in the form of a graph of the relationship of gas concentration versus time. All system response results and graphic data are displayed in realtime through the Blynk application on a smartphone. In addition, system performance data records are stored on a micro SD card for further analysis. From the results of the design of this system is expected to be a reference of home monitoring technology from potential fire equipped with a data storage system.


Introduction
The presence of self-designed products especially home-based fire detection devices based on the concept of the Internet of Things (IoT) is a necessity that highly expected in the Industrial Revolution 4.0 era. The design of a smart home home fire detection system based on the IoT concept has succeeded in detecting the potential for fires through smartphones [10]. In the smart home design the system is connected online with a fire detection circuit. The system is able to detect potential fire emergencies and monitor in real time the kitchen room. The detection device prototype is assembled on a single board IOP Publishing doi: 10.1088/1757-899X/1125/1/012079 2 consisting of a fire sensor, gas sensor, ESP8266 as a Wifi connectivity module and a router/ modem. Research related to IoT design by utilizing Arduino Mega2560, ESP8266, various sensors and Blynk applications on smartphones has been conducted by Juwariyah T., et al [6]. The results of the IoT design research was monitoring the early detection of potential fire can be displayed through the Blynk application on a smartphone. The weakness of the detection system is that the system has not been equipped with a data logger which is a system of recording data or recording data from time to time. The existence of a data logger will facilitate the process of finding historical data recorded by sensors. The existence of the addition of a data logger to the detection system design further analysis of system performance can be carried out.

Literature Survey
Some studies related to smart home systems, among others, were conducted by M. Aluh Ashari [8], who conducted a study of "IoT Based Smart Home Systems Using NodeMCU". In that study, several home electronic devices such as home power plugs were controlled via smartphones. Another smart home study was conducted by Delebarre, C., et al regarding Wireless Low Cost CO 2 Monitoring System Design and Evaluation Using Non Dispersive Infrared Sensor [3]. Smart home study was conducted by Rajes Khana regarding the Design of an Internet-Based Home Security System with the Android Platform [9]. In this research a miniature house was built with a home security monitoring system with a PIR sensor to detect the presence of moving objects, an MQ-2 sensor to detect the presence of a gas leak and to control several devices related to a home security system such as lights and door lock solenoids to lock door. Monitoring and control is done through an application on an android device that is connected to the arduino UNO server and microcontroller. Firdaus, et al conducted research on "CO monitoring and early detection of LPG gas leaks in housing using WSN (wireless sensor network)" [5]. In this study CO gasses sensors and LPG gas sensors are monitored at several points (nodes). This means that sensors are monitored simultaneously. WSN is able to work well as long as the node receives radio waves emiition, the data received by the receiver matches the data sent by the transmitter. The GUI display monitoring system was designed using Visual Basic software on a PC.

Materials
The software and hardware components used in the system design are described below.

Arduino Mega2560 Microcontroller
The microcontroller is a microcontroller platform which is open development. Its easy to use and open source schemes (open source) make Arduino the right choice for anyone who wants to build electronics projects. At present various types of arduino have been produced such as Arduo Uno, Arduino Mega, Arduino pro mini, Arduino Yun and others. The Arduino Mega platform has pins that can be connected to other electronic circuits such that Arduino can control other electronic components, such as: LEDs, relays, wifii modules, GSM modules, power supply modules, and various types of sensors such as, gas sensors, fire sensors, smoke sensors, temperature sensors, humidity sensors, PIR, RFID and others [7].

ESP 8266
ESP8266is an embedded chip designed for wifi-based communication. This chip has a TTL and GPIO serial output. ESP8266 can be used alone (standalone) or combined with other controllers such as a microcontroller. ESP8266 has the ability to network that is complete and integrated both as a client and as an Access Point. There are so many ESP88266 firmware, an ESP8266 chip can be programmed with a special purpose as needed, for example the ability to communicate with the web using HTTPS ports [12]. The ESP8266 chip is enhanced by Tensilica's L106 Diamond series with a 32-bit processor. There are 3 ways to use ESP8266: as wifi access using AT command, which is usually used by Arduino for wifi IOP Publishing doi:10.1088/1757-899X/1125/1/012079 3 connections, as a stand-alone system using NodeMCU and using LUA language, as a stand-alone system using Arduino IDE that can already be connected with ESP8266. ESP 8266 can act as a client to a wifi router, so when configuration is needed, the name of the access point and password are also set, besides that ESP8266 can be used as an Access Point where ESP8266 can receive wifi access [2].

Data Logger Shield
The Data Logger Shield is a shield that is used to store data (data logging) where this shield is compatible with Arduino Uno, Duemilanove, Diecimila, Leonardo, Mega R3 / Mega R3 or higher but for ADK / MEGA R2 or lower is not supported. This shield is equipped with RTC (Real Time Clock) to maintain the time, even when the arduino microcontroller is unplugged. Backup battery lasted for many years.

Gas sensor
The MQ6 Gas sensor module serves to detect the concentration of flammable gases in the air. This sensor provides an analog voltage output. Based on the MQ6 sensor datasheet it can measure gas concentrations from 300-10000 ppm; operating at temperatures of -200C to 500C; consume 150mA current at 5V voltage. Concentrations of types of gas that can be detected include: LPG, butane, propane, methane, alcohol, hydrogen and smoke.

Flame Sensor
The flame sensor module functions to detect the presence of fire because it is sensitive to the presence of UV (ultraviolet) to IR (infrared) waves. The analog pin input voltage is 5 V while the digital pin input voltage is 3.3 V. The maximum distance to detect the presence of fire is 3 feet (± 90 cm).

Blynk
Blynk is one of the server service platforms used to support the Internet of Things projects. This platform is used in Android and iOS mobile user environments. The Blynk application can be downloaded on the Google play store. It supports a variety of hardware used for the Internet of Things project. Blynk is a digital dashboard with graphical interface facilities for making projects. It was created with the aim of remote control and hardware monitoring using internet or intranet data communication (LAN network). Blynk's ability to store data and display data visually using numbers, colors or graphics makes it easier for beginners to use in making projects of the Internet of Things. As shown in Figure 6 there are three main components of Blynk : Blynk Apps, Blynk Cloud Server and Blynk Library [1].

Arduino IDE
The Arduino integrated development environment (IDE) is an Arduino board programming language application that can operate on Windows, macOS, or Linux. Arduino IDE is written in functions from C to C++. Programs written using Arduino IDE are called sketches.

Proposed Architecture
The block diagram of the fire detection system design is presented in Figure 1.

Algorithm
The algorithm of home fire detection system is as shown in Figure 2. The algorithm is coded in Arduino IDE.An algorithm that explains how the system works is presented in Figure 2. Based on the algorithm, it appears that the initial sensor condition is HIGH meaning that when there is no stimulation of fire or gas the highest voltage sensor has the highest value. When there is a fire or gas stimulation, the voltage of the sensor drops in value. This is in accordance with the concept of physics related to the law of conservation of energy, which means that when the sensor does work in the sense of responding to stimuli, the potential difference in the conductor ends on the sensor decreases. In other words when the sensor is working (positive) the electric potential energy decreases (negative) represented by the voltage difference. Figure 3 presents the results of the IoT hardware prototype home fire detection monitoring monitoring system. As shown in Figure 10, the main control is on the Arduino Mega 2560 board. Meanwhile, the ESP 8266 board functions as a client of the WiFi Router that Arduino Mega2560 uses for WiFi access through the AT command. One of the advantages of Arduino Mega 2560 is the availability of many analog pins, making it suitable for further development designs. This means that if in the future more analog sensors will be added to complete the design of the fire detection system or other smart home systems, there will not be too many pin configurations. Another advantage of the Arduino Mega 2560 is that the board provides many other pins for system development such as the availability of an additional three pairs of ports for serial communication (Tx/Rx). In the IoT prototype as shown in Figure 3 the fire sensor is connected to digital pin number 22 and the gasses sensor is connected to analog pin number 15 on the Arduino Mega 2560 board. The pin number determination is determined according to the hardware placement configuration conditions, in addition to that the wiring looks more presentable. Under different hardware configuration conditions the Arduino Mega 2560 pins may also change. The thing to note is that the fire sensor is connected to the DIGITAL PIN and the MQ6 gas sensor is connected to the ANALOG PIN.

. The Results of System Performance Data Collection
Cases of house fires often occur starting from the kitchen. The fire occurred due to the presence of LPG gas which was not detected and triggered by sparks from the gas stove. The chronology of the fire case is simulated with an inverse approach, in the sense that the process of taking fire data takes precedence for reasons of work safety. Retrieval of system performance data is done separately. First, the fire sensor performance data collection is presented as shown in Figure 5.a. Meanwhile, Figure 5.b presents the display of the detection system GUI through the Blynk application on a smartphone. In the Virtual Button application it lights up red, indicating the performance of the fire sensor when the candle flame (for example a fire flame) lights up. The results of the system response to the retrieval of data variations in the distance of the fire source from the fire sensor produces an average response time of (3.3 ± 1.0) seconds. System response time indicates the length of time the system responds and processes light stimuli in the form of a decrease in sensor voltage when responding to a stimulus. Figure 5.b appears the Virtual Button is red which indicates the system detects fire. On the right side of the Virtual Button appears Virtual Level moves to the left which means the fire sensor voltage drops. When fire sensor detects a fire the fire sensor voltage is in the LOW logic condition as explained earlier in the algorithm work system. Meanwhile, the graph of the flame sensor working voltage vs. time function is displayed continuously during data retrieval. From the graph, it appears that during the fire sensor working voltage recorded by the datalogger for one day shows the graph rises and falls in the LOW voltage condition range. Different things are shown in Figure 6 when the fire sensor does not detect fire, the graph as long as the data collection is always constant, which is in the HIGH voltage condition.  Figure 6.a shows the process of collecting gas sensor performance data. Retrieval of gas detection data is done by placing an open plastic bottle both ends. One end of the bottle is placed around the gas stove burner. The plastic bottle functions as a tube or pipe that can hold and contain gas, while the other end of the bottle's mouth is attached to the MQ6 gas sensor. In this way the gas is expected to be confined and when the gas concentration in the pipeline has passed the tolerance threshold set by the system algorithm, the system will respond to the presence of the gas. The results of the system response appear in the form of the Blynk application, especially the display of the Virtual Button changes color and the virtual level experiences an increase in gas concentration as shown in Figure 6.b. The graphs of the values of the gas concentration over the time recorded by the data logger during data collection appear to have increased linearly.

Conclusion
Smart home in the form of an early detection system for potential home fires can be designed and built based on the IoT concept. The system design is an integration of hardware and software assembly consisting of Arduino Mega 2560, ESP8266, datalogger, fire sensor, gas sensor, Arduino IDE and the Blynk application on an Android smartphone. The results of the system design are able to work and show the system's response to the presence of fire and the presence of gas leaks in the kitchen. The system design results are displayed via the Blynk application on a smartphone. The system performance towards the presence of fire is indicated by changing the detection of fire in the form of changing the Virtual Button from the initial color to red. The display of a gas detection system in the form of a Virtual Level moves when a gas leak is detected. Fire sensor activity recording data from the datalogger is displayed in the form of a graph of the relationship of the working voltage of the fire sensor versus time.
While the data recording of gas sensor activity from the datalogger is displayed in the form of a graph of the relationship of gas concentration versus time. All system response results and graphic data are displayed in realtime through the Blynk application on a smartphone. In addition, record system performance data stored on the micro SD card for further analysis. From the results of the design of this system is expected to be used as a reference technology for home monitoring of potential fire equipped with a data storage system.