IoT-Based Temperature and Humidity Monitoring and Control System for Quail Cages Using the K-Nearest Neighbors Algorithm - Rochmah Mawaddati, Anindya; Hamdan, Achmad; Muladi; M. Ihwanudin; Setyo Hadi, Hafid (Asosiasi Riset Ilmu Teknik Indonesia, 2026)
The stability of the microclimate in the cage is a necessity in quail farming, since the temperature and humidity directly influence the comfort, growth, health and egg production of the animals. Manual monitoring is limited by farmer availability, reaction times, and inconsistent observations, particularly in the context of rapid environmental change. This work describes the development of an Internet of Things (IoT)-based temperature and humidity monitoring and control system with the K-Nearest Neighbors (K-NN) algorithm to categorize the quail cage environment states and to facilitate autonomous actuator management. The system was designed utilizing ESP32 microcontroller, DHT22 sensor, Incandescent bulb, Blower, Firebase real time database and a monitoring application based on Flutter. The temperature and humidity data were collected from the cage environment, identified by K-NN according to the established environmental classes and used to determine actuator responses. The experimental findings indicated that the system could monitor the cage conditions in real time and operate the lamp and blower according to the intended control logic. The DHT22 sensor produced an average temperature error of approximately 3.77% and an average humidity error of approximately 7.04%. The real-time monitoring delay ranged from 1 to 4 seconds, with an average delay of about 2 seconds. In preliminary classification testing, the K-NN results showed full agreement with manual decisions for the tested samples. These findings indicate that the developed IoT and K-NN-based system can support more efficient quail cage microclimate management and provide a practical low-cost smart farming solution for small-scale poultry farmers.