The main research of this design is taking STM32 MCU as the control core.
It collects data through DS18B20 and DHT11 sensors and feeds back to the MCU system through timely detection of temperature and humidity in the space state. It uses the PID algorithm to process the data.
The external hardware is directly controlled by the program instruction relay to control the surrounding environment timely and effectively.
To maintain a relatively stable environment. With the development of society, the progress of science and technology, and the application of temperature measuring instruments in various fields, temperature and humidity control has been applied to almost all fields of industry, agriculture, military, scientific research and daily life. Intelligence has become the mainstream direction of the development of modern temperature control system. Especially in recent years, the temperature and humidity control system has been applied to all aspects of people’s lives. Designing a high-precision, high-quality intelligent temperature and humidity controller is a practical problem closely related to people. In view of this actual situation, the design of a temperature and humidity control system has broad application prospects and practical significance. This design is based on the fact that the temperature and humidity of power system to the environment of power supply and distribution equipment are important factors affecting the operation of equipment. Excessive temperature will accelerate the aging of instrument and equipment components, shorten their service life, and even directly lead to equipment damage. Low temperature, humidity may lead to creeping, flashover and other accidents. Therefore, in order to reduce or even avoid such incidents, we designed a more efficient and accurate intelligent temperature and humidity control system. This design takes STM32 MCU as the main control chip, uses DS18B20, DHT11 and other sensors to collect the temperature and humidity data of the surrounding environment, and makes full use of the internal resources of MCU, such as LCD, PWM, AD, timer, external interrupt, serial port and other functions, effectively connects the external hardware through relay module, and adopts PID calculation in the design.
The method is the core algorithm. According to the good stability of the PID algorithm, the temperature and humidity of the surrounding environment can be controlled in a relatively ideal state in a certain time, so as to achieve the fundamental purpose of the design. This design takes STM32 as the main controller. The external hardware is divided into power module, data acquisition module, relay module and external hardware module as the core control of the design.
In the aspect of MCU power supply, we use 12V external power supply to ensure the normal operation of MCU.
In the aspect of external hardware power supply, because the required voltage or current value is high, it is difficult to meet the requirements, so we use switching power supply NES-100-24 to amplify the voltage and current arrived by relay appropriately to meet the needs of external hardware. Ask.
DS18B20 is a commonly used temperature sensor, which has the characteristics of small size, low hardware overhead, strong anti-interference ability and high precision.
The following is the hardware diagram of the design. DHT11 sensor, which uses DHT11 as humidity data acquisition, connects it to the suitable IO port of MCU, reads the ambient humidity under the control of program, and displays it on LCD. At the same time, it has good sensitivity, waterproof, stability, high precision and low drift. In this design, relay is used as the connection between MCU and external hardware, through which the high and low level switch is selected to open or close, and the current is directly transmitted to the external hardware such as humidifier, small fan, heating rod, so as to realize the precise control of ambient temperature and humidity without artificial operation. In terms of external hardware, in order to better simulate the real environment, we use acrylic board to make a simple greenhouse hut, and place humidifier, thermostatic element heating rod, small fan and other hardware in the hut, and leave a gap on one side of acrylic board to place fan and make a window that can be opened vertically, in such a sealed. Closed system can better simulate the actual environment. The system starts to work. First, it initializes IIC, UART serial port, external interrupt and enters the main program. First, we initialize DS18B20 and DHT11, and send the data read by sensors to LCD after processing. At the same time, we can modify the upper and lower limits of temperature and humidity values according to actual needs through programming. This design uses PID arithmetic to precisely control the data collected by temperature and humidity sensors.
It can let users know the situation of the surrounding environment in time and effectively, and control the environment according to the actual needs. It can be used in many fields, such as temperature and humidity greenhouse, so that farmers can timely understand the actual situation of the greenhouse, so that crops can be in one. Good growth environment.