Integration of IoT and predictive modeling is critical for optimizing microclimate management in urban-agglomeration vertical farming. In this study, we present a hybrid digital twin approach that combines a physical microclimate model with a distributed IoT monitoring system to simulate and control the phytotron environment. A set of heat- and mass-balance equations governing the dynamics of temperature, humidity, and transpiration was implemented and parameterized using a genetic algorithm (GA)—an evolutionary optimization method—with real-time data collected over three intervals (72 h, 90 h, and 110 h) from LoRaWAN sensors (temperature, humidity, CO2) and Wi-Fi-connected power meters managed by Home Assistant. The optimized model achieved mean temperature deviations ≤ 0.1 °C, relative humidity errors ≤ 2%, and overall energy consumption accuracy of 99.5% compared to measured values. The digital twin reliably tracked daily climate fluctuations and system energy use, confirming the accuracy of the hybrid approach. These results demonstrate that the proposed framework effectively integrates theoretical models with IoT-derived data to deliver precise environmental control and energy-use optimization in vertical farming, while also laying the groundwork for scalable digital twins in controlled-environment agriculture.
Digital twins (DTs) are increasingly used in controlled-environment agriculture to model microclimates and drive energy-efficient control. However, long-term drift and seasonal variability require continuous recalibration and controller retuning. We develop a self-adaptive DT of a phytotron chamber that combines an MAPE-K loop with an evolutionary heuristic. A genetic algorithm (GA) calibrates the DT parameters against IoT time series and subsequently optimizes heater control settings (two-position, three-position, and proportional modes) subject to comfort constraints on temperature and humidity. Six monitoring intervals (May–June 2025) are used for per-interval calibration and six-fold cross-validation. The calibrated DT reproduces temperature and humidity with high fidelity across unseen intervals: the average cross-validated deviations are 0.27 °C and 7.1%RH (30 transfers). Controller optimization yields cumulative energy savings of 186.54 kWh (3.24%) over six intervals, with per-interval savings ranging from 0.37% to 5.94%. Coupling GA-based DT calibration with model-in-the-loop controller optimization consistently reduces energy use while maintaining microclimate quality, providing a practical pathway for the robust, year-round operation of vertical farms.