In Bangladesh, adhering to prescribed irrigation schedules is critical for the sustainable production of potatoes, as climate variability combined with a lack of field-specific decision support ensures that water supplied to the crop is largely inefficient. This study presents a new Internet of Things (IoT)-based machine learning (ML) framework composed of irrigation demand forecasting and automatic irrigation control in potato fields from 7-day forecast data. The research had two rounds. Phase 1: Pre-trained ML models (XGBoost, RF, and LSTM) on publicly available datasets from Kaggle and then retrained with data obtained from peer-reviewed, trusted government sources. This dataset contains historical meteorology-based variables and soil moisture dynamics from 2015 to 2025, in addition to rainfall indicators and temporal properties. Most of the models were tested using k-fold cross-validation and were preprocessed through full-fledged preprocessing, keeping focus on hyperparameter choice. We performed a comprehensive feature engineering to account for meteorological, hydrological, and calendar effects on short-horizon irrigation demand regression. XGBoost demonstrated its superiority over other algorithms, achieving the highest predictive accuracy (R² = 0.9991), MAPE (6.71%), and MSE (93.69). In the second phase, a validated XGBoost model that integrates an IoT-based smart irrigation system was developed. It comprises a sensing and actuation layer (ESP32-based), which consists of DHT22 air temperature and relative humidity sensors, capacitive soil moisture sensing, and relay-activated pump operation. Field data are transmitted via Wi-Fi to a Node.js and Express backend for validation and storage in MongoDB, while a React and Next.js dashboard enables real-time monitoring and manual override. The system samples field data every 30 seconds, generates daily seven-day forecasts, and executes irrigation commands with a five-minute safety timeout. The proposed framework provides a practical data-driven solution for water-efficient potato cultivation in resource-constrained agricultural environments.