Low-cost multipurpose sensor network integrated with iot and webgis for fire safety concerns

. Fire emergencies cause severe damage to Brazilian federal universities. An appropriate and efficient tool to prevent or detect such events early is multisensory networks from the Internet of Things (IoT). In this study, we present the stages of development of a WebGIS system which integrates the IoT that allows the detection and helps manage such incidents. The approach consists of a network of multipurpose sensors that can identify different sources of fire hazards. If a potential source is registered, information about environmental conditions is transmitted in real-time to the system. Depending on the severity level, an alert is issued to WebGIS. Location is represented on a map. The entire system consists of single-board devices. Software components are based on open-source tools. The whole network only needs little power and, therefore, theoretically, could be carried out as an autonomous system powered by batteries. The entire system has been tested with flame, temperature, gas, smoke, and humidity sensors. The experiments allowed us to show its potential, formulate recommendations and indications for future studies.


Introduction
Every year, fires have been witnessed in Brazilian Federal Universities, and a series of factors influence or corroborate these conditions: old and scrapped university buildings, low number of approved projects aimed at fire safety, degradation of external infrastructure, absence of solutions based on modern technology for firefighting, among other aspects.
The fires at the National Museum of Rio de Janeiro in 2018, the University of São Paulo in 2019, Museum of Natural History of the Federal University of Minas Gerais in 2020, College of Architecture of the Federal University of Rio de Janeiro in 2021, in addition to several occurrences of fires recorded in Brazilian universities in recent years, account for numerous losses to the scientific community, as well as to the Brazilian public patrimony.Not far from that, there is a current scenario full of drastic reductions in investments for infrastructure and scientific funding, making the modernization of campuses and their full recovery unfeasible.Currently, in addition to the issues mentioned above, universities still have high cuts in financial resources, which, in a way, makes it impossible to implement a series of investments in the scope of this theme.
The methods for managing and monitoring fire occurrences currently practiced contain limitations that directly impact the time of fire exposure, increasing the chances of severity and the damage caused by this event.
In recent years, significant advances have been made in digital technologies, applications, automation tools, processing, manipulation, acquisition, and data visualization, encouraging the proposition of increasingly innovative projects.If directed to universities, this contribution brings significant advantages, as it allows effective communication with those who deal with and manage these events on campus.
Pursuing the idea of applying technologies for the management of fire occurrences, it appears that the Internet of Things (IoT) and the Geographic Information System (GIS) bring with them the necessary characteristics for a multiple fusion of information since they are appropriate for the use of sensors, communication equipment, visualization tools, and their respective computing devices, unrelated to the acquisition of data by virtual or real objects (Gunduz & Isikidag, 2017;Isikdag, 2015).
Acta Scientiarum.Technology, v. 45, e61451, 2023 In this process, the central paradigm is related to the idea of how to optimize the detection and attendance of fire occurrences in universities and even how to provide an intelligent management model with the use of these technologies, considering that the absence of resources is characterized as the main disadvantage in the process.
The central assumption that guides this research is that an advanced investigation of what is available in open hardware and open software will result in methodological proposals for IoT and GIS integration, thus allowing the presentation of innovative solutions and overcoming the traditional limitations found.
In this way, it can be considered that the focus of this work is on developing a low-cost system that integrates IoT and GIS technologies and is applied in the management of fire safety on university campuses.
The article initially approaches some works in the theoretical field and lists the materials and methods used in its structure.Next, the results and discussions regarding the proposed integration are presented, ending with the final considerations of the research.

Related works
It is believed that one of the possibilities to minimize such impacts is linked to the use of the Internet of Things (IoT) and the Geographic Information System (GIS), considering that their contributions in the literature advocate several application aspects.
In this paper, the IoT is considered a system of objects -in most cases, the core of these objects is single board computers (SBC) or microcontrollers -consisting of different sensors connected to the internet.These devices capture data of various kinds, and after transmission, the data are processed automatically (Asghari et al., 2019;Yuan & Zhao, 2012).The GIS, on the other hand, enables the visualization of different data on a map from a computer system, allowing its users to verify, analyze, capture and display related geographic positions of the earth's surface and their real-world relationships (Kotikov., 2017;Dong, Khanh, Nguyen, & Nguyen, 2019).
This research is in line with the theoretical premises brought by Asghari et al. (2019), Dong et al. (2019), and Kotikov (2017), as it is valid to say that IoT and GIS integration is only possible due to the ability to connect addressable objects, processing technologies and the provision of analysis tools for computing environments, which together make it possible to relate data from the real world (formerly post-processed) in real-time.
According to Atkin and Brooks (2009), sensors will be crucial for facility management because these sensors collect and deliver data in real-time and -in most cases -send them to a database.The whole communication is predominantly wireless.
All these articles deliver the relevance and importance of this topic.They further emphasize the need for projects to minimize such risks and the resulting consequences.
Some investigators have already used the IoT and developed monitoring and alarm transmission methods.Deshpande, Pitale, and Sanap (2016) presented a system for automatic monitoring of plants by sensors to capture temperature, humidity, pressure, and vibration.This system sends an E-Mail or a short notice to the service staff as soon as there are any deviations.Uttam, Baspusaheb, Shivali, and Pisal (2017) presented a system based on an Arduino Uno equipped with a WiFi unit (ESP8266 ESP-01) and sensors for temperature measurement (LM35) and gas detection (MQ6) for industrial applications.

