Random Forest Regression for Energy Consumption Prediction on Raspberry Pi Edge Computing

  • Mada Jimmy Fonda Arifianto Astra Polytechnic West Java, Indonesia
  • Waluyo Nugroho Astra Polytechnic
  • Afianto Astra Polytechnic West Java, Indonesia
Keywords: Edge Computing, Energy Management, Internet of Things, Random Forest Regression, Raspberry Pi

Abstract

Efficient energy management in smart homes is critical for cost reduction and sustainability, yet conventional cloud-based monitoring systems often face challenges related to network latency, bandwidth consumption, and data privacy. This study proposes an Edge Computing architecture to predict electrical energy consumption locally using a Raspberry Pi, thereby eliminating the dependency on continuous cloud processing. The system integrates a PZEM-004T sensor to acquire real-time voltage, current, and power data, while the core intelligence is built upon the Random Forest Regression (RFR) algorithm trained and deployed directly on the Raspberry Pi to forecast short-term energy load based on historical usage patterns and Internet of Things (IoT). Experimental results demonstrate that the proposed edge system achieves high prediction accuracy with an R2 score of 0.94 and a Mean Absolute Percentage Error (MAPE) of 4.25%, and a Root Mean Square Error (RMSE) of 12.80 Watts using a model configuration of 100 estimators, confirming that Raspberry Pi based edge computing is a viable, low latency, and privacy preserving solution for intelligent energy management

Downloads

Download data is not yet available.

References

C. Krishna Rao, S. K. Sahoo, and F. F. Yanine, “IoT enabled Intelligent Energy Management System employing advanced forecasting algorithms and load optimization strategies to enhance renewable energy generation,” Unconventional Resources, vol. 4, Jan. 2024, doi: 10.1016/j.uncres.2024.100101.

W. Nugroho, M. J. F. Arifianto, A. Afianto, A. Wicaksono, and N. Nursim, “Web based IoT monitoring system for ultrasonic water flow measurement using ESP32-S3 and cloud database,” Journal of Soft Computing Exploration, vol. 6, no. 4, pp. 258–265, Dec. 2025, doi: 10.52465/joscex.v6i4.625.

N. Rouibah et al., “Smart monitoring of photovoltaic energy systems: An IoT-based prototype approach,” Sci. Afr., vol. 30, Dec. 2025, doi: 10.1016/j.sciaf.2025.e02973.

M. Anusha, P. B. Kumar, V. Akhil, M. Gouthami, M. C. Chinnaaiah, and S. Shaik, “Internet of Things (IOT) based energy monitoring with ESP 32 and using Thingspeak,” in Proceedings of the 2024 10th International Conference on Communication and Signal Processing, ICCSP 2024, Institute of Electrical and Electronics Engineers Inc., 2024, pp. 1383–1387. doi: 10.1109/ICCSP60870.2024.10543944.

C. K. Rao, S. K. Sahoo, and F. F. Yanine, “Development of a smart cloud-based monitoring system for solar photovoltaic energy generation,” Unconventional Resources, vol. 6, Apr. 2025, doi: 10.1016/j.uncres.2025.100173.

M. Zeynivand, P. Esmaili, L. Cristaldi, and G. Gruosso, “A novel approach to digital twin-based energy efficiency monitoring and failure analysis in industrial applications,” J. Manuf. Syst., vol. 83, pp. 612–625, Dec. 2025, doi: 10.1016/j.jmsy.2025.10.011.

W. Nugroho, R. Zahabiyah, M. J. F. Arifiant, and A. Afianto, “Automated Component Detection for Quality PCB Using YOLO Algorithm with IoT Real-Time Streaming on Raspberry Pi,” JURNAL INFOTEL, vol. 17, no. 2, Jul. 2025, doi: 10.20895/infotel.v17i2.1313.

K. Rzepka, P. Szary, K. Cabaj, and W. Mazurczyk, “Performance evaluation of Raspberry Pi 4 and STM32 Nucleo boards for security-related operations in IoT environments,” Computer Networks, vol. 242, Apr. 2024, doi: 10.1016/j.comnet.2024.110252.

S. H. M. Mehr, “CtrlAer: Programmable real-time execution of scientific experiments using a domain specific language for the Raspberry Pi Pico/Pico 2,” SoftwareX, vol. 30, May 2025, doi: 10.1016/j.softx.2025.102175.

A. Perçuku, D. Minkovska, and N. Hinov, “Enhancing Electricity Load Forecasting with Machine Learning and Deep Learning,” Technologies (Basel)., vol. 13, no. 2, Feb. 2025, doi: 10.3390/technologies13020059.

Q. Dong et al., “Short-Term Electricity-Load Forecasting by Deep Learning: A Comprehensive Survey,” May 2025, doi: 10.1016/j.engappai.2025.110980.

O. Timur and H. Y. Üstünel, “Short-Term Electric Load Forecasting for an Industrial Plant Using Machine Learning-Based Algorithms †,” Energies (Basel)., vol. 18, no. 5, Mar. 2025, doi: 10.3390/en18051144.

E. Belloni, C. V. Fiorini, A. Massaccesi, R. Menichelli, C. Moscatiello, and L. Martirano, “Design, strategies, and performance monitoring for nearly zero energy buildings (nZEB): optimization and economic/environmental analysis in energy districts context,” Energy Build., vol. 347, Nov. 2025, doi: 10.1016/j.enbuild.2025.116186.

