Buletin Ilmiah Sarjana Teknik Elektro         ISSN: 2685-9572

Design and Implementation of an IoT System for Indoor Measurement and Monitoring Fire and Gas Warning

Nguyen Van Tri 1, Le Hung Manh 2, Ha Duyen Trung 1

1 Hanoi University of Science and Technology, No. 1, Dai Co Viet str. Hanoi 100000, Vietnam

2 Vietnam National Defense Television, 165 Xa Dan, Dong Da, Hanoi 100000, Vietnam

ARTICLE INFORMATION

ABSTRACT

Article history:

Received 30 June 2024

Revised 12 August 2024

Published 15 August 2024

A green circuit board with wires and wires

Description automatically generated

Early detection and warning of fires occurring in homes is crucial to prevent loss of life and property. Fires can happen anywhere and at any time, but the presence of fire alarms helps keep homes safe. Therefore, early detection of fires will prove to be crucial as it could mean the difference between life and death. Most recently, the Internet of Things (IoT) technology has been deploying for data collection, transmission, storage and processing of large amounts of data from various sensor devices. Through the Internet, these sensors can be linked and help us manipulate or collect data from them. In this paper, we will use various types of sensors to sense the presence of fire and gas in the design and implementation of a completed IoT system. The designed IoT system aims to alert and assist homeowners, building guards, and firefighters about the presence of fire and gas leaks. Additionally, a common preventive solution is to install a sprinkler to spray water when the smoke sensor detects a fire. The designed system has been successfully implemented and tested in a variety of circumstances in an education bulding of University.

Keywords:

IoT;

ESP32 Processor;

SIM900a;

MQ2 Gas Sensor;

DHT11 Sensor;

Flame Sensor;

Fire and Gas Warning

Corresponding Author:

Ha Duyen Trung, Hanoi University of Science and Technology, No. 1, Dai Co Viet str. Hanoi 100000, Vietnam.

Email: trung.haduyen@hust.edu.vn 

This work is licensed under a Creative Commons Attribution-Share Alike 4.0 

Document Citation:

N. V. Tri, L. H. Manh, and H. D. Trung, “Design and implementation of an IoT system for indoor measurement and monitoring fire and gas warning,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 6, no. 2, pp. 190-202, 2024, DOI: 10.12928/biste.v6i2.11254.


  1. INTRODUCTION

By September, fire and explosion statistics in 2023 showed that the number of fire and explosion incidents nationwide reached 198 with 63 deaths and 46 injuries. Total estimated property damage was 9.8 billion VND and 19 hectares of forest. The pace gradually calmed down in October of the same year with 152 fires, 6 deaths and 2 injuries, and damage of 19.26 billion VND [1]. Also during the same period, there were 2 consecutive explosions nationwide, killing 1 person and injuring 2 others. According to the survey, the fire and explosion situation in residential areas and family homes currently accounts for the highest rate. Fires often occur at night or on holidays. In addition, the main cause of current fires and explosions is due to people’s subjectivity in using fire sources, heat sources, using electrical equipment, and manufacturing and trading flammable goods in the home but not ensuring compliance with safety conditions on fire prevention and fighting standards. This leads to fire and explosion incidents, and because they are not detected in time, they lead to widespread fires.

Current statistics on fire and explosions in Vietnam show that the number of fires, casualties, and total property damage caused by fires are showing signs of increasing significantly over the years, especially in 2023. According to data from the Fire Prevention and Fighting Police Department and Rescue, in 2023, there were 3,440 fires nationwide, killing 146 people, injuring 109 people, causing damage of about 8,767 billion VND and 236 hectares of forest. Also in 2023, there were 16 explosions, killing 11 people and injuring 27 people. Compared to 2022, the overall number of fires has increased significantly. Specifically, the number of fires in 2023 increased by 206 cases (6.3%) compared to 2022, the number of deaths increased by 27 people (up 22.69%), the number of injuries increased by 19 people (up 21.11%) and property damage increased by 244 billion VND (equivalent to an increase of 38.4%). In particular, the number of explosions decreased by 2 cases (11.11%), the number of deaths due to explosions increased by 1 person (10%), the number of injuries decreased by 2 people (down 6.9%). The contrasting picture of just 2 years 2022 and 2023 has helped us have a more general view of the current fire and explosion situation in Vietnam today, showing that the casualties are increasing every year with the danger of fire and explosion [2].

Mentioning the fires in 2023, it is impossible not to mention a serious fire in Hanoi that shook public opinion for many days. The fire occurred on the night of September 12 at a mini apartment building on Khuong Ha Street, Khuong Dinh Ward, Thanh Xuan District, Hanoi. Starting from just a small electrical problem, the fire gradually spread, burning down the entire house and affecting the households living there. As a result, up to 56 people died and 37 were injured in this tragic fire. Along with that were other huge losses in spirit and property of those who remained [1].

