Development of a Machine Learning-Based Energy Prediction Model for Solar-Powered Offices
DOI:
https://doi.org/10.70118/ujet.2026.0302.41Keywords:
Solar Photovoltaic, Machine Learning, Random Forest, Energy Forecasting, Smart OfficeAbstract
Reliable energy forecasting has intensified. This paper presents the design and implementation of a machine learning-based solar power prediction system tailored for a 1.5 kVA solar-powered office environment. The primary objective is to accurately forecast photovoltaic (PV) energy production using real-time environmental data, thereby enhancing energy planning and reducing grid dependency. The system architecture integrates an ESP32 microcontroller with voltage and current sensors, along with a BME280 sensor for capturing temperature, humidity, and pressure. These sensor readings are transmitted to a cloud-based MySQL database via Wi-Fi and used to compute real-time power output. A Random Forest Regressor model is trained on the historical dataset comprising these features, with timestamp-derived inputs like hour of the day and day of the week. Model evaluation shows strong performance with an R² of 0.89, root mean square error (RMSE) of 23.91 W, and mean absolute error (MAE) of 18.27 W, indicating good predictive accuracy for short-term solar energy forecasting. The forecast results are displayed via a responsive web dashboard built with HTML, CSS, PHP, and JavaScript, offering live monitoring and daily prediction visibility to users. The system offers a practical and low-cost framework that bridges embedded hardware and AI-based forecasting for small-scale solar systems. This study validates the viability of using supervised learning with Internet of Things (IoT)-enabled sensor networks to support intelligent energy management in office settings. Future improvements may include model deployment on edge devices and automation of forecast scheduling for complete real-time autonomy.
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 UNIABUJA Journal of Engineering and Technology (UJET)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.