IoT prototype
The prototype developed uses an ESP8266 NodeMCU microcontroller, breadboards with holes and conductive connections (breadboard), connection jumpers, and sensors for monitoring environmental conditions (temperature and humidity) and incidence of gases, smoke, and flames (Figure 1).The device connection has the following structure: i) Connection of the DHT11 sensor for temperature and humidity measurement: Blue jumper for digital output on D2 (GPIO 0) of the ESP8266, red jumper for power supply (5 volts), and black jumper on the Graduated Neutral Density Filter (GND).
ii) MQ-2 connection for gas detection: Green jumper on the analog output on ESP8266 A0, a red jumper for power supply (5 volts), and black jumper GND.
iii) Flame sensor connection: Yellow jumper for digital output D3 of ESP8266 (GPIO 4), a red jumper for power supply (5 volts), and black jumper GND.
The values of microcontrollers and sensors can vary significantly depending on their purchase method, quantity, and types of sensors adopted.In this research, we sought to equate the cost and quality of the equipment adopted, given the implicit importance of the object of study.Therefore, Table 1 highlights the cost of the prototype developed.

Hardware and software
The system we present in this publication is based on the microcontroller ESP8266 NodeMCU (Figure 2).The device is equipped with sensors for environmental monitoring such as temperature, humidity, smoke, gas, and flames.NodeMCU is a free IoT platform based on the programming language LUA.Although LUA is a scripting language delivering byte code, there are libraries for other languages available which provide APIs for LUA, and thus programming can be performed in different languages.One programming language offering such libraries is the C programming language we used in our project.Another advantage of the microcontroller mentioned above is that both share the same Integrated Development Environment (IDE) Arduino, making it easy to implement new programs.For programmable microcontrollers, this implementation usually consists of two parts.
Whenever such a device starts its work, an initial procedure is passed first.In our case, this step encompasses the connection to the local network, which is thus predefined.Besides the network, some other crucial definitions are also performed.This step comprises the description of some GPIOs relevant to the sensors and predominantly the base rate for signal transmission.
After the initial routine is finished, the second procedure is passed, described as an infinite loop.During each loop, the signals of the connected sensors are transmitted to the server via WiFi.This is done in fixed time slices.We decided to send the sensor data every 10 seconds.This, however, is more or less an arbitrary value and can be changed if necessary.Once the microcontroller is started, it does its work until stopped.

Sensors
Our prototype consists of a breadboard that ensures the connections between the microcontroller and the sensors.Figure 3a shows the breadboard and the sensor of type DHT11 for temperature and humidity measurement.This sensor captures the temperature of the environment from roundabout 0 to 50 degrees Celsius (DHT 11, 2019).
The gas sensor MQ-2 (Figure 3b) is suitable for detecting Liquefied Petroleum Gas (LPG), butane, propane, methane, alcohol, hydrogen, and smoke (specifications of the manufacturer).The device can be used in an indoor environment at room temperature.It has a wide range of detection, high sensibility, long life span, low price, and fast response time behavior (Kodali & Valdas, 2018).
The fire sensor could not only be used to detect flames but also other waves between 760 and 1,100 nm.The waves can be detected within up to 60° of visibility (Nugroho & Pantjawati, 2017).This easy-to-install sensor is equipped with Voltage at the standard connector (Vcc) and Ground (GND) as well as digital and analog output (Figure 3c).Each sensor requires electric power.As a consequence, the energy consumption increases with the number of sensors.Our prototype is equipped with four sensors for temperature, humidity, smoke, fire and gas.
However, the total power consumption of the above-presented sensor system is only 0.9 Watt.In comparison, the Raspberry Pi Model 3B+ without any sensors has a power consumption of almost 3.0 watts.That shows the efficiency of the solution.Table 2 shows further details.

