Automatic Opening and Closing System for Windows and Curtains Using Fuzzy

It is difficult for elderly people and people with physical disabilities to open and close windows and curtains whenever the environment changes. Therefore, we propose an automatic window and curtain opening/closing system that uses fuzzy technology to automatically adjust the environment to make people feel comfortable. The system automatically opens and closes the windows and curtains based on the criteria of discomfort or comfort for the following items: illumination, temperature, carbon dioxide concentration, noise, and wind speed. Windows are judged based on the above five criteria, and curtains are judged based on four criteria, excluding carbon dioxide concentration.


Introduction
In recent years, windows and curtains have been installed in almost all facilities. In the case of houses, windows of at least one-seventh the size of the floor area of each room are required (1) . This is to meet the legal requirements for natural ventilation and natural lighting. Staying in a poorly ventilated room for a long time can cause headaches and discomfort due to the effects of carbon monoxide, carbon dioxide, toxic gases, odors, heat, and moisture. Especially in the recent COVID-19 situation, there are more opportunities to open windows for ventilation. However, opening the windows all the time for ventilation causes problems such as noise from inside and outside and difficulty in temperature control. In a survey of apartment complexes, it was found that 90% of the windows in all rooms were fitted with curtains (2) . The health effects of overexposure to ultraviolet rays are acute, such as sunburn, ultraviolet keratitis, and lowered immune function, and chronic, such as cataracts, pterygium, precancerous diseases (solar keratosis, lentigo maligna), and skin cancer (3) . In fact, 17 million people worldwide were blinded by cataracts in 1985, of which 20% were thought to be caused by ultraviolet rays (4) . Curtains are used not only to block lines of sight, but also to control brightness, to block heat by blocking sunlight, to prevent ultraviolet rays, and for soundproofing (5) . Such windows and curtains are ineffective unless they are opened and closed in a way that is appropriate to the environment of the place. However, it is difficult for the elderly and physically challenged to open and close windows and curtains every time the environment changes. It is also difficult to control the opening and closing of all windows and curtains in large facilities with many windows.
To solve these problems, we came up with a system that opens and closes automatically. There is already a device called "Move Window" that can operate a window with a remote control and open and close it automatically (6) . There is also a device that uses artificial intelligence to automatically open and close curtains according to a person's perceived comfort level (7) . However, since only one of the windows or curtains can be opened automatically, we have developed a system that can determine whether to open or close both.

Automatic Opening and Closing System
This system uses an Arduino to read five factors (illuminance, carbon dioxide concentration, temperature, noise, and wind speed level) for windows, and four factors (except carbon dioxide concentration) for curtains, and uses Proceedings of the 8th IIAE International Conference on Intelligent Systems and Image Processing 2021 DOI: 10.12792/icisip2021.012 fuzzy reasoning to determine the positive or negative center of gravity. Temperature and illuminance are measured on the outside and inside of the window, and a decision to open or close is obtained by comparing the inside with the outside.

Sensors and Membership Functions for Illuminance
For the illuminance sensor, we used the TSL2561 optical sensor from SWITCHSCIENCE. This sensor is capable of measuring light from 0.1 to 40,000 Lux.
The membership function for illuminance is shown in Fig. 1. In this system, the standard is 50[lux], and the closer the value is to 1500[lux], the larger the mid value. The larger the difference, the smaller the mid value.
The membership function for determining the opening and closing of a window, comparing the temperature outside and inside the window, is shown in Fig. 2.

Carbon dioxide sensors and membership functions
We used MH-Z19B as the carbon dioxide sensor. The sensor is based on the principle that carbon dioxide absorbs infrared rays of 4260nm. The reason for using this carbon dioxide sensor is that it can measure carbon dioxide concentration from 0ppm to 2000ppm.
The membership function of CO2 is shown in Fig. 3. In this system, the standard is set according to the ventilation standard set by the Ministry of Health, Labor and Welfare, with 1000 [ppm] as the upper limit and 500 [ppm] as the lower limit (8) .

Sensors and Membership Functions for Temperature
For the temperature sensor, we used the LM61 from TEXAS INSTRUMENTS. This sensor was chosen because it can measure from -30 to 100 degrees Celsius.
The membership function of the temperature is shown in Fig. 4. In this system, although the temperature at which people can live comfortably varies depending on the season, they generally feel cold when the temperature is below 14 degrees Celsius and feel hot when the temperature is above 32 degrees Celsius. Therefore, we set 14 degrees as the lower limit and 32 degrees as the upper limit.
The membership function for determining the opening and closing of the window, comparing the temperature outside and inside the window, is shown in Fig. 5.

Noise sensors and membership functions
The noise sensor used is ADAFRUIT's MAX4466, this    sensor can measure 20-20KHz. The membership function of the noise level is shown in Fig. 6. Noise level is an objective numerical expression of noise magnitude expressed in unit [dB]. In this system, 55 ㏈ is the lower limit and 70 dB is the upper limit.

Sensor and Membership Functions for Wind Speed
Wind Sensor Rev. C was used as the wind sensor. This wind sensor is a thermal anemometer based on a conventional technique for measuring wind speed, called "hot wire" technology. The wind speed is proportional to the heat, or power, applied to the sensor. The hot wire technology is good for low to moderate wind speeds, so we used this sensor.
The membership function of the wind speed is shown in Fig. 7. In this system, the lower limit is set at 2 m/s and the upper limit is set at 4 m/s.

Window and Curtain Membership Functions
The opening and closing of windows is determined by five conditions: illuminance, CO2, temperature, noise, and wind speed. Curtains are opened and closed based on four conditions: illuminance, temperature, noise, and wind speed, excluding CO2. The membership functions for these window opening and closing decisions are shown in Figure 8.
Conditions a through k for windows and curtains are shown in Table 1 and Table 2, respectively.

Experiment
Using the Arduino, we read the value of each sensor and use it as a membership function to determine whether to open or close the door using fuzzy reasoning. The results of our experiments under various conditions are summarized in Table 2      4. Indoor temperature 26°C, outdoor temperature 31°C, indoor illuminance 400 lux, outdoor illuminance 100 lux, carbon dioxide 500 ppm, wind speed 4.0 m/s, noise 80 dB.

Experimental results
1. The center of gravity of opening and closing the window was -8.6, and that of opening and closing the curtain was -57.2.
2. The center of gravity for opening and closing the window was -8.6, and the center of gravity for opening and closing the curtain was 2.7.
3. The center of gravity for opening and closing the window was 37.2, and the center of gravity for opening and closing the curtain was 2.7.
4. The center of gravity for opening and closing the window was -100, and the center of gravity for opening and closing the curtain was -80. 5. The center of gravity for opening and closing the window was 100, and the center of gravity for opening and closing the curtain was 40.
The center of gravity was set to close below -25, not to move from -25 to 25, and to open above 25. Table 3 below summarizes the opening and closing of windows and curtains based on the results of the center of gravity from Experiment 1 to Experiment 5.

Conclusion
In this study, we proposed a fuzzy-based automatic opening and closing system for windows and curtains. As shown in the experimental results, we succeeded in producing the expected output in the simulation. The future work is to operate the motors based on the output results and to open and close the windows automatically.