MQTT-Enabled Forest Fire Risk Classification Using Wokwi ESP32 Sensor Data
Keywords:
forest fire risk classification, Wokw i, ESP32, MQTT, IoT sensor data, machine learning, Random ForestAbstract
This paper presents an MQTT-enabled machine learning workflow for forest fire risk classification using an ESP32-based Wokwi simulation. The study aims to demonstrate a reproducible and low-cost prototyping pipeline in which simulated IoT sensor data are transmitted, logged, and classified before physical hardware deployment. The virtual node integrates temperature and humidity measurements, light intensity, smoke/gas level, motion state, flame trigger, rain status, OLED feedback, buzzer alarm, LED indication, and relay-based sprinkler control. To enable real-time communication, the ESP32 simulation publishes JSON-formatted sensor records to an MQTT topic, while a Python/Jupyter notebook subscribes to the topic and stores the incoming data as a CSV file. A 151-sample dataset was collected by interactively changing the Wokwi sensor values. Four supervised classifiers were then trained and tested using seven numerical features: Random Forest, Decision Tree, Support Vector Machine, and Gradient Boosting. Random Forest and Decision Tree achieved 100% test accuracy on the collected rule-labelled simulation dataset, while Gradient Boosting and SVM achieved 97.83%. The results indicate that the proposed Wokwi-MQTT-Jupyter workflow can effectively support educational demonstrations, repeatable IoT experiments, and preliminary fire-risk classification studies. However, the high classification scores should be interpreted as simulation-based performance, and future work should include hardware calibration and field-data validation.