IDE Arduino
The Integrated Development Environment Arduino (IDE Arduino) is an open-source software designed to develop and transfer programs to the Arduino.The IDE also supports the programming languages C and C++.In many cases, specific libraries are needed to rule special hardware, e.g., sensors.Mainly, the IDE allows the compilation and transformation of source code (Arduino, 2021).Oliveira (2017) outlines the advantage of the Arduino, which is very flexible and can be equipped with various sensors, and once a system is developed, its bulk production is inexpensive.

Firebase realtime database
Firebase is a platform to support IoT projects.The online portal was founded in 2011, and Google acquired all rights in 2014.Firebase offers different services and functions free of charge (Rahman, Kim, & Kim, 2018).
Unlike a Standard Query Language (SQL) database, the database structure developed through Firebase Realtime Database allows storage in the cloud in JavaScript Object Notation (JSON) format.
Free quotas for Firebase database users can reach up to ten gigabytes per month, considering storage and download procedures.Additional plans can be evaluated and charged depending on the scale of the project.
The Smart Fire workflow contemplates the integrated use of the prototype, application, and WebGIS system.The elaborate organizational tree stores the entire volume of data received by monitoring the environment, prototype alerts, creating regions, and downloading for system visualization.
To receive the data from the IoT prototype, it was necessary to create a structure within the Arduino IDE with the insertion of the Firebase, ESP8266 libraries for the connection via WiFi, and the DHT11.Next, information from the project's HyperText Transfer Protocol Secure (HTTPS) page is introduced, in addition to the API secret key provided in the system access settings.
Next, the void setup function is executed to perform the serial port connection, transfer rate, and delay programming.The serial print will present the data on the Arduino serial console, such as the Internet Protocol (IP) address and WiFi connectivity status when sending the programming.The void loop is designed to receive data every 30 seconds.The reception of information to the customer is provided through unique keys for each collected data created instantly by the API used (Figure 4).

Technology of system
Initially, a survey of the demands related to fires was carried out at the Federal University of Bahia (UFBA), Federação, and Ondina campuses.It was also possible to identify the flow of information regarding the management of occurrences by two reference agents for fighting fires: the Military Fire Brigade of the State of Bahia (CBM) and an industrial company active in manufacturing and transporting dangerous products.
With the diagnosis of the demand x expertise relationship, it was possible to think about the conceptual project, which originated the implementation of the information flow and all the Smart Fire functionalities.
All system was developed with platforms, software, and libraries open source.The steps and mater ials used according to Figure 5

Wi-Fi connection
The WiFi connection is established using the WiFi Manager library, which allows for managing and using the different networks within the campus.This library is inserted directly into the programming code performed in the IDE Arduino.Once connected, the library stores the last used network in the ESP8266's memory, allowing, for example, its reconnection to be automatic in cases of a power outage, failure, or instability of the local network.
To connect the ESP8266 to a local network, it is necessary to follow the following steps (Figure 6): 1-View the ESP8266-Access-Point WiFi connection on the smartphone device; 2-Click on "configure WiFi"; 3-Choose the network to login; 4-Insert the password; 5-Check the information regarding the prototype (region and monitoring code); 6-Click on "save" and wait for the connection to be established.

