Uncontrolled organic waste releases volatile gases such as ammonia, hydrogen sulfide, and assorted volatile organic compounds that signal active decomposition and create both nuisance and health risk. Conventional odor monitoring relies on human olfaction or on laboratory instruments that are subjective, intermittent, or too costly for continuous deployment. This study presents a low-cost early-warning system that performs odor classification entirely at the edge on an ESP32 microcontroller. A gas sensor array (electronic nose) comprising six metal-oxide MQ sensors (MQ2, MQ3, MQ4, MQ8, MQ9, and MQ135) was used to acquire 184 labelled samples evenly split between a normal class and an odor-warning class. A Decision Tree classifier was trained, and the resulting decision logic was distilled into a compact set of human-readable threshold rules suitable for execution on a constrained microcontroller. Principal component analysis confirmed that the two odor states form clearly separable clusters (the first two components explain 89.7% of the variance). The extracted rule set attained 100% accuracy, precision, recall, and F1-score on a held-out test set, matching heavier models (random forest, support-vector machine, k-nearest neighbours) while requiring only a few bytes of memory and a handful of comparison operations per inference. To probe real-world reliability, a Gaussian sensor-noise injection study and a single-sensor-failure study were conducted. A redundant three-sensor majority-vote rule preserved above 95% accuracy at a noise level of 50% of the feature standard deviation and remained near 100% even when any single sensor failed, whereas a single-sensor rule collapsed to 48.6% on failure of its governing sensor. The results demonstrate that edge intelligence based on extracted decision-tree rules offers an accurate, interpretable, fault-tolerant, and extremely lightweight solution for continuous on-site waste-odor early warning.
Copyrights © 2026