Unpredictable climate patterns and mounting groundwater depletion are major challenges to sustainable agriculture. The purpose of this research is to improve predictive accuracy in IoT-based smart irrigation systems using machine learning models for soil fertility estimation and water optimization. In contrast to existing research, this paper compares state-of-the-art ensemble learning models (LRBoost, LR+RF) with conventional methods to ascertain their real-time effectiveness in water usage prediction. Training and testing data were derived from open access agricultural data repositories, including soil moisture, temperature, humidity, and rainfall. Feature selection was performed through correlation analysis and model performance was evaluated using R2 score, mean squared error (MSE), and root mean squared error (RMSE). Our results indicate that the hybrid ensemble model LR+RF performed better than others with an R2 measure of 96.34%, an MSE of 0.0016, and an RMSE of 0.040. The findings confirm the capability of the system in minimizing water wastage and maximizing crop production.