Development of an Arduino-Based Automatic Air Conditioner Temperature Control System Using the ON-OFF Method with Hysteresis
DOI:
https://doi.org/10.58905/sana.v4i2.810Keywords:
Air conditioner, Arduino Uno, DHT22, Hysteresis, ON-OFF controlAbstract
Air conditioners (ACs) are among the largest consumers of electricity in buildings, so automatic control is needed to improve energy efficiency while keeping room temperature stable. Conventional ON-OFF control, however, causes relay chattering when the temperature fluctuates around the setpoint, which accelerates the wear of relay contacts and the compressor. This study develops an Arduino Uno-based automatic AC temperature control system that uses the ON-OFF method with a hysteresis band of ±1 °C to reduce the switching frequency of the relay. A research and development (R&D) approach was followed through requirements analysis, hardware and software design, implementation, and testing. The system comprises an Arduino Uno, a DHT22 temperature sensor, a relay module, a 16×2 I2C LCD, a buzzer, and setpoint push buttons. Calibration against a digital thermometer yielded a mean absolute error of 0.24 °C and a root mean square error of 0.26 °C. In a cooling test from 30 °C to a setpoint of 24 °C, the room temperature entered the hysteresis band after about 15 min and settled near the setpoint within about 25 min, after which it remained inside the ±1 °C band. Compared with conventional ON-OFF control, hysteresis reduced relay switching from 21 to 11 times per hour, a reduction of 47.6%, which improves control stability and is expected to extend the service life of the relay and compressor. The system is simple and low-cost and can be applied to microcontroller-based building automation.
References
International Energy Agency, The Future of Cooling: Opportunities for Energy-Efficient Air Conditioning. Paris, France: OECD/IEA, 2018.
J. A. Mathias, K. M. Juenger, and J. J. Horton, “Advances in the energy efficiency of residential appliances in the US: A review,” Energy Efficiency, vol. 16, no. 5, Art. no. 34, 2023.
T. M. Olatunde, A. C. Okwandu, D. O. Akande, and Z. Q. Sikhakhane, “Review of energy-efficient HVAC technologies for sustainable buildings,” International Journal of Science and Technology Research Archive, vol. 6, no. 2, pp. 12–20, 2024.
G. Gao, J. Li, and Y. Wen, “DeepComfort: Energy-efficient thermal comfort control in buildings via reinforcement learning,” IEEE Internet of Things Journal, vol. 7, no. 9, pp. 8472–8484, 2020.
ASHRAE, ASHRAE Handbook—HVAC Systems and Equipment. Atlanta, GA, USA: American Society of Heating, Refrigerating and Air-Conditioning Engineers, 1996.
S. Wang, Intelligent Buildings and Building Automation. London, U.K.: Routledge, 2019.
M. Vozár and N. Ludas, “Application of the Arduino microcomputer,” in Proc. 15th Int. Scientific Conf. Distance Learning in Applied Informatics (DiVAI 2024), 2025, pp. 271.
H. N. Wahyudi and M. Mulyadi, “Design and construction of a urine odor detector for public facilities in nursing homes,” J-Eltrik, vol. 7, no. 2, pp. 88–98, 2025.
M. Margolis, B. Jepson, and N. R. Weldin, Arduino Cookbook: Recipes to Begin, Expand, and Enhance Your Projects, 3rd ed. Sebastopol, CA, USA: O’Reilly Media, 2020.
R. Mubarok and A. A. Syukron, “Development of an automatic cooling device based on the Arduino Uno microcontroller with a DHT22 sensor,” J. Media Inform., vol. 6, no. 3, pp. 1554–1561, 2025.
J. A. Abdinoor et al., “Performance of low-cost air temperature sensors and applied calibration techniques—A systematic review,” Atmosphere, vol. 16, no. 7, Art. no. 842, 2025.
D. Yulizar, S. Soekirno, N. Ananda, M. A. Prabowo, I. F. P. Perdana, and D. Aofany, “Performance analysis comparison of DHT11, DHT22 and DS18B20 as temperature measurement,” in Proc. 2nd Int. Conf. Science Education and Sciences 2022 (ICSES 2022), 2023, pp. 37–45.
K. J. Åström and R. M. Murray, Feedback Systems: An Introduction for Scientists and Engineers, 2nd ed. Princeton, NJ, USA: Princeton University Press, 2021.
R. C. Dorf and R. H. Bishop, Modern Control Systems, 13th ed. Hoboken, NJ, USA: Pearson, 2017.
Y. Bae et al., “Sensor impacts on building and HVAC controls: A critical review for building energy performance,” Advances in Applied Energy, vol. 4, Art. no. 100068, 2021, doi: 10.1016/j.adapen.2021.100068.
G. H. Merabet et al., “Intelligent building control systems for thermal comfort and energy-efficiency: A systematic review of artificial intelligence-assisted techniques,” Renewable and Sustainable Energy Reviews, vol. 144, Art. no. 110969, 2021, doi: 10.1016/j.rser.2021.110969.
G. Ulpiani, M. Borgognoni, A. Romagnoli, and C. Di Perna, “Comparing the performance of on/off, PID and fuzzy controllers applied to the heating system of an energy-efficient building,” Energy and Buildings, vol. 116, pp. 1–17, 2016, doi: 10.1016/j.enbuild.2015.12.027.
S. Xu, Y. Fu, Y. Wang, Z. O’Neill, and Q. Zhu, “Learning-based framework for sensor fault-tolerant building HVAC control with model-assisted learning,” in Proc. 8th ACM Int. Conf. Systems for Energy-Efficient Buildings, Cities, and Transportation (BuildSys ’21), 2021, pp. 1–10.
D. Afandi, “Design and development of an indoor AC control system with DHT22 and PIR sensors using an Arduino Nano microcontroller,” J. Media Infotama, vol. 21, no. 1, 2025.
A. M. Karim and A. Sumaedi, “Design and development of an Arduino Uno microcontroller-based temperature monitoring system for office building indoor environments,” Inf. Comput. Univ. Pamulang, vol. 2, no. 2, 2024.
R. U. P. Pasaribu, A. Ridwan, and A. Probowo, “Development of an Arduino-based smart room temperature control system with integrated humidity, CO₂, and occupancy sensors,” in Proc. UNPRI National Seminar, 2024.
S. Rojas-Ordoñez, M. Segura, V. Mendoza, U. Fernandez, and E. Zulueta, “Natural-language relay control for a SISO thermal plant: A proof-of-concept with validation against a conventional hysteresis controller,” Applied Sciences, vol. 15, no. 24, Art. no. 12986, 2025, doi: 10.3390/app152412986.
B. Li, R. Otten, V. Chandan, W. F. Mohs, J. Berge, and A. G. Alleyne, “Optimal on–off control of refrigerated transport systems,” Control Engineering Practice, vol. 18, no. 12, pp. 1406–1417, 2010.
Z. Xu et al., “Field experimental investigation on partial-load dynamic performance with variable hysteresis control of an air-to-water heat pump (AWHP) system,” Applied Thermal Engineering, vol. 182, Art. no. 116072, 2021, doi: 10.1016/j.applthermaleng.2020.116072.
A. M. Ali, S. A. A. Shukor, N. A. Rahim, Z. M. Razlan, Z. A. Z. Jamal, and K. Kohlhof, “IoT-based smart air conditioning control for thermal comfort,” in Proc. 2019 IEEE Int. Conf. Automatic Control and Intelligent Systems (I2CACIS), 2019, pp. 289–294.
K. Irshad, A. Almalawi, A. I. Khan, M. M. Alam, Md. H. Zahir, and A. Ali, “An IoT-based thermoelectric air management framework for smart building applications: A case study for tropical climates,” Sustainability, vol. 12, no. 4, Art. no. 1564, 2020, doi: 10.3390/su12041564.
B. Mobaraki, S. Komarizadehasl, F. J. Castilla Pascual, and J. A. Lozano-Galant, “Application of low-cost sensors for accurate ambient temperature monitoring,” Buildings, vol. 12, no. 9, Art. no. 1411, 2022, doi: 10.3390/buildings12091411.
T. Liu, “Digital-output relative humidity & temperature sensor/module DHT22 (DHT22 also named as AM2302),” Aosong Electronics Co., Ltd., datasheet, 2013. [Online]. Available: https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf
H. Hosamo, M. H. Hosamo, H. K. Nielsen, P. R. Svennevig, and K. Svidt, “Digital Twin of HVAC system (HVACDT) for multiobjective optimization of energy consumption and thermal comfort based on BIM framework with ANN-MOGA,” Advances in Building Energy Research, vol. 17, no. 2, pp. 125–171, 2023, doi: 10.1080/17512549.2022.2136240.
N. N. Saragih and R. Kurniawan, “Implementation of the Internet of Things (IoT) for monitoring and controlling household electrical energy using the fuzzy Tsukamoto algorithm,” J. Comput. Eng. Syst. Sci., vol. 10, no. 1, pp. 299–311, 2025.
S. Anil, H. H. Srinaath, and M. Jayakumar, “Comparative analysis of ON/OFF, PID, and model predictive control systems in HVAC systems,” in Proc. 2023 Innovations in Power and Advanced Computing Technologies (i-PACT), 2023, pp. 1–5.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Lela Nurlaela, Usanto S, Christine Sientta Dewi, Muhammad Rendhy Sabara

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