Development of a solar photovoltaic power prediction system based on CNN and transformer with real-time NB-IoT interface
Abstract
With the increasing global demand for renewable energy, solar power generation has become a major form of green energy. However, its output is strongly influenced by weather and environmental conditions, resulting in instability and intermittency. Therefore, developing a real-time monitoring and accurate forecasting system is essential. This study aims to establish an intelligent solar power monitoring and forecasting system by integrating Internet of Things (IoT) technology with deep learning models to enhance generation efficiency and energy management. For monitoring, the system uses the ESP32 as the core controller to acquire inverter electrical parameters through RS485 communication, while NB-IoT and MQTT are adopted to transmit real-time data to a cloud platform. Through a web interface, users can monitor generation status, review historical data, and download records, enabling remote and intelligent management. For power forecasting, this study proposes a hybrid CNN-Transformer model. The CNN extracts local features from the data, while the Transformer captures long-term temporal dependencies through its self-attention mechanism, improving forecasting accuracy. Experimental results show good convergence during training, and the predicted curves are highly consistent with actual generation trends, indicating strong accuracy and stability. Overall, this study integrates real-time monitoring and power forecasting into a low-cost, efficient, and practical intelligent solar power generation system, providing a useful reference for future smart grid and energy management applications.