An Integrated IoT and Machine-Learning Framework for Weather-Aware Precision Irrigation and Nutrient Monitoring
Abstract
Most drip systems on small farms water the field on a fixed timer. They do not check how wet the soil already is or whether rain is coming, so a lot of water is wasted. This paper describes a low-cost system that fixes this. It reads soil moisture, temperature, humidity, pH, and NPK using sensors wired to a Raspberry Pi Zero W. The Pi runs the pump using a simple rule based on soil moisture, and a weather API stops the pump when rain is likely. All readings are sent to a cloud server and shown on a live web dashboard. On top of this, two Random Forest models run in the background: one suggests an irrigation action and one estimates crop yield. Both models were trained offline using a consolidated dataset created from multiple publicly available Kaggle datasets covering crop yield prediction, crop recommendation, irrigation management, and weather data. We tested the system in a field for five days. Compared with a fixed timer, it cut daily water use by $\mathbf{3 1. 5 \%}$ (from 92 to 63 L per day) and pump run time by 32.1%, and it kept soil moisture inside a narrow ±4% range. Every sensor was checked against a reference instrument and stayed within $\mathbf{3. 5 \%}$ error. On their dataset, the two models reached 98.5% accuracy and $\mathrm{R}^{2}=0.942$.