Design and Development of an Internet of Things (IoT)-Based Automatic Window with an Automatic Opening and Closing System Based on Rain and Room Temperature Sensors
Abstract
This study develops and implements an Internet of Things (IoT)-based automatic window prototype designed to improve indoor ventilation while minimizing the possibility of rain entering the room. The system consists of an ESP32 microcontroller, DHT22 temperature sensor, Rain Drop sensor, SG90 servo motor, and a local web-based monitoring interface. The prototyping method was implemented through several stages, including system requirements analysis, control-flow design, hardware assembly, software development, system integration, and functional testing. The automatic control mechanism prioritizes rain detection, where the servo motor closes the window when rain is detected. When no rain is detected and the room temperature exceeds 28°C, the window automatically opens, while under other conditions, the window remains closed. Sensor readings and window status are transmitted via Wi-Fi, stored in a MySQL database, and presented through a website developed using PHP, HTML, CSS, and JavaScript. Functional testing confirmed that the system successfully performed the defined scenarios, including automatic window opening at a temperature of 31.6°C with a 0% rain-sensor reading, automatic closing at 26°C with a 49.5% rain-sensor reading, and manual closing at 32.1°C. The monitoring website also successfully presented temperature, rain-sensor readings, rain conditions, and window status. These results indicate that the developed prototype can effectively integrate environmental sensing, automatic window control, and local web-based monitoring into a functional IoT system.