H. J. El-Khozondar et al., “A smart energy monitoring system using ESP32 microcontroller,” e-Prime - Advances in Electrical Engineering, Electronics and Energy, vol. 9, Sep. 2024, doi: 10.1016/j.prime.2024.100666.

P. Rajkumar, “Humidity and temperature monitoring using Raspberry Pi via RS232 networking,” Array, vol. 27, Sep. 2025, doi: 10.1016/j.array.2025.100464.

M. D. Mudaliar and N. Sivakumar, “IoT based real time energy monitoring system using Raspberry Pi,” Internet of Things (Netherlands), vol. 12, Dec. 2020, doi: 10.1016/j.iot.2020.100292.

H. O. Garcés, J. Godoy, G. Riffo, N. F. Sepúlveda, E. Espinosa, and M. A. Ahmed, “Development of an IoT-Enabled Smart Electricity Meter for Real-Time Energy Monitoring and Efficiency,” Electronics (Switzerland), vol. 14, no. 6, Mar. 2025, doi: 10.3390/electronics14061173.

D. N. Molokomme, A. J. Onumanyi, and A. M. Abu-Mahfouz, “Edge Intelligence in Smart Grids: A Survey on Architectures, Offloading Models, Cyber Security Measures, and Challenges,” Journal of Sensor and Actuator Networks, vol. 11, no. 3, Sep. 2022, doi: 10.3390/jsan11030047.

Z. Mustaffa and M. H. Sulaiman, “Random forest based wind power prediction method for sustainable energy system,” Cleaner Energy Systems, vol. 12, Dec. 2025, doi: 10.1016/j.cles.2025.100210.

W. Nugroho, A. Ponco, and A. Info, “Design and Implementation of an IoT-Enabled Deep Learning Vision System for Automated Dimensional Measurement in Smart Manufacturing Published by Politeknik Piksi Ganesha Indonesia,” vol. 9, no. 2, pp. 537–554, 2025, [Online]. Available: https://doi.org/10.373

W. Nugroho, A. Alfattah, M. Jimmy, F. Arifianto, and A. Hadi, “Automated Waste Classification for Sustainable Cities Using YOLO Based CNN Integrated IoT,” APIC, 2025.

W. Nugroho, Rifdah Zahabiyah, Afianto, and Mada Jimmy Fonda Arifianto, “Application of Deep Learning YOLO in IoT System for Personal Protective Equipment Detection,” Jurnal E-Komtek (Elektro-Komputer-Teknik), vol. 8, no. 2, pp. 428–437, Dec. 2024, doi: 10.37339/e-komtek.v8i2.2187.

M. Zini and C. Carcasci, “Machine learning-based energy monitoring method applied to the HVAC systems electricity demand of an Italian healthcare facility,” Smart Energy, vol. 14, May 2024, doi: 10.1016/j.segy.2024.100137.

C. M. Nkinyam, C. O. Ujah, C. O. Asadu, B. Anyaka, and P. A. Olubambi, “Development of a low-cost monitoring device for solar electric (PV) system using internet of things (IoT),” Results in Engineering, vol. 28, Dec. 2025, doi: 10.1016/j.rineng.2025.107324.

Y. R, S. K. D, S. A. Bhalerao, K. Murugesan, S. Vellaiyan, and N. Van Minh, “Real-time fire detection and suppression system using YOLO11n and Raspberry Pi for thermal safety applications,” Case Studies in Thermal Engineering, vol. 75, p. 107159, Nov. 2025, doi: 10.1016/j.csite.2025.107159.

I. Al-Surqi, P. R. Moola, M. Al-Himali, K. S. Hamed Saif Al-Sarhani, N. K. Hilal Al-Qalhati, and A. S. Mohammed Salim Al-Aghbari, “Cloud based data Analytics and Control of Substation Transformer and Transmission Lines using IoT,” in Procedia Computer Science, Elsevier B.V., 2025, pp. 712–726. doi: 10.1016/j.procs.2025.04.304.

B. Du, “Improving the accuracy of machine learning models in predicting evacuated tube solar collector through Random Forest replacement,” Thermal Science and Engineering Progress, vol. 69, Jan. 2026, doi: 10.1016/j.tsep.2026.104480.

N. E. Karabadji et al., “Towards Better Random Forests with Tree Weighting, Accuracy and Diversity-Preserving Pruning,” Expert Syst. Appl., p. 131256, May 2026, doi: 10.1016/j.eswa.2026.131256.

T. Ait tchakoucht, B. Elkari, Y. Chaibi, and T. Kousksou, “Random forest with feature selection and K-fold cross validation for predicting the electrical and thermal efficiencies of air based photovoltaic-thermal systems,” Energy Reports, vol. 12, pp. 988–999, Dec. 2024, doi: 10.1016/j.egyr.2024.07.002.

M. Fellah, S. Ouhaibi, N. Belouaggadia, and K. Mansouri, “Energy consumption forecasting and thermal insulator selection with random forest regression,” Sci. Afr., vol. 29, Sep. 2025, doi: 10.1016/j.sciaf.2025.e02870.

Published
2026-05-18
How to Cite
Arifianto, M. J. F., Nugroho, W., & Afianto. (2026). Random Forest Regression for Energy Consumption Prediction on Raspberry Pi Edge Computing. Jurnal Sistem Cerdas, 9(1), 144 - 155. https://doi.org/10.37396/jsc.v9i1.632
Section
Articles

Most read articles by the same author(s)