Rancang Bangun Sistem Klasifikasi Status Bahaya Kebakaran Hutan Berbasis Edge Computing pada Jaringan Komunikasi LoRa Mesh
A full-stack Internet of Things (IoT) and TinyML project designed for early forest fire detection. This system utilizes low-power edge nodes running machine learning models locally, communicates via a robust wireless LoRa Mesh network utilizing LoRaMesher Library, and visualizes real-time environmental data through an interactive web dashboard using streamlit.
This repository is organized as a mono-repo containing three main architectural components:
C:.
├───dashboard-streamlit/ <-- Web-based monitoring dashboard (Streamlit)
│ ├── app.py
│ ├── config_nodes.json
│ ├── requirements.txt
│ └── serial_log.txt
│
├───firmware/ <-- C++ Coded Hardware Firmware (PlatformIO)
│ │ .gitignore
│ │ platformio.ini
│ └───src
│ ├───edge-node/ <-- Local inference & Sensor Acquisition
│ └───sink-node/ <-- Central Gateway Router
│
└───model-development/ <-- Machine Learning research & TinyML Export
├── MLResearch_Skripsi.ipynb
├── model_data.h
└── requirements.txt
Developed in C++ using PlatformIO and FreeRTOS scheduling on the ESP32 DevKit V1 platform. It operates in multiple environments via platformio.ini targets:
-
Edge Node: Acquires atmospheric metrics via BME280 (Temperature, Humidity, Pressure) and air quality via MQ135 gas sensor. Performs localized TinyML classification and broadcasts hazard status via LoRa SX1278 (Ra-02) utilizing the
LoRaMesherrouting protocol. - Sink Node / Gateway: Listens to incoming multi-hop mesh messages from the field network and relays packet data directly to the monitoring station over Serial communication.
-
Sensor Calibration Tool: Separate standalone executable (
calibrate_mq135.cpp) to precisely determine individual sensor baseline resistance ($R_0$ ) values before deployment.
Contains the end-to-end TinyML pipeline implemented inside Jupyter Notebook (.ipynb):
- Features preprocessing including Z-Score Normalization and MinMax Scaling.
- Comparative study of three classification algorithms: Random Forest, Logistic Regression, and Artificial Neural Networks (ANN).
- Automated model compilation into an optimized, bare-metal compatible C-array file (
model_data.h) for deployment onto constrained embedded systems.
A responsive telemetry web interface built on Python Streamlit:
- Parses structural network definitions via
config_nodes.jsonfor dynamic node location mapping. - Renders real-time telemetry updates from the serial pipeline.
- Features modular visualizations tracking both instant microclimate trends and systemic telemetry logs safely stored in
serial_log.txt(local-only cache).
- Open the
/firmwaredirectory inside VS Code with the PlatformIO extension active. - Select your desired environment from the PlatformIO Env bar:
env:calibrate-mq135(For initial sensor baseline profiling)env:edge-node(For deployment on edge sensor nodes)env:sink-node(For building the gateway router)
- Connect your target ESP32 module and execute the Build & Upload command.
- Navigate to the dashboard directory:
cd dashboard-streamlit
- Install dependencies:
pip install -r requirements.txt
- Boot the application:
streamlit run app.py
-
BME280 Connection (I2C): SDA
$\rightarrow$ GPIO21, SCL$\rightarrow$ GPIO22 -
LoRa Ra-02 Connection (SPI): SCK
$\rightarrow$ GPIO18, MISO$\rightarrow$ GPIO19, MOSI$\rightarrow$ GPIO23, NSS/CS$\rightarrow$ GPIO5, DIO0$\rightarrow$ GPIO2 - Power Delivery Architecture: Regulated via an MT3608 2A Boost Converter fed by standard LG 18650 Li-ion batteries with embedded bulk decoupling capacitors (Panasonic FR 1000µF 16V Low-ESR) placed parallel to the VCC rail to filter out transmit-induced voltage drops.
If you want to reference this source code repository inside your academic paper or undergraduate thesis, please adapt the manual bibliography details as follows:
- Type: Web Page
- Author: Paramaditya, Thoriq Kusuma
- Title: Source Code: Rancang Bangun Sistem Klasifikasi Status Bahaya Kebakaran Hutan Berbasis Edge Computing pada Jaringan Komunikasi LoRa Mesh
- Publisher/Repository: GitHub Repository
- Year: 2026
- URL:
https://github.com/prmditya/wildfire-detection-system
This project is documented and open-sourced under the terms of the MIT License.