Faced with the current fire and explosion situation, more than ever, each of us needs to raise our sense of responsibility and proactively prevent fire and explosion risks that can occur at any time. In particular, it is necessary to propose reasonable prevention plans, control well the fire prevention and fighting situation in residential areas and around where we live, and stop the risk of fire and explosion that may arise [3]. To ensure fire safety in the current context, we need to raise awareness and responsibility for fire prevention. Various common fire prevention measures today such as: (1) Use electrical equipment properly, turn off all electrical equipment when going out; (2) Regularly check and maintain electrical equipment: Some electrical equipment after many days of use will lead to damage, short circuits that are not safe for users and are a potential hazard causing fire and explosion; (3) Use quality fireproof materials for residential buildings and workplaces to minimize the risk of fire and explosion in buildings. At the same time, significantly reduce the consequences for property and people when a fire or explosion occurs; (4) Equip fire alarm systems and fire prevention equipment in living areas and workplaces; and (5) Promote propaganda activities on fire prevention and safety for people. Local authorities need to continuously promote fire safety and organize training sessions on fire prevention in the area.

Fire is the rapid oxidation of substances during chemical combustion, releasing light, heat and various reaction products. A well-planned fire suppression system can save millions of dollars by preventing the destruction of fires, as well as saving lives. Therefore, it is necessary to install adequate fire prevention and detection systems in households. However, current fire suppression systems have many shortcomings, among them frequent false alarms and no historical data storage [4].

Fire and gas detection and alarm systems are essential aspects of fire control and prevention of escalation. The purpose of fire alarm systems is to provide guidance on appropriate methods and technologies for fire detection and the primary objective of fire suppression systems is to provide the required water/foam on demand in sufficient quantity and pressure in a timely manner to limit or prevent the spread of fire, avoid risk to life, protect the environment and minimize material damage [5].

Because fire alarm systems are essential in providing early warning in the event of a fire and can help save lives and protect property while meeting the needs of insurance companies and government departments. Fire alarm systems typically consist of several interconnected components, such as smoke detectors, heat detectors, carbon monoxide detectors, manual call points, and sirens. Fire alarm systems must provide immediate information to prevent the spread of fire and protect life and property [6]-[9].

The remaining of this paper is organized as follows. First, variuos studies on IoT system related to safety issues including advantages and disadvantages of each approach will be summarized in Section 2. Second, the proposed IoT design of the safety management system including hardware, softeware design, printed circuit board design as well as its components and its operation will be detailed in Section 3. Third, implemental results and discussion will be highted in Section 4. Finally, conclusions, recommendations and future work will be drawn.

  1. LITERATURE REVIEW

Fire disasters in many residential, commercial and industrial places are of great concern as they can cause huge damage to infrastructure as well as human life. Therefore, early detection of fire and notification to the competent authorities for timely extinguishment to protect lives and valuable assets is a very important task. A real-time automatic intelligent fire detection system integrated with wireless sensor network (WSN), Internet of Things (IoT) and artificial intelligence (AI) can solve this problem [10]-[19]. In [10], a literature review on the capabilities of wireless sensor networks through the use of various intelligent algorithms using IoT for fire detection purposes was conducted. In [11], WSN based systems developed for monitoring and detecting damages to pipelines as well as other assets of oil and gas industry is comprehensively reviewed and detailed comparison of the most recent systems or techniques developed for monitoring various anomalous events. This work also enumerated issues and challenges in the oil and gas industry. By using the advent of the Internet of Things (IoT), the implementation of system incorporating IoT sensors is constructed in this study to collect data (heat, the number of people at the fire scene, ...) that allows early managing of fires to avoid material and human losses is presented in [12]. This system provides a control panel that displays readings from all sensors on a single web page that can keep track of how many people are at the fire scene, simplifying the evacuation process and allowing civil defense authorities to efficiently manage resources.

In addition, the system proposed in [13] allows user to monitor the building’s status remotely via a friendly dashboard that provides the data of all the parameters in a single page. Whenever a collected parameter crosses its threshold, a buzzer, a red light, and a message sent to the mobile phone alerts the homeowner. Then, he can immediately contact the authority or firefighters to come instantly. One significant advantage of this system is that it counts the number of people present in the fire scene. However, theses system does not have a direct warning system to users via mobile phone.

