Vol. 16 No. Jurnal Riset Teknologi Pencegahan Pencemaran Industri Journal homepage: https://w. Iot-Based Forest Fire Prediction System Using Fuzzy Logic Method Jefri Lianda1. Hikmatul Amri2. Adam3. Johny Custer4. Dea Fitriana5 12345Politeknik Negeri Bengkalis A R T IC L E I N F O Article history: Received September 13, 2025 Received in revised form October 29. Accepted Novemeber 15, 2025 Available online Novemeber 29, 2025 Keywords: IoT Fuzzy Logic Fires ABSTRACT Forest and land fires represent a recurring environmental challenge in Indonesia, especially during the prolonged dry season. These incidents result in significant consequences, including the destruction of ecosystems, threats to human health, and considerable economic disruption. To address this problem, the present research focuses on the development of an Internet of Things (IoT)-based system designed to predict and monitor the risk of forest fires by implementing the Fuzzy Logic method. The prototype integrates several sensors, namely a DHT22 sensor for measuring temperature and humidity, an MQ-2 sensor for detecting gas and smoke concentrations, and a flame sensor for identifying the presence of fire. All sensors are connected to a NodeMCU ESP8266 microcontroller that serves as the core of data processing and wireless communication. The collected sensor data is evaluated using a Fuzzy Logic algorithm, which classifies the fire risk into three distinct levels: AuSafe,Ay AuCaution,Ay and AuHazardous. Ay Experimental testing demonstrates that the system responds effectively to fluctuations in temperature, humidity, smoke levels, and visible flame in real time, with alerts displayed through a web-based dashboard. The DHT22 sensor exhibits an average error rate 8% and 5% for temperature readings and between 4. 1% and 4. 5% for humidity In addition, the flame sensor successfully detects fire sources at distances reaching 300 cm. The outcomes confirm that the system achieves a high degree of reliability and accuracy, thereby providing valuable support for early warning, strengthening preventive strategies, and assisting authorities in mitigating the severe impacts of forest and land fires. INTRODUCTION The impacts of forest fires are extensive, affecting socio-economic conditions, the environment, and public Economically, communities that depend on forests for their livelihoods suffer significant losses as their fields and plantations are destroyed by fire (Lertsinsrubtavee et al. , 2023. Lianda & Amri, 2. Previous studies did not include a temperature sensor and did not apply fuzzy logic in data processing, resulting in less accurate classification and limited adaptability in detecting environmental changes compared to the approach proposed in this research. Ecologically, fires damage the hydrological cycle, degrade soil quality, and result in the loss of vegetation seeds. From a health perspective, wildfire smoke can cause respiratory problems such as asthma, bronchitis, pneumonia, eye irritation, and disrupt daily activities due to limited visibility. The combination of the NodeMCU ESP8266 and Fuzzy Logic provides convenience in developing the program, as it allows efficient data processing, flexible rule implementation, and easy integration with IoT platforms for real-time monitoring and intelligent decision-making. Given the complexity and severity of forest fire impacts, this study proposes the development of an Internet of Things (IoT)-based fire detection system using a NodeMCU microcontroller (Jaber & Alkhatib, 2025. Ramadan et al. , 2024. Rehman et al. , 2021. Sorokin et al. Internet of Things (IoT)-based fire detection system using a NodeMCU microcontroller equipped with flame, smoke, and temperature sensors. The system is designed to monitor environmental changes in real time, transmit data to a website, and send notifications via phone to detect early signs of fire (Ali et al. , 2025. Bino et al. , 2024. Imran et al. *Correspondence author. E-mail: jefri@polbeng. id (Jefri Liand. doi: https://10. 21771/jrtppi. 2503-5010/2087-0965A 2024 Jurnal Riset Teknologi Pencegahan Pencemaran Industri-BBSPJPPI (JRTPPI-BBSPJPPI). This is an open acces article under the CC BY-NC-SA license . ttps://creativecommons. org/licenses/by-nc-sa/4. 0/). Accreditation number: (Ristekdikt. 158/E/KPT/2021 Yulianto et. / Jurnal Riset Teknologi Pencegahan Pencemaran Industri Vol 15 No 1 . 10-14 The Fuzzy Logic Control method was chosen in this study due to its ability to handle concepts that are not strictly true or false, as well as its flexibility in modeling imprecise data and complex nonlinear functions (Kushnir et al. , 2023. Wang et al. , 2. Fuzzy Logic uses membership values ranging between 0 and 1, allowing decision-making based on varying degrees of truth. This method is also widely used in motion control applications, such as in robotics, with advantages including reduced vibrations and improved stability and accuracy. In the context of this research. Fuzzy Logic is employed to process sensor data and predict fire risk. Its simplicity, flexibility, and tolerance for imprecise data make it well-suited for detection systems like the one developed in this research study (Meera et al. , 2023. Park et , 2023. Raju et al. , 2. Based on the background described, the problem statements addressed in this study are: how to build and design an Internet of Things (IoT)-based fire detection how to develop a fire warning monitoring program. how to analyze the testing of the device against fire, temperature, humidity, and smoke. and how the NodeMCU ESP8266 operates using the Fuzzy Logic Control method. This research is a laboratory based scientific experiment designed to test and evaluate the performance of sensors and the fuzzy inference system. The experimental setup allows controlled conditions for data collection, calibration, and validation to ensure accurate and reliable monitoring results. METHODS Forest and land fires are highly undesirable for communities due to the significant losses they cause. Therefore, an early fire detection device is essential. The working system of the Internet of Things (IoT)-based forest fire monitoring device uses flame, smoke, and temperature sensors to detect early signs of fire in forested areas. This device is equipped with a temperature sensor to identify sharp increases in temperature, a smoke sensor to detect the presence of smoke particles in the air, and a flame sensor to detect flames or fire presence. When any of these sensors detect a change in conditionsAifor example, temperature exceeding normal limits, increased smoke concentration, or flame detectionAithe sensor transmits real-time data via the IoT network to a central monitoring system. The calibration procedure for the flame, smoke, and temperature sensors using the NodeMCU ESP8266 was carried out systematically to ensure accurate and reliable sensor readings. The hardware used included the NodeMCU ESP8266 microcontroller, a flame sensor, an MQ-2 smoke sensor, and a DHT11 temperature and humidity sensor, all connected to a breadboard with jumper wires. Each sensorAos VCC pin was connected to the 3. 3V or 5V power source, the GND pins were connected to the NodeMCU ground, and the output pins were connected to the appropriate analog or digital inputs. For the flame sensor calibration, a fire source was placed at varying distances . cm to 300 c. from the sensor, and the analog readings were recorded to determine the threshold values distinguishing Aufire detectedAy and AusafeAy conditions. The MQ-2 smoke sensor was preheated for 24 hours to stabilize its readings, then tested in clean air and under exposure to smoke from a burning material. The difference in readings was used to set the threshold between Ausafe,Ay Aualert,Ay and AudangerousAy levels. For the DHT11 temperature and humidity sensor, calibration was performed by comparing its readings to those from a standard thermometer and hygrometer under the same environmental conditions. The percentage error was calculated to assess accuracy, and an offset correction was applied in the program if necessary. After calibration, the entire system was tested under different environmental conditions to validate sensor stability. Wi-Fi data transmission, and overall performance, ensuring that the system could provide accurate, consistent, and realtime data for fire detection and monitoring applications. The data is processed and analyzed to confirm whether the detected signals indicate an actual fire or just natural If a fire is confirmed, the system sends alerts or notifications to relevant authorities, such as firefighters or forest officials, enabling them to take prompt preventive or extinguishing actions. By combining these sensors, the system can provide fast and accurate fire detection, helping to minimize forest damage and improve disaster response. The data were collected repeatedly to evaluate the performance and consistency of the device. The gas concentration category ranges from 300 ppm to a maximum of 5000 ppm, based on the available measuring Under normal indoor conditions, both the gas sensor and the measuring instrument indicate a baseline value of 300 ppm. When smoke is present generated from burning waste the gas concentration increases to around 1200 ppm. This significant rise indicates the sensorAos responsiveness to smoke particles and its ability to detect changes in air quality Statistical methods can be applied to validate the results of a fuzzy inference system and assess its reliability compared to actual data or reference models. When the Yulianto et. / Jurnal Riset Teknologi Pencegahan Pencemaran Industri Vol 15 No 1 . 10-14 system produces categorical outputs, such as fire risk levels (Safe. Alert. Dangerou. Figure 1. Block Diagram of the System In general, the system is composed of three main stages: input, process, and output. At the input stage, environmental data such as temperature, smoke levels, and flame presence are collected using various sensors. These sensors include the DHT22 temperature sensor, the MQ2 smoke sensor, and a flame sensor, which continuously monitor conditions in real time. The collected data is then sent to the processing stage, where it is analyzed and interpreted according to programmed instructions embedded within the microcontroller. This step uses algorithms, including Fuzzy Logic, to assess the risk level of a potential fire based on the sensor inputs. Following this, the output stage generates a corresponding response, such as triggering an alert or notification. The entire system design is divided into two key components: hardware and software. The hardware setup includes the sensors, a buck converter for power regulation, a rechargeable battery, and a solar panel for sustainable energy supply. The software component manages communication between the Arduino microcontroller, the sensor modules, and a smartphone interface for remote monitoring and alerts. The overall architecture and connections of the system are illustrated in the block diagram shown in Figure 1. The fire detection systemAos hardware is centered around the NodeMCU ESP8266, which serves as the main unit for processing all incoming sensor data. This microcontroller is integrated with the Fuzzy Logic method to enable more accurate and flexible analysis of sensor inputs such as temperature, smoke, and flame detection. The combination of NodeMCU and Fuzzy Logic allows the system to assess the risk of fire more effectively by handling imprecise or uncertain data. The complete hardware architecture, including sensors, power supply components, and connectivity modules, is illustrated in Figure 2, providing a detailed overview of the systemAos physical design. Figure 2. Hardware Design The circuit shown in the figure above is a solarpowered forest fire prediction system designed to control and monitor environmental conditions using the ESP8266. The primary energy source comes from a solar panel that converts sunlight into DC electricity. This electricity flows to a solar charge controller, which regulates the charging process to the battery and prevents overcharging or overdischarging. The energy is then stored in a 12V lead-acid battery that serves as the main power source for the system, especially during nighttime or when there is no sunlight. From the battery, the voltage passes through a buck converter that steps down the voltage to match the ESP8266's requirement of 5V. The ESP8266 microcontroller acts as the central data processing and communication unit, connected to several sensors: the DHT22 sensor for measuring temperature and humidity, the MQ-2 sensor for detecting gas or smoke, and a flame sensor that detects fire presence through infrared. All data from these sensors are read by the ESP8266 and can be transmitted to a smartphone via WiFi for real-time remote monitoring. In this system, the MQ2 smoke sensor plays a crucial role by converting the concentration of smoke particles in the air into an electrical signal, specifically a voltage output. This voltage corresponds to the density of smoke detected, allowing the system to monitor air quality and detect potential fire hazards. The MQ2 sensor is connected to the NodeMCU ESP8266 microcontroller through its analog input pin A0, with power supplied via the Vin pin and grounded through the GND pin. The detailed circuit connection for the MQ2 Yulianto et. / Jurnal Riset Teknologi Pencegahan Pencemaran Industri Vol 15 No 1 . 10-14 smoke sensor is illustrated in the following figure 3, providing a clear overview of its integration within the system. Figure 3. Smoke Sensor Circuit A flame sensor is a device designed to detect the presence of fire by sensing sudden flames. It operates within a voltage range of 3. 3 V to 5. 5 V, making it compatible with various microcontroller systems. The sensor is capable of detecting infrared light wavelengths between 760 nm and 1,100 nm, which correspond to the typical radiation emitted by flames. This allows the sensor to effectively identify fire sources even in varying lighting conditions. The detailed circuit diagram for the flame sensor setup is shown in Figure 4, illustrating how the sensor is connected within the fire detection system. Figure 4. Flame Sensor Circuit The DHT22 sensor is a digital calibrated sensor capable of providing accurate information about temperature and humidity levels in the environment. It outputs digital signals that represent these measurements, making it easy to interface with microcontrollers. In this system, the DHT22 sensor is connected to the ESP8266 module through the D2 pin for data communication, with power supplied via the Vin pin and grounded through the GND pin. This setup allows the microcontroller to continuously monitor ambient temperature and humidity. The detailed circuit connection of the DHT22 sensor is shown in Figure 5. Figure 5. Temperature Sensor Circuit The system is developed using Arduino IDE and NodeMCU ESP8266, integrating temperature (DHT. , gas (MQ. , and flame sensors. WiFi connectivity and Firebase are set up to enable real-time data transmission. Sensor data is processed using fuzzy logic, where inputs such as temperature and gas levels are classified into fuzzy categories like low, medium, and high. Subsequently, fuzzy rules are applied to determine the systemAos status, categorized as safe, alert, or This process includes defuzzification to produce a final decision based on combined input values. All sensor readings are sent to the Firebase Realtime Database for remote monitoring. With this integration, the system can automatically detect potential fires and provide early warnings through fuzzy logic-based analysis. This categorization is used in the fuzzy logic inference process to determine the fire risk level based on the detected gas concentration. The gas fuzzification process is illustrated in Figure 6. The gas parameter is classified into three categories: low gas, medium gas, and high gas, each represented by trapezoidal membership functions. The low gas category has full membership between 300 and 300 PPM and begins to decline after 400 PPM. The medium gas category starts at 300 PPM, has full membership between 400 and 1000 PPM, and decreases until 1200 PPM. Meanwhile, the high gas category begins at 1000 PPM, reaches full membership at 1200 PPM, and extends up to a maximum of 5000 PPM. Figure 6. Gas Fuzzification Yulianto et. / Jurnal Riset Teknologi Pencegahan Pencemaran Industri Vol 15 No 1 . 10-14 Temperature is divided into three categories: cold, normal, and hot. The cold temperature category ranges from 0 AC to 40 AC, with full membership at 32 AC. The normal temperature category spans from 32 AC to 60 AC, where the range between 40 AC and 50 AC has full membership. Meanwhile, the hot temperature category starts from 50 AC to 80 AC, with full membership at 60 AC. These temperature ranges are used to convert sensor data into linguistic variables that can be processed by the Fuzzy system, thereby assisting in determining the level of fire risk based on environmental The fuzzification of temperature can be seen in Figure 7. Gas levels are divided into three categories: Low. Medium, and High, while temperature is categorized into Cold. Normal, and Hot. The combination of these parameters produces three possible output conditions: Safe. Alert, and Dangerous. When the gas level is low with either cold or normal temperature, the system outputs Safe, indicating no fire risk. For medium gas with cold temperature, the condition is still Safe. However, when gas is high with cold temperature, or when gas is low with hot temperature, or high with normal temperature, the system outputs Alert, meaning potential fire risk exists and should be monitored. Finally, the Dangerous status occurs when gas is medium with hot temperature, or high with hot temperature, indicating a critical fire risk that requires immediate action. RESULT AND DISCUSSION Figure 7. Temperature Fuzzification The membership functions of these three categories generally take the shape of trapezoids and are used to transform Fuzzy calculation results into linguistic values that are easier to interpret. The outcomes of this process serve as the foundation for system decision-making, determining whether the environment remains safe, requires caution, or has entered a dangerous state of fire risk. The output is divided into three categories: Safe. Alert, and Dangerous. The Safe category ranges from 0 to 40, with full membership at The Alert category spans from 30 to 80, with full membership between 40 and 60. Meanwhile, the Dangerous category covers values from 60 to 100, with full membership The fuzzification of the output can be seen in Figure Figure 8. Output Fuzzification Based on the design of the Forest Fire Prediction System Using the Fuzzy Logic Method Based on IoT, one important consideration is ensuring that all components are properly installed and connected. This is essential to prevent possible damage or system failure, particularly in terms of the power supply, which must deliver sufficient voltage to support all the connected components. These components include the solar panel, battery, buck converter. ESP8266 microcontroller, temperature sensor, humidity sensor, flame sensor, and gas sensor. The complete design and assembly of the device are shown in Figure 10. Yulianto et. / Jurnal Riset Teknologi Pencegahan Pencemaran Industri Vol 15 No 1 . 10-14 temperature sensor testing are presented clearly in Table 1 for further analysis. Table 1. Results of Temperature Sensor Testing No Time Measurement Measurement 30 of Temperature 30,4 0C 29,4 0C Using 40 Sensor 30,8 0C 7 0C Environment 31,1 0C Meter 30,0 0C 32,2 C 31,0 0C 33,4 0C 31,4 0C 32,7 C 31,7 0C 33,8 0C 31,8 0C 33,9 C 31,9 0C 33,7 0C 31,4 0C 33,6 C 31,1 0C 33,2 0C 31,7 0C Average Figure 10. Overall View of the Device The testing was conducted to examine whether the temperature sensor used in this study is functioning correctly and capable of providing accurate measurements. The main objective of the test is to ensure that the sensor can detect changes in temperature consistently and reliably during the measurement process. This verification is important to confirm the suitability of the sensor for use in subsequent experiments or practical applications. During the testing phase, the sensor was carefully observed to evaluate its responsiveness and precision. The results obtained from the Time Measurement of Humidity 81,5 % Sensor 75,8 % 73,7 % 71,3 % 65,0 % 66,5 % 61,9 % 64,3 % 63,4 % 64,9 % 66,3 % Error 3,2 % 3,5 % 3,2 % 3,7 % 5,9 % 3,0 % 5,9 % 5,8 % 6,8 % 7,4 % 4,5 % 4,8% The temperature sensor testing table shows a comparison between temperature measurements obtained using the temperature sensor and the environment meter within the time range from 09:30 AM to 12:00 PM. From the graph, it can be observed that the values recorded by the temperature sensor tend to be slightly higher compared to the environment meter. The temperature sensor readings ranged 4AC to 33. 2AC, while the environment meter indicated values between 29. 4AC and 31. 7AC. The difference between the two devices was calculated as a percentage error, which is also displayed in the graph. The highest error was recorded at 11:45 AM at 7. 4%, while the lowest error occurred at 09:30 AM and 10:00 AM at 3. The average error of all tests was 4. 8%, indicating that the temperature sensor is still sufficiently accurate for use, although calibration may be required at certain times to minimize measurement Table 2. Results of Humidity Sensor Testing Measurement of Carbon Error Dioxide 75Detector 7,5 % 7,6 % 9,0 % 10,2 % 3,0 % 2,2 % 1,4 % 0,4 % 0,6 % 1,3 % 1,9 % Yulianto et. / Jurnal Riset Teknologi Pencegahan Pencemaran Industri Vol 15 No 1 . 10-14 Average 4,51 demonstrated reliable performance for monitoring humidity Regular evaluation and calibration are recommended to maintain the accuracy of measurements and ensure the sensorAos effectiveness in long-term environmental monitoring Table 2 of the humidity sensor testing shows a decreasing trend in humidity from 81. 5% to 64. 9%, which is consistent with the reference instrument, the Carbon Dioxide Detector, that recorded a decrease from 75% to 65%. The error values between the two measurements varied from 0. 2%, with an overall average of 1. Although some Table 3. Results of Flame Sensor Testing deviations occurred at certain times, the sensor still Range Flame Indicator Website Availability Status 30 cm Fire detected 60 cm Fire detected 90 cm Fire detected 120 cm Fire detected 150 cm Fire detected 180 cm Fire detected 210 cm Fire detected 240 cm Fire detected 270 cm Fire detected 300 cm Fire detected 310 cm OFF No fire detected displayed consistent information by showing AuFire detectedAy during the same range of distances, confirming the reliability of the data. However, when the distance reached 310 cm, the sensor indicator changed to AuOFF,Ay and the website status displayed AuNo fire. Ay This finding indicates that the maximum effective detection range of the flame sensor is approximately 300 cm. The experiment highlights that the sensor is capable of providing stable and accurate detection performance within its effective range. The flame sensor is the most sensitive and fastest in receiving data compared to the other three sensors. The results of the flame sensor testing are presented in Table 3. This sensor operates using infrared technology to detect the light emitted by fire, meaning that the larger the fire source, the greater the detection distance will be. Based on the test results, it was observed that the flame sensor responded with an AuONAy indicator when the fire source was placed at distances ranging from 30 cm to 300 cm. This response signifies that within this range, the presence of fire was successfully detected by the sensor. The website status also Time PPM 1 637 PPM 684 PPM 676 PPM 684 PPM 676 PPM 2059 PPM 2778 PPM 3189 PPM Electricity Maps 679 PPM 678 PPM 673 PPM 674 PPM 677 PPM Table 4 presents the measurement of smoke concentration using the MQ-4 sensor and compares it with data from Electricity Maps. From 07:00 to 11:00 AM, the PPM values remained stable within the range of 637Ae684, and the detection status indicated Auno smoke. Ay However, starting Table 4. Results of Smoke Sensor Testing Remarks No smoke No smoke No smoke No smoke No smoke Smoke detected Smoke detected Smoke detected Yulianto et. / Jurnal Riset Teknologi Pencegahan Pencemaran Industri Vol 15 No 1 . 10-14 at 11:14 AM, a sharp increase was observed, reaching 3189 PPM at 11:23 AM, accompanied by a change in status to Ausmoke detected. Ay This sudden spike demonstrates that the sensor is capable of accurately detecting the presence of smoke and is highly responsive to the increase in carbon Table 5. Results of Overall Testing monoxide concentration in the air. Temperature Humidity Smoke Flame Fuzzificatio Status 28,40 AC 89,60 % 414 PPM Safe 30,20 AC 82,90 % 912 PPM Safe 31,50 AC 83,20 % 1339 PPM Alert 32,30 AC 69,80 % 403 PPM Safe 33,50 AC 66,70 % 1185 PPM Alert 34,60 AC 66,40 % 1248 PPM Alert 52,20 AC 51,56 % 324 PPM Alert 61,80 AC 32,40 % 1256 PPM Dangerous 65,70 AC 25,70 % 1117 PPM Dangerous Based on Table 5, the testing results indicate variations in the level of fire risk. The first three points are classified as AuSafe,Ay characterized by temperatures around 33AC, high humidity, and low smoke concentration, with no fire detected. Points four to six fall into the AuAlertAy category due to rising temperatures up to 39. 8AC and increased smoke levels, although no fire was yet observed. Meanwhile, points seven and eight are categorized as AuDangerousAy because of extreme temperatures exceeding 61AC, very low humidity, high smoke concentration, and the presence of fire. These findings demonstrate that temperature, humidity, and smoke concentration are critical parameters in determining the level of fire risk. By monitoring these indicators, the system can classify conditions into different risk levels, allowing for early detection and timely warnings. CONCLUSION The designed system integrates a temperature sensor (DHT. , smoke sensor (MQ-. , and flame sensor, all connected to a NodeMCU ESP8266 on an Internet of Things (IoT) platform. The data for this research were obtained from sensor measurements and calibration. This setup enables realtime detection of potential forest fires. The DHT22 measures temperature, the MQ-2 detects smoke or gas, and the flame sensor identifies fire sources. Through IoT connectivity, data is continuously transmitted for monitoring, early detection, and timely preventive action. The Fuzzy Logic method processes the sensor data to classify fire risk into Safe Alert, and Dangerous categories, providing accurate and logical results while handling uncertainties in readings. Testing shows the temperature sensor has an average error of 4. 85%, humidity sensor 4. 5%, and the flame sensor can detect fire up to 300 cm. Based on the analysis, the integration of IoT technology with Fuzzy Logic enables an intelligent and adaptive forest fire monitoring system capable of real-time data processing and decision-making. The relatively low error rates of the temperature and humidity sensors, combined with the high sensitivity of the flame sensor, demonstrate that the system performs reliably under varying environmental The classification of fire risk levels enhances situational awareness, allowing for early detection and timely preventive measures. Overall, this system offers a practical and data-driven solution for environmental monitoring, contributing to improved forest fire management and disaster mitigation strategies. REFERENCE