IoT-Based Indoor Localization of Cigarette Smoke Using K-Nearest Neighbor and MQ-7 Sensors

Authors

  • Anisa Ulya Darajat Universitas Lampung
  • Muhammad Qutham Najmi Abdillah Universitas Lampung
  • FX Arinto Setyawan Universitas Lampung
  • Helmy Fitriawan Universitas Lampung

Keywords:

Indoor smoke localization, MQ-7 sensor, K-Nearest Neighbor (KNN), Internet of Things (IoT), Real-time monitoring system

Abstract

Due to the high prevalence of smoking among individuals aged 15 and older in Lampung Province and limited enforcement of smoke-free areas, a system was developed to detect and map smoker locations within a 4 × 3.42-meter room using four MQ-7 sensors. The K-Nearest Neighbor (KNN) algorithm classified smoke source locations based on carbon monoxide (CO) concentrations across four designated observation zones. Experimental results indicated that the system had an average sensor reading error of 2.041%. The classification process for smoker positions achieved 93.75% accuracy and displayed smoker locations in Zones 1, 2, 3, and 4 on a dashboard map. Detection and classification data were stored in the InfluxDB database and visualized online using Grafana. The system also delivered real-time values in parts per million (ppm), the status of each zone, and a ten-minute history of ppm values

Author Biographies

Muhammad Qutham Najmi Abdillah, Universitas Lampung

Electrical Engineering Study Program, Universitas Lampung

FX Arinto Setyawan, Universitas Lampung

Electrical Engineering Study Program, Universitas Lampung

Helmy Fitriawan, Universitas Lampung

Electrical Engineering Study Program, Universitas Lampung

Downloads

Published

2026-05-31

How to Cite

Darajat, A. U., Abdillah, M. Q. N., Setyawan, F. A., & Fitriawan, H. (2026). IoT-Based Indoor Localization of Cigarette Smoke Using K-Nearest Neighbor and MQ-7 Sensors . ELECTRON Jurnal Ilmiah Teknik Elektro, 7(1), 30–37. Retrieved from https://jurnalelectron.org/index.php/electronubb/article/view/505