Smart Energy Digital Twin: Real-Time 3D Spatial Visualization and IoT-Based Residential Energy Management
DOI:
https://doi.org/10.5281/zenodo.24011813Keywords:
Digital Twin, Internet of Things, Energy Management, WebGL, Three.js, Smart Home, Rule-Based Expert SystemAbstract
Residential electricity consumers typically learn about their consumption only when the monthly bill arrives, without knowing which room or appliance wastes the most energy. Conventional meters display energy in kilowatt-hours rather than real-time monetary cost and provide no early warning when the load approaches the circuit limit, risking miniature circuit breaker (MCB) trips. This paper presents Smart Energy Digital Twin, a system that combines an interactive 3D spatial visualization of a house built with WebGL (Three.js) with real-time Internet of Things (IoT) energy monitoring. The hardware layer uses an ESP32 microcontroller, a PZEM-004T AC power sensor, and relay modules; measurements are synchronized between the physical house and its virtual replica through the Firebase Realtime Database. A rule-based expert system converts instantaneous power into Indonesian Rupiah using dynamic PLN tariffs ranging from 450 VA to 5500 VA and raises early warnings for overload conditions and wasteful usage patterns. The prototype implements spatial 3D interaction with smooth gliding camera transitions, a live power chart, an AI alert box, and two-way IoT control for switching appliances on and off. Functional testing confirms that the three heuristic rules correctly trigger overload alarms, wasteful-pattern advisories, and eco-mode power reduction. The tariff conversion covers seven residential classes from 450 VA to 5500 VA, and the 3D visualization embeds every measurement in its physical room location so users immediately see where energy is consumed. The main contribution is the integration of spatial 3D visualization, financial monitoring, and heuristic AI alerts into a single residential digital twin, a combination rarely addressed in previous studies that focus on two-dimensional dashboards or industrial-scale twins.
References
[2] A. Fuller, Z. Fan, C. Day, and C. Barlow, "Digital Twin: Enabling Technologies, Challenges and Open Research," IEEE Access, vol. 8, pp. 108952–108971, 2020.
[3] S. M. E. Sepasgozar, "Differentiating digital twin from digital shadow: Elucidating a paradigm shift to expedite a smart, sustainable built environment," Buildings, vol. 11, no. 4, p. 151, 2021.
[4] S. H. Khajavi, N. H. Motlagh, A. Jaribion, L. C. Werner, and J. Holmström, "Digital twin: Vision, benefits, boundaries, and creation for buildings," IEEE Access, vol. 7, pp. 147406–147419, 2019.
[5] M. Boukaf, F. Fadli, and N. Meskin, "A comprehensive review of digital twin technology in building energy consumption forecasting," IEEE Access, vol. 12, pp. 187778–187799, 2024.
[6] S. Agostinelli, F. Cumo, G. Guidi, and C. Tomazzoli, "Cyber-Physical Systems Improving Building Energy Management: Digital Twin and Artificial Intelligence," Energies, vol. 14, no. 8, 2338, 2021.
[7] A. Francisco, N. Mohammadi, and J. E. Taylor, "Smart City Digital Twin–Enabled Energy Management: Toward Real-Time Urban Building Energy Benchmarking," J. Manage. Eng., vol. 36, no. 2, 04019045, 2020.
[8] S. B. Poore, R. E. Alden, H. Gong, and D. M. Ionel, "Multi-physics and artificial intelligence models for digital twin implementations of residential electric loads," in Proc. IEEE Int. Conf. on Renewable Energy Research and Application (ICRERA), 2022.
[9] Y. Fathy, M. Jaber, and Z. Nadeem, "Digital twin-driven decision making and planning for energy consumption," J. Sensor and Actuator Networks, vol. 10, no. 2, p. 37, 2021.
[10] T. Sinthamrongruk et al., "A Lightweight Web3D Digital Twin Framework for Real-Time ESG Monitoring Using IoT Sensors," Electronics, vol. 15, no. 8, 1736, 2026.
[11] D. Alahakoon and X. Yu, "Smart Electricity Meter Data Intelligence for Future Energy Systems: A Survey," IEEE Trans. Ind. Informat., vol. 12, no. 1, pp. 425–436, Feb. 2016.
[12] M. Opoku Agyeman, Z. Al-Waisi, and I. Hoxha, "Design and Implementation of an IoT-Based Energy Monitoring System for Managing Smart Homes," in Proc. IEEE Int. Workshop on Internet of Things: Networking Applications and Technologies (IoTNAT 2019), pp. 253–258, 2019.
[13] J. S. Vardakas, N. Zorba, and C. V. Verikoukis, "A Survey on Demand Response Programs in Smart Grids: Pricing Methods and Optimization Algorithms," IEEE Commun. Surveys Tuts., vol. 17, no. 1, pp. 152–178, 2015.
[14] A. Faruqui and S. Sergici, "Household Response to Dynamic Pricing of Electricity: A Survey of 15 Experiments," J. Regulatory Economics, vol. 38, no. 2, pp. 193–225, 2010.
[15] Z. Zhao, W. C. Lee, Y. Shin, and K.-B. Song, "An Optimal Power Scheduling Method for Demand Response in Home Energy Management System," IEEE Trans. Smart Grid, vol. 4, no. 3, pp. 1391–1400, 2013.
[16] A.-H. Mohsenian-Rad, V. W. S. Wong, J. Jatskevich, R. Schober, and A. Leon-Garcia, "Autonomous Demand-Side Management Based on Game-Theoretic Energy Consumption Scheduling for the Future Smart Grid," IEEE Trans. Smart Grid, vol. 1, no. 3, pp. 320–331, 2010.
[17] L. Angrisani, F. Bonavolontà, A. Liccardo, R. S. Lo Moriello, and F. Serino, "Smart Power Meters in Augmented Reality Environment for Electricity Consumption Awareness," Energies, vol. 11, no. 9, p. 2303, 2018.
[18] J. Varela-Aldás, S. Silva, and G. Palacios-Navarro, "IoT-Based Alternating Current Electrical Parameters Monitoring System," Energies, vol. 15, no. 18, 6637, 2022.
[19] A. F. da S. Veloso, A. A. Rodrigues, J. V. V. Sobral, J. J. P. C. Rodrigues, M. S. S. Feitosa, and R. A. L. Rabêlo, "An IoT Smart Metering Solution Based on IEEE 802.15.4," in Proc. GLOBECOM 2018 – 2018 IEEE Global Communications Conf., IEEE, 2018.
[20] F. Ulloa-Vásquez, L. García-Santander, D. Carrizo, and V. Heredia-Figueroa, "Intelligent Electrical Pattern Recognition of Appliances Consumption for Home Energy Management Using High Resolution Measurement," IEEE Latin America Trans., vol. 20, pp. 326–334, 2022.
[21] D. B. Prasetyo, "Prototype Design of IoT Remote Monitoring System for Industrial Process Using Firebase Realtime Database," in Proc. LPPM UPN "Veteran" Yogyakarta Conf. Series 2020 – Engineering and Science Series, vol. 1, no. 1, 2020.
[22] A. Hasib and A. S. M. A. S. Akib, "Cloud-Enabled IoT System for Real-Time Environmental Monitoring and Remote Device Control Using Firebase," arXiv:2601.17414 [cs.CV], Jan. 2026.
[23] L. Yu, Z. Li, Y. Li, and Y. Li, "Indoor Air Quality Monitoring System Based on Flutter and Firebase," in Proc. 2020 6th Int. Conf. on Control, Automation and Robotics (ICCAR), pp. 566–570, IEEE, 2020.
[24] A. Keshtkar, S. Arzanpour, and F. Keshtkar, "Adaptive residential demand-side management using rule-based techniques in smart grid environments," Energy and Buildings, vol. 133, pp. 281–294, 2016.
[25] M. Peña, F. Biscarri, J. I. Guerrero, I. Monedero, and C. León, "Rule-based system to detect energy efficiency anomalies in smart buildings, a data mining approach," Expert Syst. Appl., vol. 56, pp. 242–255, 2016.
[26] C. Zhang, Y. Zhao, Y. Zhou, X. Zhang, and T. Li, "A real-time abnormal operation pattern detection method for building energy systems based on association rule bases," Building Simulation, vol. 15, no. 1, pp. 69–81, 2022.
[27] H. Pruvost, A. Wilde, and O. Enge-Rosenblatt, "Ontology-based expert system for automated monitoring of building energy systems," J. Comput. Civ. Eng., vol. 37, no. 1, p. 04022054, 2023.
[28] C. Zhang, Y. Zhao, Y. Zhou, X. Zhang, and T. Li, "Fuzzy efficient energy smart home management system for renewable energy resources," Sustainability, vol. 12, no. 8, p. 3115, 2020.
[29] S. Suyahman, D. U. Iswavigra, H. Wibowo, A. B. Trisnawan, A. Wicaksono, et al., "Digital Twin Driven Real Time Performance Optimization of Smart Factory Production Systems Using Edge Computing and Industrial Internet of Things Architecture," Int. J. Industrial Innovation and Mechanical Engineering, vol. 1, no. 2, 2024.
[30] S. Suyahman, A. Wicaksono, D. U. Iswavigra, Y. I. Kurniawan, V. D. Setiawan, et al., "Carbon-Neutral Industrial Process Optimization through Hybrid Machine Learning and Real-Time Energy Efficiency Monitoring Framework," Green Engineering: Int. J. Engineering and Applied Science, 2025.











