Journal Of Artificial Intelligence And Software Engineering
Vol 6, No 2 (2026): Juni (OnProgress)

IoT-Based Water Quality Monitoring System Using ESP32 and K-Nearest Neighbor Algorithm

Fiqri Rizaldi Azlin Hasibuan (Sistem Informasi, Fakultas Sains dan Teknologi, Universitas Prima Indonesia, Medan, 20112, Indonesia)
Man Vredus Zalukhu (Sistem Informasi, Fakultas Sains dan Teknologi, Universitas Prima Indonesia, Medan, 20112, Indonesia)
Della Agnesia Simamora (Sistem Informasi, Fakultas Sains dan Teknologi, Universitas Prima Indonesia, Medan, 20112, Indonesia)
Muhammad Irfan Fahmi (Sistem Informasi, Fakultas Sains dan Teknologi, Universitas Prima Indonesia, Medan, 20112, Indonesia)



Article Info

Publish Date
30 Jun 2026

Abstract

Conventional water monitoring is often time-consuming and hinders decision-making. Amidst IoT advancements, few systems feature automatic correction mechanisms. This study develops an IoT-based water monitoring system to read pH, temperature, and turbidity in real-time. The NodeMCU ESP32 is used as the main microcontroller connected to pH, DS18B20, and turbidity sensors. Data is collected every 15 minutes, uploaded to Firebase via Wi-Fi, and visualized on a web dashboard. The system implements the K-Nearest Neighbor (K-NN) algorithm with Euclidean Distance to categorize water as good, moderate, or poor. This result triggers an automatic pH-balancing pump actuator if the value falls outside the normal range (6.5–8.5). This laboratory-scale prototype proves that the synergy of ESP32, Firebase, and K-NN overcomes the weaknesses of manual methods, resulting in accurate, efficient, and sustainable water monitoring.

Copyrights © 2026






Journal Info

Abbrev

JAISE

Publisher

Subject

Computer Science & IT

Description

Artificial Intelligence Natural Language Processing Computer Vision Robotics and Navigation Systems Decision Support System Implementation of Algorithms Expert System Data Mining Enterprise Architecture Design & Management Software & Networking Engineering ...