Perancangan Dan Simulasi Sistem Lampu Otomatis Berbasis Esp32 Menggunakan Sensor LDR dan PIR untuk Analisis Potensi Penghematan Energi Pada Simulator Wokwi
DOI:
https://doi.org/10.70052/jka.v4i3.1505Keywords:
ESP32, Lampu otomatis, LDR, PIR, Penghematan energiAbstract
Penggunaan lampu yang tidak disesuaikan dengan kondisi pencahayaan lingkungan dan aktivitas pengguna dapat menyebabkan konsumsi energi yang kurang efisien. Penelitian ini bertujuan merancang dan menyimulasikan sistem lampu otomatis berbasis ESP32 menggunakan sensor Light Dependent Resistor (LDR) dan Passive Infrared (PIR), mengevaluasi kinerja sistem dalam merespons kondisi pencahayaan dan gerakan, serta menganalisis potensi penghematan energi menggunakan simulator Wokwi. Penelitian menggunakan metode eksperimen berbasis simulasi dengan pendekatan deskriptif kuantitatif dan model pengembangan Prototype. Sensor LDR digunakan untuk mengklasifikasikan kondisi terang atau gelap, sedangkan PIR digunakan untuk mendeteksi gerakan. Pengujian black-box dilakukan pada 16 kasus uji yang masing-masing diulang tiga kali sehingga diperoleh 48 pelaksanaan pengujian. Seluruh pengujian menghasilkan keluaran sesuai harapan dengan tingkat keberhasilan 100%. Pada skenario dinamis EN-04, rata-rata durasi nyala lampu sebesar 20,155 detik dari pengamatan 60 detik. Dengan asumsi daya lampu 10 watt, sistem otomatis menghasilkan estimasi konsumsi energi 0,05599 Wh dibandingkan 0,16667 Wh pada sistem konvensional, sehingga diperoleh potensi penghematan sebesar 66,41%. Hasil tersebut merupakan estimasi berbasis simulasi dan bukan pengukuran konsumsi energi aktual pada perangkat fisik.
The use of lighting that is not adjusted to ambient lighting conditions and user activity may result in inefficient energy consumption. This study aims to design and simulate an ESP32-based automatic lighting system using a Light Dependent Resistor (LDR) sensor and a Passive Infrared (PIR) sensor, evaluate the system's performance in responding to lighting conditions and motion detection, and analyze its potential energy savings using the Wokwi simulator. The study employed a simulation-based experimental method with a descriptive quantitative approach and the Prototype development model. The LDR sensor was used to classify lighting conditions as bright or dark, while the PIR sensor was used to detect motion as a representation of user activity. The system applied an LDR threshold value of 2000 and a 10-second delay mechanism using the millis() function. Functional testing was conducted using the black-box testing method on 16 test cases, each repeated three times, resulting in a total of 48 test executions. All 48 test executions produced outputs consistent with the expected responses, resulting in a system success rate of 100%. Verification of the duration-recording mechanism showed a difference of 0 ms between the program results and manual calculations. In the dynamic EN-04 scenario, the lamp operated for an average of 20.155 seconds during a 60-second observation period. Assuming a lamp power of 10 watts, the conventional system required an estimated energy consumption of 0.16667 Wh, whereas the automatic system required 0.05599 Wh, corresponding to an estimated energy reduction of 0.11068 Wh or a potential saving of 66.41%. These findings indicate that the integration of ESP32, LDR, PIR, and a delay mechanism can control lighting according to ambient conditions and detected motion while potentially reducing operating duration and energy consumption. The energy results are simulation-based estimates and do not represent actual energy consumption in a physical implementation.
References
International Energy Agency, “Energy Efficiency 2025,” Paris, France: IEA, 2025.
Pemerintah Republik Indonesia, “Peraturan Pemerintah Republik Indonesia Nomor 33 Tahun 2023 tentang Konservasi Energi,” Jakarta, Indonesia, 2023.
Badan Standardisasi Nasional, “SNI 6197:2020 Konservasi Energi pada Sistem Pencahayaan,” Jakarta, Indonesia, 2020.
Wokwi, “ESP32 Simulation,” Wokwi Documentation, 2026.
A. Y. Putri and Habibullah, “Automated building lighting control by using R3 Arduino Uno,” Journal of Industrial Automation and Electrical Engineering, vol. 2, no. 2, pp. 152–158, 2025, doi: 10.24036/jiaee.v2.i2.pp152-158.
T. Muankhaw, S. Ngaemngam, N. Thangpreecharparnich, N. Phankong, P. Tang-On, A. Phromdang, and M. Srikaewsai, “An Automatic Lighting Control System in Building Using Daylight and Artificial Lighting Integration for Energy Savings,” Frontiers in Engineering Innovation Research, vol. 21, no. 1, pp. 1–10, 2023.
K. R. Wagiman, M. N. Abdullah, M. Y. Hassan, and N. H. M. Radzi, “A review on sensing-based strategies of interior lighting control system and their performance in commercial buildings,” Indonesian Journal of Electrical Engineering and Computer Science, vol. 16, no. 1, pp. 208–215, 2019, doi: 10.11591/ijeecs.v16.i1.pp208-215.
S. Akrasakis and A. G. Tsikalakis, “Corridor lighting retrofit based on occupancy and daylight sensors: implementation and energy savings compared to LED lighting,” Advances in Building Energy Research, vol. 12, no. 2, pp. 274–288, 2018, doi: 10.1080/17512549.2017.1325399.
V. R. M. Lo Verso and A. Pellegrino, “Energy Saving Generated Through Automatic Lighting Control Systems According to the Estimation Method of the Standard EN 15193-1,” Journal of Daylighting, vol. 6, no. 2, pp. 131–147, 2019, doi: 10.15627/jd.2019.13.
M. Papinutto, R. Boghetti, M. Colombo, C. Basurto, K. Reutter, D. Lalanne, J. H. Kämpf, and J. Nembrini, “Saving energy by maximising daylight and minimising the impact on occupants: An automatic lighting system approach,” Energy and Buildings, vol. 268, Art. no. 112176, 2022, doi: 10.1016/j.enbuild.2022.112176.
R. S. Pressman and B. R. Maxim, Software Engineering: A Practitioner’s Approach, 9th ed. New York, NY, USA: McGraw-Hill Education, 2019.
Espressif Systems, “ESP32 Series Datasheet,” Version 5.2, Espressif Systems, 2025.
J. R. K. Setiabudi, “Simulasi Numerik dan Implementasi Prototipe Sistem Pemantauan Suhu Tubuh Real-Time Berbasis ESP32-MQTT pada Simulator Wokwi,” JISEM, vol. 1, no. 2, 2026, doi: 10.33508/jisem.v1i02.7381.
A. Harahap, H. Hamdani, and A. Dani, “Automatic Power Transfer Control System Using ESP 32 Based on Wokwi Simulation,” Jurnal Info Sains: Informatika dan Sains, 2026.
R. Dzaky, M. A. Syari, and H. Khair, “Design and Development of IoT-Based Smart Street Lighting with Lighting Level Adjustment Based on Environmental Sensors,” Journal of Artificial Intelligence and Engineering Applications, vol. 5, no. 3, 2026, doi: 10.59934/jaiea.v5i3.2430
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Yoga Aimar Rosyid, Dandi Sunardi, Khairullah, Dedy Abdullah (Author)

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





