Developmant of Gas Hazard Environment Prediction Based on Fuzzy-KNN and MQ2 Sensor in Microcontroller

Authors

  • Sumantri K Risandriya Politeknik Negeri Batam
  • Fardiwans Marbun Politeknik Negeri Batam

DOI:

https://doi.org/10.33795/jartel.v16i2.10102

Keywords:

MQ-2 Sensor, Fuzzy-KNN, Gas Leak Detection, Microcontroller, Home Security System

Abstract

This study developed a gas hazard prediction system using the Fuzzy K-Nearest Neighbor (Fuzzy-KNN) method and an MQ-2 sensor on an Arduino Uno. The system addresses the growing risks of LPG, smoke, and methane leaks in household environments. The MQ-2 sensor was selected for its high sensitivity, while Fuzzy-KNN helps reduce data uncertainty in classifying hazard levels.The system process includes sensor data collection, Euclidean distance calculation with K = 3, fuzzy membership weighting, and classification into safe, alert, and danger categories. Outputs are provided through an LCD display and early warnings using a buzzer and LED. Testing with 46 samples achieved 87% accuracy and a response time of less than one second, demonstrating that the system can detect gas leaks in real time and has strong potential to improve home safety.

References

D. Nurjanah, H. Handayani, et al., “Rancang Bangun Pendeteksi dan Penetralisir Asap Rokok Dalam Ruangan Menggunakan Sensor MQ-2 dan Metode Fuzzy Logic,” Student Journal, vol. IV, pp. 7–14, 2023.

I. Muslem R., “Sistem Pendeteksi Kebocoran Gas Rumah Tangga Menggunakan MQ-2 Sensor dan Mikrokontroler,” Jurnal Tika, vol. 6, no. 02, pp. 58–64, 2021, doi: 10.51179/tika.v6i02.457.

L. H. Zain, E. Setiawan, and H. Fitriyah, “Sistem Deteksi Kematangan Buah Mangga Berdasarkan Kandungan Gas NH3, C2H5OH, dan VOCs Menggunakan Metode K-Nearest Neighbor (K-NN),” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 5, no. 9, pp. 3792–3798, 2021. [Online]. Available: http://j-ptiik.ub.ac.id

I. A. Rombang, L. B. Setyawan, and G. Dewantoro, “Perancangan Prototipe Alat Deteksi Asap Rokok dengan Sistem Purifier Menggunakan Sensor MQ-135 dan MQ-2,” Techné: Jurnal Ilmiah Elektroteknik, vol. 21, no. 1, pp. 131–144, 2022, doi: 10.31358/techne.v21i1.312.

A. Rofik, “Analisis Kebocoran Gas LPG dengan Menggunakan Sensor Gas MQ-2,” SinarFe7, pp. 206–208, 2021.

S. W. I. Made, A. A. N. Gunawan, P. I. Ketut, and S. I. Ketut, “Design and Manufacture of LPG Gas Leak Detection Based on Arduino Uno Using MQ-2 Sensor,” Asian Journal of Research and Review in Physics, vol. 8, no. 1, pp. 27–32, 2024, doi: 10.9734/ajr2p/2024/v8i1155.

E. Talakua, “Implementasi Sensor Gas untuk Deteksi Jenis Bahan Bakar Kendaraan Bermotor Menggunakan Metode Fuzzy Mamdani,” Cyclotron, vol. 7, no. 01, pp. 76–83, 2024, doi: 10.30651/cl.v7i01.21445.

N. Real-time and D. Winarti, “Sistem Monitoring dan Deteksi Kebocoran Gas LPG Berbasis IoT Dengan,” vol. 5, no. 3, 2025, doi: 10.58794/jekin.v5i3.1644.

Amir, Fazri, Novianda, Maulan, and Rahmat, “Sistem Pendeteksi Kebocoran Liquefied Petroleum Gas Menggunakan Metode Fuzzy Logic Mamdani Berbasis Internet of Things,” Jurnal Teknologi, vol. 12, no. 2, pp. 151–158, 2020.

H. Salem, M. Y. Shams, O. M. Elzeki, M. A. Elfattah, J. F. Al-Amri, and S. Elnazer, “Fine-Tuning Fuzzy KNN Classifier Based on Uncertainty Membership for the Medical Diagnosis of Diabetes,” Applied Sciences, vol. 12, no. 3, pp. 1–26, 2022, doi: 10.3390/app12030950.

Z. Behdani, M. D., “Fuzzy K-Nearest Neighbor in Classification and Regression,” Journal of Data Science and Computational Modeling, vol. 2, no. 2, pp. 217–244, 2024. [Online]. Available: https://jdscm.atu.ac.ir/article_18938.html

F. M. N. Akbar, “Metode KNN (K-Nearest Neighbor) untuk Menentukan Kualitas Air,” Jurnal Tekno Kompak, vol. 18, no. 1, p. 28, 2024, doi: 10.33365/jtk.v18i1.3241.

M. Mailagaha Kumbure and P. Luukka, “A Generalized Fuzzy K-Nearest Neighbor Regression Model Based on Minkowski Distance,” Granular Computing, vol. 7, no. 3, pp. 657–671, 2022, doi: 10.1007/s41066-021-00288-w.

A. A. Amer, S. D. Ravana, and R. A. A. Habeeb, “On Enhancing Data Classification Using Local Mean-Based Fuzzy K-Nearest Neighbor Algorithms,” Advances in Data Analysis and Classification, 2025, doi: 10.1007/s11634-025-00653-6.

A. D. Churniawan, “Deteksi Kondisi Udara dengan Sensor MQ Series dan MG Menggunakan Multi-Layer Perceptron,” vol. 4, no. 1, pp. 165–170, 2025, doi: 10.31284/p.semtik.2025-1.7012.

F. Sharifonnasabi et al., “Hybrid HCNN-KNN Model Enhances Age Estimation Accuracy in Orthopantomography,” Frontiers in Public Health, vol. 10, no. May, pp. 1–14, 2022, doi: 10.3389/fpubh.2022.879418.

Downloads

Published

30-06-2026

How to Cite

Risandriya, S. K., & Marbun, F. (2026). Developmant of Gas Hazard Environment Prediction Based on Fuzzy-KNN and MQ2 Sensor in Microcontroller. JURNAL JARTEL: Jurnal Jaringan Telekomunikasi, 16(2), 138–144. https://doi.org/10.33795/jartel.v16i2.10102