Implementation of Mamdani Fuzzy Logic for Office Lighting Control Based on Time and Motion Detection

Authors

  • Zahra Fadhail IPB University Author
  • Mikhail Rafi Azka IPB University Author
  • Pandu Akmal Fauzan IPB University Author
  • Syahrial Iskandar IPB University Author
  • Annisa Raihanah Maimun IPB University Author
  • Muhammad Rizky Caesar IPB University Author

DOI:

https://doi.org/10.62535/rcezn534

Keywords:

Mamdani fuzzy, ESP32, LDR, PIR, adaptive lighting.

Abstract

Electrical energy waste in office rooms can occur when lamps do not adapt to ambient light conditions, human presence, and time. This study implements Mamdani fuzzy logic on an ESP32 to regulate lamp brightness intensity based on three input variables, namely light intensity using an LDR sensor, human presence using a PIR sensor, and time using an RTC. The light variable consists of dark, dim, and bright; human presence consists of present and absent; while time consists of morning, active, and night. The system output is the lamp brightness level with fuzzy sets off, dim, medium, and full bright. The system uses 12 fuzzy rules with Mamdani inference, minimum operator, maximum aggregation, and centroid defuzzification. Testing was carried out by simulation using seven main scenarios and nine verification points. The results show that the system is able to produce different brightness levels according to combinations of input conditions. At 150 lux, with human motion detected, and time 06:00, the system produced an output of 57.64% with a PWM value of 147 in the medium category. The system has the potential to regulate lighting adaptively, but testing did not include power consumption measurement and direct calibration of light intensity.

References

Ardiatma, A. D., & Soewito, B. (2023). IoT based indoor lighting performance of LED with different color temperatures system based on human activity. Syntax Admiration, 4(10). https://doi.org/10.46799/jsa.v4i7.671

Arif, M. Z., & Astutik, R. P. (2024). Gas Leak Detection System in LPG and Room Temperature Based on MQTT Protocol Using Fuzzy Logic Method [Sistem Pendeteksi Kebocoran Gas pada LPG dan Suhu Ruangan Berbasis Protokol MQTT Menggunakan Metode Fuzzy Logic]. In (Vol. 6). Retrieved from http://jurnalnasional.ump.ac.id/index.php/JRRE

Azmy, M., . E., & Nawawi, M. (2026). Implementation of a Fuzzy Logic Method for Energi Optimization of an ESP32-Based Solar-Powered Street Lighting System Using a PIR Sensor. Internet of Things and Artificial Intelligence Journal, 6(3), 575–586. https://doi.org/10.31763/iota.v6i3.1184

Chong, P. L., Ismail, D., Ng, P. K., Kong, F. Y., Basir Khan, M. R., & Thirugnanam, S. (2024). A TRIZ Approach for Designing a Smart Lighting and Control System for Classrooms Based on Counter Application with Dual PIR Sensors. Sensors, 24(4). https://doi.org/10.3390/s24041177

de Bakker, C., van de Voort, T., & Rosemann, A. (2018). The energy saving potential of occupancy-based lighting control strategies in open-plan offices: The influence of occupancy patterns. Energies, 11(1). https://doi.org/10.3390/en11010002

DOĞRU, A., KOYMAT, N., & CİVELEK, Z. (2021). Fuzzy-Logic Controller for Energy Saving in A Smart LED Lighting System Regarding Lighting Comfort and Sunlight in Commercial Buildings. Uluslararası Muhendislik Arastirma ve Gelistirme Dergisi, 13(1), 22–31. https://doi.org/10.29137/umagd.665376

Dewi Hendrawati, T., Arif Wicaksana, F., Narputro, P., & Rahayu, S. (2025). Mamdani Fuzzy Logic-Based Room Temperature Monitoring and Control System. Journal of Mechatronics and Artificial Intelligence, 59(1), 59–70. Retrieved from http://ejournal.upi.edu/index.php/jmai/

Hariono, R. T., & Sari, I. P. (2026). IoT-Based Intelligent Lamp Control System With Fuzzy Logic for Energy Efficiency [Sistem Cerdas Pengendalian Lampu Berbasis IoT Dengan Logika Fuzzy Untuk Efisiensi Energi]. Portal Riset dan Inovasi Sistem Perangkat Lunak, 4(1), 114–122. https://doi.org/10.59696/prinsip.v4i1.195