In [14], an innovative system architecture based on the use of technologies enabling the IoT is presented. This sys tem consists of sensors, mobile devices, Cloud technologies, mobile Apps, and embedded devices have been designed and developed in the SAFETY project, providing a smart decision support system able to promptly guide rescuers to the critical points of the building where there is the certainty that there are users to be rescued or artworks to be kept safe, without wasting resources.

In the context of building cloud-based IoT platforms for crisis scenarios management, that designed to be fully configurable and adaptable in different operating environments. The middleware framework proposed in [15] allows to perform antomatically actions based on raw data received from the sensor networks. In addition, the associated knowledge base allows you to define even rules inside the operating environment. The implementation results in [15] captures data from a network of sensors based on the Arduino platform (prototype development platform) by exploiting an embedded system as Raspberry sends all data into the Cloud. In [16], an IoT enabled advanced forest fire detecting and monitoring on Ubidots platform is proposed using ESP32 board and rain sensors, sound sensor, DHT11 sensor, PIR sensor. The platform can be applied to stop the spreading of forest fires the main part of stopping forest fires is the detection of Australian forest fires. Database performace evaluation and application of IoT platform analysis for monitoring management can be found in [17].

The cloud-enable IoT based embedded system and software development is proposed in [18] for indoor lighting, ventilation, early stage fire detection and prevention with HTTP protocol based real-time monitoring through smartphones or PCs. This system capable of sensing human presence to control the lighting and monitoring humidity, temperature, , and smoke to ensure efficient ventilation and accidents caused by fire and smoke. Moreover, the designed system can log real-time sensor data into a cloud server through which the client can also monitor real-time data from anywhere in the world. Most recently, authors in [19] designd and implementd IoT end devices and IoT gateway based on open hardware platform for data collection and control of measuring and monitoring IoT devices. In addition, the work build an open-source IoT cloud platform to support device management, data storage, processing, and analysis for applications of industrial parks.

The results from the multiple IoT sensors can be analyzed and processed by the AI algorithms. The results of the analysis are then used to perform alerts and support tasks depending upon the severity of the fire, such as while detecting the level of smoke in air [20]. In the work in [21], the authors proposed a vision-based fire detection and notification system using smart glasses and deep learning models for the blind and visually impaired (BVI). The system enables early detection of fires in indoor environments. To perform real-time fire detection and notification, the proposed system uses image luminance and a novel convolutional neural network using an improved YOLOv4 model with a convolutional block attention module. The h-swish activation function is used to reduce the running time and increase the robustness of YOLOv4.

The mentioned works above, however, have not gone into detail about the overall design description, detailed hardware and software design, electronic circuit design and user mobile phone application for fire warning. This study develops an IoT technology application to prevent fire and explosion caused by gas leakage from the kitchen space. This technology meets the needs of low-income families, the installation equipment is cheap, easy to buy and install in households. The IoT system includes a hardware and software module. The hardware uses an ESP32 microcontroller connected to temperature and gas sensors. The software is an application on the mobile phone. The research contributions include: (1) to propose the low-cost IoT system design for data collection, transmission, storage and processing of large amounts of data from various sensors for purposes of monitoring and warning gas and fire in buildings in city of Vietnam; (2) to implement the system in both hardware and software perspectives for the situations of  providing guidance on appropriate methods and technologies for fire detection and the primary objective of fire suppression systems is to provide the required water/foam on demand in sufficient quantity and pressure in a timely manner to limit or prevent the spread of fire, avoid risk to life, protect the environment and minimize material damage.

  1. THE PROPOSED IOT SYSTEM DESIGN

  1. System Overview

In this subsection, an overview of the functional blocks in the electronic circuit is firstly presented. Then, a detailed analysis of the design, solution selection, and completion of each module of the circuit is presented. The printed circuit layout and product model are also presented in this section.

Figure 1 presents the block diagram of the IoT system for gas monitoring and warning using 4G communication networks. The IoT system designed for fire and gas monitoring and warning consist of various blocks. The function of each block can be explained as followings. The power block uses 12 VDC to supply from 12V adapter via the DC Jack to the Voltage conversion block. This block converts the 12 VDC to 5V voltage level to supply Microprocessor. The central processing block uses ESP32 dev kit module to control and communicate with sensors. This module is used for wireles data communication between IoT devices and cloud server. To monitor various environment parameters, we uses some type of sensors. The DHT11 sensor measures environmental temperature and humidity parameters. The SIM900a module is used for calling and warning to phone when fire is detected. The MQ-2 gas sensor is used to detect gas leakage,  gas. This module is also used to detect the concentrations of of LPG, Alcohol, Propane, Hydrogen,  and methane, , smoke, and . The flame sensor block (fire sensor) is used to detect the fire. Other module such as the  relay and Siren blocks are used to turn on the fan when detecting gas leakage and to sound a warning when detecting gas or fire, respectively. The detail description of the proposed system can be explained as follows.