Results and discussion
The initial tests of the prototype were carried out in the building of the Institute for Photogrammetry and Remote Sensing of the Karlsruhe Institute of Technology (KIT) in Germany.The sensor system prototype was packed in a cardboard box measuring 51.3 x 35.1 x 31.8 cm in size (length, width, and height) and connected to a 5V socket.In this box, different simulations were performed.
The test procedure covered a fire incident as well as a gas leak.Data from all sensors were captured and sent to the cloud during the test, where the results were analyzed.We simulate a methane and butane gas leak as a first step, as shown in Figure 7 (left image).An injection systematically increased the gas concentration inside the box.Second, a fire incident was simulated with a lighter, and the next trapped smoke was released to test the smoke sensor (Figure 7).Next, the box was opened to recover the initial state of the experiment.In the beginning, we monitored temperature of 24.30°, humidity of 28%, and gas concentration of 229.00 ppm.Following, we started with a low injection of propane and butane.Immediately after, the monitored gas concentration increased until it reached 429 ppm.Neither the temperature nor the humidity changed during this phase.
After some time, we simulated four fire incidents which were recorded instantly.During these tests, the temperature reached a maximum of 49.9°, and the humidity decreased to 15%.The gas concentration was between 317 ppm and 324 ppm, a relative difference of about 2%.Finally, the smoke sensor was also tested.The maximum smoke concentration reached 436 ppm.Table 3 shows the temperature, humidity, and gas concentration variances in the simulations.As expected, the correlation between the fire, the moisture, and the temperature is evident.After the experiments, we analyzed the measurements available in the database created in Firebase Realtime Database.The IoT system presented is currently integrated with the webGIS Smart Fire, which monitors internal areas susceptible to fire in the Federal University of Bahia (UFBA) buildings, the site of this new experiment.This system receives all information from the monitored environment in real-time, including graphic visualization, issuing alerts, and support for special analyses from manipulation tools.
The entire system will only be used by the university campus security team.The authentication process implemented requires the user to register with the availability of e-mail and password.The security manager will be responsible for blocking or releasing access for new users.
When logging in to Smart Fire (https://smartfire1dot0.herokuapp.com/), it is possible to check the informative dashboard with the commands available for handling, distribution of regions, and monitoring points already registered.
The main menu, monitoring, alerts, history, and contact tabs are on the left side of the screen.The map configuration tab allows creating regions, monitoring points and isolation areas.We have the image centering command on the right side of the screen.The areas and monitoring points that may already be registered are presented centrally (Figure 8).In addition to being intuitive, the Smart Fire UFBA allows real-time checking of the data sent by the sensors to the firebase.Viewing options include readings for the last ninety days, thirty days, seven days, sixty minutes, five minutes, and the previously identified reading taken every thirty seconds (Figure 9).
When any anomaly (fire, gas leak, and smoke) is detected through the IoT sensors, an alert is immediately issued on the webGIS visualization panel, informing the event classification, date, time, and place of service.By clicking on the view system, the user will access the board with the last reading performed before identifying the occurrence (Figure 10).As the university does not have the fire brigade, the idea is that the campus security team will make use of the system.During the occurrence, the system user will be able to help the brigade members with some vital information, such as better access to the building and the creation of areas for isolation.Figure 11 represents the three accesses of the UFBA Polytechnic School, one of our monitoring areas.The system also allows the elaboration of heat maps using record data from previous cataloged occurrences.It is believed that this use can serve as an analysis tool for a preventive maintenance tool for buildings (Figure 12).

Conclusion
We present a low-cost and low-energy sensor that can be connected to the open-source platform Firebase.Right now, the sensors capture data concerning the temperature, humidity, concentration of butane and propane, and fire in real-time.Data were transferred and depicted in charts.In a second step, transferred to WebGIS system Smart Fire.The analysis can be performed in real-time.In our application, the system is considered to fit the needs of various emergency cases and management of fires at the building.The system also can be enhanced by additional sensors, or some sensors can be replaced by others.However, in these cases, a new investigation of power consumption is necessary.Future work is intended to develop an application integrated into the system so that campus users (professors, students, and staff) can collaboratively report occurrences that happen outside the university, such as fires in green areas, water leaks, electrical network wiring outages, intercurrences in the parking lot, among others.In addition, it is also intended to incorporate actuators (audible alerts) in the prototypes, to optimize the occurrence management process.The research contributes to developing real-time monitoring systems based on Integration IoT and GIS.The creation of Smart Fire aims to assist in managing fire occurrences in university buildings.Its low cost and low energy consumption enable its expansion and deployment in other campus facilities.It is important to point out that the last step is the system's availability to be deployed in the UFBA security service.
are described below: (i) The selected images were treated in the GIMP image editor; (ii) With Visual Studio Code, it was possible to create and edit the source code, in addition to the GitHub platform, it was possible to control the developed versions; (iii) For the elaboration of the graphical interface (Front-End) the Cascading Style Sheet (CSS), HyperText Markup Language (HTML) and the Leaflet interactive map library were used; (iv) For the programming of the routines (Back-End) JavaScript (JS) was used, as well as Firebase for data storage in the cloud; ( v) Node.JS was the platform used to create the server's execution environment; and (vi) The Heroku platform was used while hosting in the cloud.

Figure 9 .
Figure 9. Graphical display of data sent by sensors.

Table 1 .
Cost of the prototype.

Table 2 .
Power consumption of the sensor system.

Table 3 .
Results of monitoring.