Our work is dedicated to enhancing sustainability through improved energy efficiency in buildings, with a specific focus on heating and cooling control and the optimization of thermal comfort of occupants. With an energy consumption of more than 60% in buildings, HVAC systems are the biggest energy users. By integrating advanced technology, data algorithms, and digital twins, our study aims to optimize energy performance effectively. We have developed a Neural Network-based Model Predictive Control (NNMPC) to achieve this goal. Leveraging technologies such as MQTT communication, Wi-Fi modules, and field-programmable gate arrays will enhance scalability and flexibility. Our findings demonstrate the efficacy of the NNMPC system deployed on the PYNQ board for reducing sensible thermal energy usage for both cooling and heating purposes. Compared to traditional On/Off control systems, the NNMPC achieved an impressive 40.8% reduction in heating energy consumption and a 37.8% decrease in cooling energy consumption in 2006. In comparison to the On/Off technique, the NNMPC demonstrated a 25.6% reduction in annual heating energy consumption and a 28.8% drop in annual cooling energy consumption in the simulated year of 2017. We observed that, across all strategies and platforms, there were no instances where the Predicted Mean Vote (PMV) fell below −0.5. However, a significant proportion of PMV values (ranging from 65% to 83%) were observed between −0.5 and 0.5, signifying a high level of occupant comfort. Additionally, for PMV values between 0.5 and 1.0, percentages ranged from 16% to 33% for both years. Importantly, the NNMPC exhibited notable efficiency in maintaining occupants’ comfort within this range, requiring less energy while ensuring highly satisfactory environments.