Ảnh có chứa văn bản, ảnh chụp màn hình, Phông chữ, Giấy nhớ

Mô tả được tạo tự động

Figure 1. Block diagram of the proposed IoT system for gas monitoring and warning using 4G communication

Firstly, the system consists of microprocessor ESP32 that is one of the most important component [22]. ESP32 is a microcontroller that falls into the category of low-power and cost-effective microcontrollers on a chip. Almost all ESP32 variants integrate Bluetooth and dual-mode Wifi, making it highly flexible, powerful, and reliable for a wide range of applications. It is the successor to the popular NodeMCU ESP8266 microcontroller and offers better performance and features. The ESP32 microcontroller is manufactured by Espressif Systems and is widely used in various applications such as IoT, robotics, and automation. The ESP32 is also designed to consume low power, making it ideal for battery-powered applications. It has a power management system that allows it to operate in sleep mode and only wake up when necessary, which can greatly extend battery life.

Comparing the ESP32 microcontroller with other microcontrollers, one of its significant advantages is that it has built-in Wifi and Bluetooth modules. While some microcontrollers can add Wifi through shields or adapters, it is not a native feature of the board, which increases the cost of the board. In contrast, the ESP32 comes with built-in Wifi and Bluetooth modules, making it a more cost-effective option for those interested in using these features.

Furthermore, adapters for Wi-Fi and Bluetooth are often expensive, which can be a challenge for hobbyists or small-scale projects. Meanwhile, the built-in Wifi and Bluetooth modules of the ESP32 provide greater flexibility, robustness, and reliability in a wide range of applications, such as IoT, MQTT-based gateways, MP3 decoding, voice encoding, and video streaming. Additionally, the ESP32 comes with a USB port, making it a plug-and-play device that can be programmed like other microcontrollers, with programming details to be discussed later.

The ESP32 microcontroller provides pin multiplexing which allows us to choose which peripheral to connect from the 28 input/output pins. This feature gives us the flexibility to decide which pins we want to use for which peripherals such as MISO, RX, SCLK, MOSI, TX, SCL, SDA and several other options. However, some pins for the analog to digital converter and digital to analog converter are reserved for these peripherals and cannot be configured as per the user’s requirements.

To power the ESP32 development board, we have the option of using the USB port or a LiPo battery. When both power sources are connected, some development boards have a built-in charge controller to charge the LiPo battery. Furthermore, the board has a 3.3 voltage regulator that can supply 600 mA of current. During RF transmission, the board can consume up to 250 mA. It is important to note that the general-purpose input-output pins cannot handle 5V, and therefore, level shifting is required to interface the board with 5V.

To program the ESP32 board, we can use the Arduino IDE. However, certain drivers and libraries must be installed to make it compatible with the IDE and ready to use. Here is a brief explanation of the required drivers and libraries.

Secondly, when the gas leakage comcentration reaches the threshold values used the software program, the signal will send an SMS alert to the user. Therefore, the user will be able to aware of the situation and takes necessary action to prevent the damage. SIM900A module is GPRS/GSM module operating as mobile phone. The module uses 900 and 1800MHz frequency bands to allow users to receive/send mobile calls and SMS messages. The keypad and display interface allow developers to create custom applications. Moreover, it also has modes like command line mode and data mode. In each country, GPRS/GSM and protocols have different operating frequencies. The command line mode helps developers to change the default settings according to their requirements. The GSM modem comprises of a GSM module along with other components such as interface, power supply and some idicators.

SIM900A module looks like a single chip but it has a wide range of features that can help build most of the commercial applications [23]. Although, there are a total of 68 pins but using these pins will help design the desired applications. But we will need less pins when communicating with Arduino. Below is its pinout. GPIO pins help to perform simple and advanced I/O functions. All the pins give a maximum output equal to the power supply which can be used to drive most of the devices like sensors and other modules. The first pin indicates the working status of the module and the second pin is the communication status. The network status means that the module is connected to the network or other network functions, etc. Both of these pins cannot be used directly with LEDs, it must be through a combination of transistors. There are 4 pins for data display communication. The display is not required, only in case of necessity. Using the interface helps to visualize the module and turn it into a real application.

SIM900A has many types of protocols and I2C is one of them due to its popularity. The module has a single I2C communication pin, which helps to design applications with any module that has that interface. There is a two-pin keyboard that can communicate with the module. The module will get data from the keyboard in the form of 2D matrix values ​​from the KCB pins corresponding to each value. UART protocols use two pins for data communication, which are RX and TX. Both pins are not independent in any pin or module. In SIM900A these pins are available but it also has some other pins that indicate the data status. By combining these pins, it will create an RS-232 connector.

