Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 9, No. 1, 2024 19 Design of the Temperature and Humidity Intelligent Home Control System Based on PLC Yanyan Luo School of Physics and Electronic Electrical Engineering, Huaiyin Normal University, Huai’an 223300, China Abstract: With the improvement of people's living standards, smart home is becoming more and more popular. Smart home is based on the residential, integrated a variety of modern advanced technologies such as wiring technology, centralized processing technology, network communication and other technologies will achieve integrated processing of various facilities in life. In contemporary society, people have higher and higher requirements for the quality of life, and the use of Programmable logic controller (PLC) to control smart homes has become popular. This paper draws on the traditional use of PLC to control the temperature and humidity of the greenhouse and the concentration of carbon dioxide, and considers the use of PLC to realize the control of smart home. The design uses PLC programmable controller to control the temperature and humidity of smart home life, making life more intelligent. Keywords: Smart home; Programmable controller; Temperature and humidity control. 1. Introduction Intelligent home living system is a collection of computer technology, modern communication technology and home security protection technology. It organically links people's individual needs and demands for quality of life with home life. Each system uses the Internet to carry out comprehensive control and management, pursues the new concept of people- oriented family life, and creates a comfortable and beautiful exquisite life [1-5]. The smart home system aims to improve the living standard, improve the quality of life, and create a comfortable and modern home. It integrates various living technologies, such as modern communication technology, intelligent security protection technology, integrated wiring technology, etc., to establish efficient residential equipment and home things management system to improve the safety and comfort of life, and achieve green energy saving at home . Foreign smart home started earlier, about 40 years ago, the United States appeared modern intelligent buildings, Britain, France and other European developed countries soon put forward a variety of smart home solutions. Singapore's home intelligent system has also developed rapidly, producing a variety of smart home devices, and home life is full of modern elements. Temperature and humidity have a very wide impact on our life, and are two important factors affecting people's living comfort. The temperature is too high or too low, the body will appear uncomfortable. In the hot summer, there are always people hospitalized because of heat stroke in the hospital [6- 7]. In the cold winter, many people have frostbite. Humidity also has a big impact on life: when the humidity is too low in life, it is easy to speed up the spread of bacteria. Dry air leads to an increase in the floating of dust and particles suspended in the air, and bacteria often follow the dust along with the wind. The immunity of the elderly and children is relatively weak, and it is easy to be infected by floating bacteria, which brings a lot of trouble to the family. Second, dry air is easy to make the body's water loss, so that the skin looks dry and not hydrated, but also accelerate the aging of cells. In a dry environment, you will feel dry and itchy throat when you sleep, you can't sleep well, you have no spirit in the morning, and even affect your mood for the day. Especially female friends, they pay more attention to skin maintenance. Dry air tends to make the skin lose water and elasticity, and the skin looks saggy. Therefore, many women now attach great importance to air humidity indicators. But when the humidity is higher than 70%, the body produces a special hormone, and the increase of this enzyme will lead to the reduction of several essential hormones, such as thyroid and adrenal hormones, which will make cells lazy and accelerate the aging process. Living in humid areas for long periods of time can lead to symptoms such as arthritis, cold legs and rheumatics. High air humidity will also make people's mood worse, easy to get excited, irritability. Nowadays, the use of PLC for temperature and humidity control in greenhouses has been popular, but it is rare to control temperature and humidity through PLC in smart homes [8-15]. This paper designs a smart home acquisition and control system with PLC as the core, which has the function of temperature and humidity detection. The system overall design scheme is given, and the hardware design of each system. The hardware circuit of the system is simple, cost-effective, reliable, and meets the basic control requirements of smart home. Smart home is a service for people, and the ultimate goal is to make human life convenient and comfortable. Nowadays, people have higher and higher requirements for living standards, the traditional living environment can not meet the fast-paced needs of young people, smart home like mushrooming came into being, and the system is becoming more and more advanced, including intelligent temperature and humidity regulation system and intelligent alarm system and intelligent call system as well as intelligent opening and closing system, so that people can enjoy life easily. 1.1. Research content of this paper This paper studies how to use PLC to detect and control home temperature and humidity, and use temperature and humidity sensor to detect and transmit the results to the processor. FX2N is used to realize the temperature and humidity control of home life, real-time display is used to monitor the value and compare the monitoring value with the 20 reference value to control the switch of air conditioning fan and air humidifier. So as to realize the intelligence of home life temperature and humidity. 1.2. Overview of PLC PLC full name programmable controller. The PLC control system can be converted into a logic controller, which is an electronic device produced in order to comply with industrial development and reduce labor. Its memory, easy to program can issue instructions. After receiving instructions, the execution device performs logical operations, sequence control, timing, counting and arithmetic operations, etc., and can be transferred to the digital module to complete these operations. PLC is different from ordinary computer, it can detect and control the external equipment in real time. In the control system based on the relay module, if the original program is changed, then the whole system must be changed, otherwise it will not run normally. This not only wastes time but also wastes energy, and there will be various problems, such as poor contact between the relay and the contact, large loss, high cost, poor stability and other problems. Since the programmable controller was designed, it has gradually replaced the traditional relay module. Especially since the 21st century, PLC has been rapid development, in all aspects of the application, it is gradually convenient to the world. 2. Smart Home Temperature and Humidity Control System Hardware Design 2.1. System design block diagram Figure 1. Schematic diagram of control system scheme The working block diagram of PLC system is shown in Figure 1. The control system uses PLC to convert the temperature and humidity collected by the temperature and humidity sensor into a digital signal through A/D converter, and compares it with the set value. After comparison, the computer makes the corresponding control instructions and issues them to the mechanical system. The temperature and humidity sensor is the input device of the system, which monitors the temperature and humidity in the collection room, and transmits the detection results to the PLC through the input interface circuit, and then the PLC compares the data collected by the temperature and humidity sensor with the set temperature and humidity to give the corresponding control signal, and then reaches the output device. First determine whether the temperature is within the set range, if the temperature is higher than the set range, give the air conditioner cooling command, if the temperature is lower than the set range, give the heating command. If the temperature is within the set range, go back and check again. Determine whether the humidity is within the set range. If it is higher than the set range, turn on the ventilator to discharge the moisture outdoors. If it is below the set range, turn on the air humidifier, if it is just within the set range, return to test again. 2.2. Intelligent control structure In order to realize real-time monitoring of smart home, this design sets up a long-term computer online automatic control system for smart home control parameters, and according to people's needs for temperature and humidity, air conditioning, humidifier, fan, curtain motor and other equipment automatic control. Figure 2 shows the intelligent structure control diagram. 2.3. Temperature and Humidity sensor Design Table 1. Parameters of the T/H sensor Model number SHT11 Rated voltage 2.5 V to 5.5 V Measuring range Temperature: -40℃—124℃ Humidity: 0-100% RH Measurement accuracy Temperature: ±0.4℃ Humidity: ±3% RH Voltage output Humidity: 0-10V=0-99.5%RH Temperature: 0-10V=-40—124℃ Connecting terminal (1) System power + cable (2) System power supply - Line/signal ground (3) Temperature output (4) Humidity output Working area 10-20㎡/ piece Installation mode Indoor wall installation, ceiling installation material ABS resin 21 Figure 2. Intelligent structure of the system (1) Model The SHT11 temperature and humidity transmitter uses a semiconductor sensor to detect the temperature and humidity of the air, and it is installed in a ventilated place. The monitoring data is more accurate. (2) Features Small size, Beautiful shape; Unique design, High precision; Easy to install and maintain. (3) Main technical parameters: Table 1 2.4. Executive equipment control Each executive equipment of this system is controlled by PLC output, and all kinds of executive motors work in the same way. Only one curtain motor is listed here. Figure 3 and Figure 4 show the realization principle of the motor control of the curtain. Figure 3. Curtain motor wiring diagram Figure 4. Curtain control circuit Main loop: QF is the main switch, when QF1 is disconnected, the main loop and the control loop are shut off. Switches KM1 and KM2 are the switches that control the forward and reverse motion of the motor, FR1 is the fuse used to protect the motor from being burned, SQ1 is the limit switch of the curtain motor, its function is that when SQ1 is opened to the limit position, the motor will automatically shut down. 2.5. Determination of input and output signal terminals In this design, there are 10 input signal terminals in the 22 input signal part and four output signal terminals in the output part. For details, see Table 2 and Table 3. Table 2. Input signal terminals Equipment quantity Window switch 1 Window limit 1 Humidifier switch 1 Humidifier limit 1 Air conditioner switch 1 Air conditioning limit 1 Fan switch 1 Fan limit 1 Curtain motor switch 1 Curtain motor limit 1 Total 10 Table 3. Output signal terminals Equipment quantity Window motor 1 Air blower 1 Humidifier 1 Air conditioner 1 Total 4 2.6. PLC partial circuit design This system uses FX-2N-128MR PLC produced by Mitsubishi. It is 64 input and 64 relay output, control scale: 16~256 points, with high speed, powerful basic performance, suitable for general logic control and other wide range of uses, for this design is fully sufficient. 2.7. PLC I/O distribution table Table 4. PLC I/O allocation table PLC type FX2N-128MR Analog input module FX2N-4AD X000 Hand automatically selected Y000 Open the curtains D20 Actual humidity - real number X001 Manual curtain switch Y001 Close the curtains D38 Actual temperature - real number X002 Manual fan switch Y002 Open the fan D50 Temperature upper limit setting X003 Manual air conditioning refrigeration switch Y003 Open humidifier D52 Temperature lower limit setting X004 Manual air conditioning heating switch Y004 Air conditioning refrigeration D60 Humidity upper limit setting X005 Manual heater switch Y005 Heating mode of air-conditioning D62 Humidity lower limit setting X006 The curtain open limit X007 The curtain closed limit 3. System Working Principles First of all, the temperature and humidity sensor collects the indoor environmental parameters, and then converts the environmental signal into an analog signal through various circuits, amplifiers the signal, and then converts the amplified analog signal into a digital signal by entering the FX-4AD of the PLC, compares the signal with the set value, and the corresponding actuator will work automatically when it is higher or lower than the set value.For example, when working normally, the temperature sensor transmits the temperature of the room to the PLC and compares it with the set value. When the PLC exceeds the set upper or lower limit, the PLC will output the command, and the air conditioner will work, cooling or heating. When the temperature is sampled and the PLC shows that the temperature is higher than the set value, the air conditioner starts cooling, and the system shuts down after a period of time when the sampling temperature is within the set range. When the humidity sensor detects that the humidity is not within the set range, turn on the humidifier when the humidity is lower than the set value, turn on the fan when the humidity is higher than the set value, and shut down the system when the humidity is within the set range. 4. Software Program Debugging GX Works2 is the Mitsubishi integrated PLC programming software launched by Mitsubishi Electric, which is a programming tool dedicated to PLC design, debugging and maintenance. Compared with the traditional GX Developer software, it improves the function and operation performance, and is easier to use. We used Mitsubishi GX Works2 for simulation. Mitsubishi GX Works2 cannot enter the current temperature and humidity, only through the external temperature and humidity sensor to enter the temperature and humidity for simulation, by entering the temperature and humidity range, compared with the detected temperature and humidity. 23 Figure 5. Software settings interface (Chinese interface) Click the debug button and select Simulation, and the system will automatically read the program for simulation. Figure 6. Simulation Interface (Chinese interface) Enter the upper and lower limits for temperature and humidity to compare with the input temperature and humidity. 5. Conclusion The purpose of this design is to make the living home more intelligent and convenient for the real-time control of temperature and humidity. Through the design and simulation, the following conclusions are drawn: this paper uses PLC technology to complete the hardware and software design of home environment control system; The collection and detection of indoor temperature and humidity parameters are realized. The system inspection equipment needs to be improved, and the measurement accuracy of the sensor system needs to be calibrated. I hope that we can continue to work hard in the future to promote the modernization of our home. References [1] Kimberly Miller A A . Smart-Home Technologies to Assist Older People to Live Well at Home[J].Journal of Aging Science, 2013, 1(1):1-9.DOI:10.4172/jasc.1000101. [2] Demiris G , Rantz M J , Aud M A ,et al. Older adults' attitudes towards and perceptions of ‘smart home’ technologies: a pilot study[J].Medical Informatics and the Internet in Medicine, 2009.DOI:10.1080/14639230410001684387. [3] Choi Y K , Thompson H J , Demiris G .Internet-of-Things Smart Home Technology to Support Aging-in-Place: Older Adults' Perceptions and Attitudes[J].Journal of Gerontological Nursing, 2021, 47(4):15-21.DOI:10.3928/00989134- 20210310-03. 24 [4] Choi Y K , Thompson H J , Demiris G .Use of an Internet-of- Things smart home system for healthy aging of older adults in their residential setting: A Feasibility Study (Preprint)[J].JMIR Aging, 2020, 3(2).DOI:10.2196/21964. [5] Bing K , Fu L , Zhuo Y ,et al. Design of an Internet of Things- based smart home system[C]//International Conference on Intelligent Control & Information Processing. IEEE, 2011.DOI:10.1109/ICICIP.2011.6008384. [6] Wan Y , Li X .Temperature and humidity optimisation control of cold chain vehicle carriage based on Gray Wolf algorithm[J].International Journal of Vehicle Design, 2022, 89(1/2):24. [7] Falcioni J G . Temperature and Humidity Wall Sensor [J]. ASHRAE Journal, 2023. [8] Su L , Lee Y H , Chen Y L ,et al. Using Edge Computing Technology in Programmable Logic Controller to Realize the Intelligent System of Industrial Safety and Fire Protection[J].Sensors and materials: An International Journal on Sensor Technology, 2023. [9] Yunlong Y . Realization of PLC Control System Based on Configuration Software[J].Process Automation Instrumentation, 2006.DOI:10.9708/jksci.2013.18.9.091. [10] Xing-Ming X , Wen-Xi Z .The Study of Reliability Design on PLC Control System[J].Colliery Mechanical & Electrical Technology, 2004. [11] Xing-Ming X . Research on anti-interference in a PLC control system[J]. Industrial Instrumentation & Automation, 2004. [12] Xiao-Dong W . Resolve of PLC control system design method[J].Automation & Instrumentation, 2011. [13] Cheng, Chen K , Li J ,et al. The application of embedded system in traditional PLC control system[J].Control & Automation, 2005, 109(12):17-34.DOI:10.1093/bjc/azn040. [14] Zhi_Jie Z . Design of PLC control system[J].Electrical Drive Automation, 2002. [15] Zhong-Min Z , Qiu-Yun Z , Guang-Cai Y .The design of PLC control system[J].Machine Tool Electric Apparatus, 2007.