Hariyantia, T. A., Yutanto, H., & Effendi, Y. (n.d.). Utilization of IoT and Fuzzy Logic Algorithms for Watering Optimization: A Smart Greenhouse Case Study [Pemanfaatan IoT dan Algoritma Fuzzy Logic untuk Optimalisasi Penyiraman: Studi Kasus Pada Smart Greenhouse]. Jurnal Teknologi Informasi, 6(3), 2025. https://doi.org/10.46576/djtechno

Harris, C. R., Millman, K. J., van der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., & Oliphant, T. E. (2020, September 17). Array programming with NumPy. Nature, Vol. 585, pp. 357–362. Nature Research. https://doi.org/10.1038/s41586-020-2649-2

Hidayat, A. P., Santosa, S. H., Siskandar, R., & Gilang Baskoro, R. (2021). Evaluation of Chicken Eggs Supply With Fuzzy AHP Approach Through Development of Safea Software. Jurnal Logistik Indonesia, 5(2), 104–110. Retrieved from http://ojs.stiami.ac.id

Irzaman, Siskandar, R., Jenie, R. P., Syafutra, H., Iqbal, M., Yuliarto, B., … Khairurrijal. (2022). Ferroelectric sensor BaxSr1-xTiO3 integrated with android smartphone for controlling and monitoring smart street lighting. Journal of King Saud University - Science, 34(6). https://doi.org/10.1016/j.jksus.2022.102180

Juliarto, M., Dani Fajar Aditama, A., & Komunitas Toyota Indonesia, A. (2025). Design of IoT Gas Leak Detector in Simple Smart Homes Using Arduino-Based ESP32 Microcontroller with BLYNK Platform [Perancangan IoT Pendeteksi Kebocoran Gas pada Rumah Pintar Sederhana Menggunakan Mikrokontroler ESP32 Berbasis Arduino dengan Platform BLYNK]. 10(2), 8–15.

Kurniawan, S., I, A. P., & Ependi, A. (2023). Usability Analysis of the C-Access Commuterline Application Using the System Usability Scale (SUS) [Analisis Usability Aplikasi C-Access Commuterline Menggunakan System Usability Scale (SUS)]. Jurnal Syntax Admiration, 4(7), 894–911. https://doi.org/10.46799/jsa.v4i7.671

Landi, E., Parri, L., Baldo, D., Parrino, S., Vatansever, T., Fort, A., … Vignoli, V. (2025). Reliability and Performance Evaluation of IoT-Based Gas Leakage Detection Systems for Residential Environments. Electronics (Switzerland), 14(19). https://doi.org/10.3390/electronics14193798

Liswardani, F., Rasya Ramadhan, I., Shoultan, M. A., Pratama, Y., Chairunisa, D. Y., & Siskandar, R. (2023). Fuzzy Logic for Determining Ideal Temperature and Humidity in Chicken Egg Incubators [Logika Fuzzy untuk Menentukan Idealitas Suhu dan Kelembapan pada Inkubator Telur Ayam].

Oktavia, S., Rachman, I., Endrasmono, J., Khumaidi, A., Pristovani, D., & Syai’in, M. S. (2024). Smarthome Lamp Control Prediction Based on User Behavior and Outdoor Light External Factors Using Fuzzy Logic [Prediksi Kontrol Lampu Smarthome Berdasarkan Perilaku Pengguna dan Faktor Eksternal Cahaya Luar Ruangan Berbasis Fuzzy Logic]. Jurnal Elektronika dan Otomasi Industri, 11(2), 636–647. https://doi.org/10.33795/elkolind.v11i2.5322

Pandey, R. C., Verma, M., Sahu, L. K., & Deshmukh, S. (2018). Internet of Things (IoT) Based Gas Leakage Monitoring and Alerting System With MQ-6 Sensor (Vol. 6). Retrieved from www.ijcrt.org

Santosa, S. H., Hidayat, A. P., & Siskandar, R. (2021). Safea application design on determining the optimal order quantity of chicken eggs based on fuzzy logic. IAES International Journal of Artificial Intelligence, 10(4), 858–871. https://doi.org/10.11591/ijai.v10.i4.pp858-871