Debug helps developers to debug the module and update its firmware. In this module, there are separate serial data communication pins for debugging. The module needs some devices to implement its features. SIM needs to connect to the module for GPRS / GSM positioning function. The module has only one pin to detect and convert analog to digital signals for SIM900A. The voltage range on ADC pin is only from 0V to 3V. These are important pins in microcontrollers for industrial applications but due to IoT, the module has two PWM pins for IoT application and operates in PWM mode without using a third interface.

The audio interface will help to connect the microphone and speaker to the SIM900A. The audio and speaker wire connection will make calls through the modules. The PWRKEY pin requires a cross logic signal to power the system on/off. To do this, the pins require a long input signal. The second pin is PWRKEY_OUT which short circuits with the PWRKEY pin to power the device on/off. To extend the communication range of the SIM900A, the antenna pin needs to be connected to an external wire. Genuine antennas are also available for the module. The SIM900A module has several types of power pins. Some act as inputs and some act as outputs. The most important one to understand is the VRTC, which acts as a backup for the device's internal RTC.

  1. Hardware Design

The schematic diagram of the entire circuit is illastrated as in Figure 2, components in ecach block and connections between pins of each electronic devices can be clearly explained as followings.

Ảnh có chứa văn bản, ảnh chụp màn hình, biểu đồ, số

Mô tả được tạo tự động

Figure 2. Schematic diagram of the entire circuit

  1. Software Design

In this work, the Arduino IDE platform will be used for programming the ESP32 [26]. Specifically, the Arduino IDE is an open source platform based on hardware and software, allowing us to build projects. By combining the advantages of both the ESP32 and Arduino IDE platforms, the electronic projects or IoT projects can be easily built, through the wireless connectivity of the ESP32 and the easy development of the Arduino. The projects can be developed for monitoring, remote control of devices, smart home automation systems, network systems with many sensors, etc. Figure 3 shows the general flowchar of ESP 32 processing. It can be explained as folowing steps.

When connecting the device to the computer, the results displayed on the Serial Monitor will show notifications that the device is connected to Wifi, ThingsBoard, and Firebase, if successful, will transmit data. It will then read data from the sensors used, including a DHT11 sensor to measure temperature and humidity, a gas sensor, and a fire sensor. If the gas concentration exceeds the threshold, the siren and fan will be activated and send warning data to the user. If a fire is detected, the system will activate the siren and make a warning call via SIM900A module. Temperature, humidity, and gas data are displayed on the OLED screen and sent to cloud and Firebase for storage and monitoring.

Ảnh có chứa văn bản, biểu đồ, ảnh chụp màn hình, Phông chữ

Mô tả được tạo tự động

Figure 3. General flowchart of ESP32

  1. PCB Design

Design the printed circuit board to fit the size of the device box and optimize the space for the sensors. The sensors are arranged in a position to easily perform the functions. The sensors must operate stably after soldering the circuit. The device must be easy to disassemble for replacement and repair. Figure 4 showns the printed circuit board (PCB) of the IoT device that has a size of 127mm×86mm to fit the size of the frame inside the box. Figure 5 showns the 3D simulation of the IoT device

A red circuit board with black lines and dots

Description automatically generated

A blue circuit board with black dots and circles

Description automatically generated

(a) Top layer printed circuit board

(b) Bottom layer printed circuit board

Figure 4. The PCBs of the IoT device

A green circuit board with many different components

Description automatically generated

A green circuit board with many small circles and wires

Description automatically generated

(a) Top layer printed circuit board

(b) Bottom layer printed circuit board

Figure 5. The 3D simulation of the IoT device

  1. IMPLEMENTATION RESULTS AND DISCUSSION  

  1. Overal Iot Device for Gas and Fire Warning

This section presents an results of the design and fabrication results of the IoT device and software application for monitoring and visualization. We also testing scenarios for the device’s performance and evaluation. Figure 6 shows the pannel of the IoT device whereas the completed IoT device is shown in Figure 7.

A green circuit board with white text

Description automatically generated

A green circuit board with many small holes

Description automatically generated

(a) Front Panel PCB

(b) Back side printed circuit board

Figure 6. The pannel of the IoT device

A green circuit board with wires and wires

Description automatically generated

A black rectangular device with a small display

Description automatically generated

(a) Inside the device

(b) Equipment after completion

Figure 7. The completed IoT device

