Sustainable Agriculture Through IoT and Data-Driven Irrigation: Machine Learning for Soil Moisture Prediction
摘要
Integrating IoT-based sensors and machine learning models has revolutionized irrigation practices by enabling precise soil moisture prediction. This research focuses on developing an intelligent irrigation system that merges real-time environmental data acquisition with predictive analytics to optimize water use and enhance agricultural sustainability. A sensor array composed of DHT11, capacitive soil moisture sensors, DS18B20 temperature probes, and rain sensors continually tracks key environmental factors such as temperature, humidity, rainfall, and soil moisture. An ESP32 microcontroller collects these measurements and wirelessly transmits them to a Raspberry Pi 3B+, which processes the data and applies advanced machine learning algorithms for soil moisture prediction. The predicted values then guide irrigation pump operations via relays, ensuring efficient water distribution based on immediate field conditions. Among the five machine learning models tested–Gradient Boosting, Random Forest, Decision Tree, XGBoost, and Support Vector Regressor–the Gradient Boosting model achieved the strongest predictive results, with an R \(^2\) score of 0.74, RMSE of 72.16, MAE of 44.29, and MSE of 5207.28. Incorporating lagged soil moisture values further enhanced the model’s accuracy. The proposed system demonstrates how IoT and machine learning can minimize water waste, streamline irrigation schedules, and boost agricultural sustainability. Moreover, the system’s modular, scalable design ensures adaptability to a variety of climatic conditions and crop types. This study marks a notable advancement in precision irrigation, laying the foundation for further innovations in AI-driven agriculture.