PREDIKSI OPERASI POMPA BAWANG MERAH MENGGUNAKAN KNN BERBASIS RASPBERRY PI
Abstract
This study aims to develop an environmental monitoring and irrigation pump control system for shallot plants based on Raspberry Pi using the K-Nearest Neighbor (KNN) method. The system uses soil moisture 1, soil moisture 2, air temperature, and air humidity as input parameters to determine the pump condition, ON /OFF. Sensor data are processed using KNN to generate automatic pump control decisions. The system is also equipped with a web-based monitoring interface accessible via smartphone. Testing was conducted using 30 testing data with several K values. The results showed that K=5 achieved the best performance, with an accuracy of 83.33%, precision of 100.00%, recall of 68.75%, and F1-score of 81.48%. Field testing compared the KNN method with the ON/OFF method. The KNN system used 3.375 L of water, while the ON/OFF method used 11.111 L, resulting in water savings of 7.736 L or 69.62%. These results indicate that implementing KNN on Raspberry Pi has the potential to improve water-use efficiency in an automatic irrigation system for shallot plants. Keywords — shallot, automatic irrigation, K-Nearest Neighbor, Raspberry Pi, smart agriculture