Costs of the designed IoT prototype device can be listed in the Table 1. The cost of making the IoT device hardware circuit to measure and warn of gas is 320 000 VND. It equivalents to $12.75. Comparing to the commercial product of AS1800 Gas Leak Detector of 2700 000 VND ($107.39) [27], the prototype IoT device is very low-cost that meets the needs of low-income families, the installation equipment is cheap, easy to buy and install in households.

Table 1. Product costs of modules for design IoT device

Module

Cost (in VND)

ESP32 Module

75 000

sim900a Module

60 000

gas sensor MQ-2 Module

20 000

Temperature humidity sensor DHT11 Module

15 000

Infrared sensor module

10 000

Buzzer Module

10 000

relay Module

10 000

Circuit

30 000

Box

15 000

OLED

35 000

Power 12V

20 000

IC LM2576, Inductor, Capacitor

20 000

Total

320 000

  1. Testing Scenarios and Performance Evaluation

The device can be placed in rented rooms, kitchens, parking areas, places where fires may occur. After plugging in the device, the OLED screen will display the environmental parameters and gas level, and the app will also display the same parameters as on the OLED screen (Figure 8). The gas level always fluctuates from 1 to 4 because the analog signal output level of the MQ-2 gas sensor module always fluctuates between 70-170. When detecting gas leakage or smoke, the maximum output level of the oscillation signal is 4095.

Ảnh có chứa đồ điện tử, đồ phụ tùng, Điện thoại di động, Thiết bị điện

Mô tả được tạo tự động

Figure 8. The IoT device and mobile application

The formula for converting the analog signal level of gas to gas level can be expressed (1). Where, Value is the Value read from the gas sensor (0-4095), FromLow is the 0 (minimum value of analog MQ-2), FromHigh is the 4095 (maximum value of analog MQ-2), ToLow is the 0 (minimum value of Gas), and ToHigh is the 100 (maximum value of Gas).

(1)

Testing of popular gas alarm devices on the market shows that with low manufacturing costs, household users can easily access them. However, these popular gas alarm devices are not highly reliable. In order to limit the situation of "false alarms" similar to popular gas alarm devices, a sensor error compensation function was built. The cause of this phenomenon was determined to be that the above warning devices do not have a gas sensor error compensation function.

First, we tested the fire alarm function on the device. When the gas level or smoke concentration is greater than 10, the oled screen will display the gas level, smoke concentration and the words “WARNING!”, along with a warning sound and the fan will turn on at the same time. The phone screen will also display the gas level and the message “WARNING” and turn red to warn of a gas leak or high smoke concentration.

Then, Figure 9 shows the status safe and warning application interfaces. When the temperature is less than 35 degrees Celsius, the humidity is greater than 50% and the gas level is less than 10, the interface on the phone will be green and the message will be displayed as “SAFE”. When the temperature is greater than 35 degrees Celsius and less than 40 degrees Celsius, the humidity is less than 50% and greater than 40%, the temperature and humidity interface on the phone will be yellow.When the temperature is greater than 40 degrees Celsius, the humidity is less than 40% and the gas level is greater than 10, the interface on the phone will be red and the message will be displayed as “WARNING!”.

A screenshot of a weather app

Description automatically generated

A screenshot of a weather forecast

Description automatically generated

Figure 9. The status safe and warning application interfaces

The device will display temperature, humidity, gas level and device location on an open platform (Thingsboard). It will send an alert when the temperature is higher than 30 degrees Celsius, the gas level is higher than 10 and the humidity is lower than 40%. Thingsboard will save the environmental data (Figure 10).

When detecting a fire, the oled screen will display “CANH BAO CO CHAY!”, emit a warning sound and immediately call the phone to report the fire. The output signal level of the fire sensor is 4095. When detecting a fire, the signal level is different from 4095. From there, it is easy to identify the fire.

Finally, the device has high quality and stable operation. The accuracy of the device after calibration meets the requirements. The error of the measuring sensor and components does not significantly affect the quality of the device.

Experimenting with the IoT device to detect gas leaks during the testing period did not detect any “false alarms” like the common gas alarm devices on the market. In addition, with the mobile phone application software, users can continuously monitor the gas status and temperature in the kitchen space, helping them feel more secure about the risk of fire and explosion.

A screenshot of a computer

Description automatically generated

Figure 10. Visualization of monitored data on the open platform

  1. CONCLUSION

