— In this modern era, numerous buildings require effective and intelligent energy management solutions. An automatic control system for lighting and HVAC based on the Internet of Things (IoT) has been developed with the aim of improving energy efficiency in learning spaces. The system is designed to ensure the lighting intensity meets the standards set by the Ministry of Energy and Mineral Resources (ESDM) (≈250 lux), with an ideal room temperature of 22°C–26°C. The device consists of five Wemos D1 Mini units connected to DHT22 sensors to detect temperature and humidity, and BH1750 sensors to measure light intensity. All components are centrally controlled using an ESP32 microcontroller. Data is transmitted via MQTT protocol, which can be monitored in real-time through Blynk application. The implementation method includes literature study, prototype design and assembly, programming, hardware and electrical assembly, performance testing, evaluation, and final project reporting. This system allows five lamps and one air conditioner to operate automatically according to predefined parameters. The test results show that the light intensity reached 264.8 lux in the morning and 263.9 lux in the afternoon with four lamps on, which meets the classroom lighting standard. Meanwhile, the HVAC test produced an average room temperature of 30.6°C, which did not significantly affect energy efficiency. However, the system was still able to reduce power consumption by approximately 39% compared to manual operation. The implementation of IoT in this system is expected to support the realization of smart buildings that are more efficient and environmentally friendly