Santosa, S. H., Hidayat, A. P., Siskandar, R., & Husyairi, K. A. (2023). Smart Production Planning Model for T-Shirt Products at Raensa Convection. Jurnal Ilmiah Teknik Industri, 22(1), 49–57. https://doi.org/10.23917/jiti.v22i1.21398

Santosa, S. H., Hidayat, A. P., Siskandar, R., Rizkiriani, A., & Husyairi, K. A. (2024). Fuzzy AHP Approach in Handling Returns Product of Bottle Glass Mineral Water at PT Marina. Jurnal Sains dan Teknologi: Jurnal Keilmuan dan Aplikasi Teknologi Industri, 24(1), 59–74. https://doi.org/10.36275/vvp9qe67

Setiawan, A., & Widodo, B. (2024). Implementation of Smart Parking System with RFID Technology in IPB Vocational School Campus. International Journal of Progressive Sciences and Technologies (IJPSAT), 46(2), 559–564. Diambil dari https://ijpsat.org/

Siskandar, R., Fadhil, M. A., Kusumah, B. R., Irmansyah, I., & Irzaman, I. (2020). Internet Of Things: Automatic Plant Watering System Using Android. Jurnal Teknik Pertanian Lampung (Journal of Agricultural Engineering), 9(4), 297. https://doi.org/10.23960/jtep-l.v9i4.297-310

Siskandar, R., Indrawan, N. A., Rifa Kusumah, B., & Husen Santosa, S. (2020). Implementation of Sorting Machine Engineering as Determination of Maturity of Orange and Red Tomato Based on Image Processing [Penerapan Rekayasa Mesin Sortir sebagai Penentu Kematangan Buah Jeruk dan Tomat Merah Berbasis Image Processing]. https://doi.org/10.23960/jtep-l.v9.i3.222-236

Siskandar, R., Mandang, T., Hermawan, W., & Irzaman, I. (2023). Engineering of Information Monitoring System Sensor Reading Data Based on Smart Wireless using NVDIA Jetson Nano and Arduino Mega on Agricultural Spraying Machines. Jurnal Teknik Pertanian Lampung (Journal of Agricultural Engineering), 12(4), 921. https://doi.org/10.23960/jtep-l.v12i4.921-936

Siskandar, R., Santosa, S. H., Wiyoto, W., Kusumah, B. R., & Hidayat, A. P. (2022). Control and Automation: Insmoaf (Integrated Smart Modern Agriculture and Fisheries) on The Greenhouse Model. Jurnal Ilmu Pertanian Indonesia, 27(1). https://doi.org/10.18343/jipi.27.1.141

Taqia, I. S., Pratama, M. R. R., & Fauzan, M. E. (2026). Implementation of Mamdani Fuzzy Logic in Fire Early Warning Based on Gas Leaks. Journal of Applied Science, Technology & Humanities, 3(3), 1085–1105. https://doi.org/10.62535/3wta8665

Akbar, M. F., Wilantara, P., Ikhsan, M., Ikhtiarta, H., Siskandar, R., Novianty, I., & Irzaman. (2019). The assembling of electrical socket for electricity usage monitor and electronic device control with ESP8266 microcontroller basis. 030002. https://doi.org/10.1063/1.5132652

Pratama, I. B., Ngadisih, Setyawan, C., Keiblinger, K., Maftukhah, R., & Mentler, A. (2023). Correlation between soil characteristics and cadmium content in aboveground of cacao farming in Nglangeran village, Gunung Kidul - Indonesia. Proceedings of the International Conference on Sustainable Environment, Agriculture and Tourism (ICOSEAT 2022), 26. Atlantis Press. https://doi.org/10.2991/978-94-6463-086-2_62

Prayudha Hidayat, A., Wiyoto, W., Julio Pratama, A., Vibowo, H., Husen Santosa, S., & Siskandar, R. (2023). Fuzzy Analytical Hierarchy Process (AHP) Model for Chicken Egg Supply and Demand Management Strategies Through SAFCES Application Development. E3S Web of Conferences, 454. EDP Sciences. https://doi.org/10.1051/e3sconf/202345403004

Downloads

Published

2026-11-29

How to Cite

Implementation of Mamdani Fuzzy Logic for Office Lighting Control Based on Time and Motion Detection. (2026). Journal of Applied Science, Technology & Humanities, 3(5), 102-116. https://doi.org/10.62535/rcezn534