Early detection and warning of fires occurring in homes is crucial to prevent loss of life and property. Fires can happen anywhere and at any time, but the presence of fire alarms helps keep homes safe. The solution of applying IoT technology in fire prevention for households is deployed in this paper. The hardware of the IoT device includes the ESP32 microcontroller connected to the SIM900A communication module, the DHT11 temperature sensor and the MQ2 gas sensor, which are all component modules that are easy to find in the domestic market. The application software on smartphones allows users to continuously monitor the gas status and temperature in the family kitchen. The verification experiments show that the IoT device works effectively, providing continuous information to users and timely warnings when the gas concentration and temperature in the kitchen exceed the set threshold. For the future research and development, optimizing the layout design to make the circuit compact, minimizing the use of modules, improving sensor sensitivity, integrating with other smart home systems, and expanding the system’s functionality to include other types of emergency detection. Some development modules and interact directly on the circuit such as fine dust sensors, rain sensors, etc will be developed. The app interface to be harmonious, eye-catching, and easy to use for users should be improved and then the prototype product can be commercialized to the market.

REFERENCES

  1. V. H. Vu, “Financial Services in Vietnam,” The Economy and Business Environment of Vietnam, pp. 111-132, 2020, https://doi.org/10.1007/978-3-030-49974-7_6.
  2. K. A. Nguyen, Y. A., Liou, and J. P. Terry, “Vulnerability of Vietnam to typhoons: A spatial assessment based on hazards, exposure and adaptive capacity,” Science of the Total Environment, vol. 682, pp. 31-46, 2019, https://doi.org/10.1016/j.scitotenv.2019.04.069.
  3. M. Aram, X. Zhang, D. Qi, and Y. Ko, “A state-of-the-art review of fire safety of photovoltaic systems in buildings,” Journal of Cleaner Production, 308, 127239, 2021, https://doi.org/10.1016/j.jclepro.2021.127239.
  4. M. McNamee et al., “IAFSS agenda 2030 for a fire safe world,” Fire Safety Journal, vol. 110, p. 102889, 2019, https://doi.org/10.1016/j.firesaf.2019.102889.
  5. A. Gaur, A. Singh, A. Kumar, K. S. Kulkarni, S. Lala, K. Kapoor, V. Srivastava, A. Kumar, and S. C. Mukhopadhyay, “Fire sensing technologies: A review,” IEEE Sensors Journal, vol. 19, no. 9, pp. 3191–3202, 2019, https://doi.org/10.1109/JSEN.2019.2894665.
  1. E. Maltezos, K. Petousakis, A. Dadoukis, L. Karagiannidis, E. Ouzounoglou, M. Krommyda, et al., A smart building fire and gas leakage alert system with edge computing and NG112 emergency call capabilities, Information, 13, 164, 2022, https://doi.org/10.3390/info13040164.
  2. J.-.S. Chou, M.-.Y. Cheng, Y.-.M. Hsieh, I.-.T. Yang, H.-.T Hsu, “Optimal path planning in real time for dynamic building fire rescue operations using wireless sensors and visual guidance,” Autom. Constr. 99, pp. 1–17, 2019, https://doi.org/10.1016/j.autcon.2018.11.020.
  3. Intelligent multi-sensor detection system for monitoring indoor building fires, IEEE Sens. J. 21, pp. 27982–27992, 2021, https://doi.org/10.1109/JSEN.2021.3124266.
  4. C. Su, W. Chen, “Design of remote real-time monitoring and control management system for smart home equipment based on wireless multihop sensor network,” J. Sensors 2022, pp. 1–10, 2022, https://doi.org/10.1155/2022/6228440.
  5. A. Mukherjee, S. K. Shome, and P. Bhattacharjee, “Survey on internet of things based intelligent wireless sensor network for fire detection system in building,” in Communication and Control for Robotic Systems.
    Springer, pp. 193–200, 2022,
    https://doi.org/10.1007/978-981-16-1777-5_12.
  1. Aalsalem, M. Y., Khan, W. Z., Gharibi, W., Khan, M. K., & Arshad, Q., “Wireless Sensor Networks
    in oil and gas industry: Recent advances, taxonomy, requirements,
     and open challenges,” Journal of network and
    computer applications
    , vol. 113, pp. 87-97, 2018, https://doi.org/10.1016/j.jnca.2018.04.004.
  2. S. Kamel, A. Janal, K. Omri, and M. Shayyat, “An IoT-based Fire Safety Management System for Education Buildings: A Case Study,” (IJACSA) International Journal of Advanced Computer Science and Applications,
    vol. 13, no. 7, pp. 765-771, 2022, https://doi.org/10.14569/IJACSA.2022.0130789.
  3. S. K. Mekni, “Design and implementation of a smart fire detection and monitoring system based on IoT,” in: 4th Int. Conf. Appl. Autom. Ind. Diagnostics, vol. 1, pp. 1–5, 2022, https://doi.org/10.1109/ICAAID51067.2022.9799505.
  4. G. Cavalera, R.C. Rosito, V. Lacasa, M. Mongiello, F. Nocera, L. Patrono, et al., “An innovative smart system based on IoT technologies for fire and danger situations,” in: 2019 4th Int. Conf. Smart Sustain. Technol., IEEE, pp. 1–6, 2019, https://doi.org/10.23919/SpliTech.2019.8783059.
  5. M. Mongiello et al., “A smart IoT-aware system for crisis scenario management,” J. Commun. Softw. Syst. 14, pp. 91–98, 2018, https://doi.org/10.24138/jcomss.v14i1.533.
  1. P. Kanakaraja, P. S. Sundar, N. Vaishnavi, S. G. K. Reddy, and G. S. Manikanta, “IoT enabled advanced forest fire detecting and monitoring on ubidots platform,” Materials Today: Proceedings, vol. 46, pp. 3907–3914, 2021, https://doi.org/10.1016/j.matpr.2021.02.343.
  2. I. H. Sarker, “Data science and analytics: an overview from data-driven smart computing, decision-making and applications perspective,” SN Computer Science, vol. 2, no. 5, p. 377, 2021, https://doi.org/10.1007/s42979-021-00765-8.
  3. M. Mahbub, M. M. Hossain, and M. S. A. Gazi, “Cloud-enabled iot based embedded system and software for intelligent indoor lighting, ventilation, early stage fire detection and prevention,” Computer Networks, vol. 184, p. 107673, 2021, https://doi.org/10.1016/j.comnet.2020.107673.
  4. H.D. Trung, “An IoT System Design for Industrial Zone Environmental Monitoring Systems,” in: Hybrid Intelligent Systems (HIS 2022), Lecture Notes in Networks and Systems, vol. 647, 2023, https://doi.org/10.1007/978-3-031-27409-1_4.
  5. A. Rehman, M. A. Qureshi, T. Ali, M. Irfan, S. Abdullah, S. Yasin, U. Draz, A. Glowacz, G. Nowakowski, A. Alghamdi et. al., “Smart fire detection and deterrent system for human savior by using internet of
    things (IoT),”
    Energies, vol. 14, no. 17, p. 5500, 2021, https://doi.org/10.3390/en14175500.
  1. M. Mukhiddinov, A.B. Abdusalomov, J. Cho, “Automatic fire detection and notification system based on improved YOLOv4 for the blind and visually impaired,” Sensors 22, 3307, 2022, https://doi.org/10.3390/s22093307.
  2. V. Barral Vales, O. C. Fernández, T. Domínguez-Bolaño, C. J. Escudero and J. A. García-Naya, "Fine Time Measurement for the Internet of Things: A Practical Approach Using ESP32," in IEEE Internet of Things Journal, vol. 9, no. 19, pp. 18305-18318, 1 Oct.1, 2022, https://doi.org/10.1109/JIOT.2022.3158701.
  3. S. Mukherjee, A. Ghosh and S. K. Sarkar, "Arduino based Wireless Heart-rate Monitoring system with Automatic SOS Message and/or Call facility using SIM900A GSM Module," 2019 International Conference on Vision Towards Emerging Trends in Communication and Networking (ViTECoN), pp. 1-5, 2019, https://doi.org/10.1109/ViTECoN.2019.8899504.  
  4. I. K. N. Trisnawan, A. N. Jati, N. Istiqomah and I. Wasisto, "Detection of Gas Leaks Using The MQ-2 Gas Sensor on the Autonomous Mobile Sensor," 2019 International Conference on Computer, Control, Informatics and its Applications (IC3INA), pp. 177-180, 2019, https://doi.org/10.1109/IC3INA48034.2019.8949597.  
  5. G. M. Debele and X. Qian, "Automatic Room Temperature Control System Using Arduino UNO R3 and DHT11 Sensor," 2020 17th International Computer Conference on Wavelet Active Media Technology and Information Processing (ICCWAMTIP), pp. 428-432, 2020, https://doi.org/10.1109/ICCWAMTIP51612.2020.9317307.  
  6. D. Hercog, T. Lerher, M. Truntič, and O. Težak, “Design and implementation of ESP32-based IoT devices,” Sensors, vol. 23, no. 15, p. 6739, 2023, https://doi.org/10.3390/s23156739.
  7. M. R. Johnson, D. R. Tyner, and A. J. Szekeres, “Blinded evaluation of airborne methane source detection using Bridger Photonics LiDAR,” Remote Sensing of Environment, vol. 259, p. 112418, 2021, https://doi.org/10.1016/j.rse.2021.112418.

Design and Implementation of an IoT System for Indoor Measurement and Monitoring Fire and Gas Warning (Nguyen Van Tri)