| Ningxia province is located in the northwestern of China,with an annual average temperature varying from 5.3 ℃ to 9.9 ℃,and temperature change in winter varying from-9.0 ℃ to 2.0 ℃,which is a frequent area that frost disasters happened.Natural frost generally happens with a fast temperature decreasing,which causes great harm to crops.Currently,the methods of frost data collection are insufficient,since most of frost monitoring and research generally rely on conventional automatic weather stations and lack automatic equipment that can be used directly in the open country.In order to make the frost experiment box easy to carry,at the same time,through file to control frost device,this paper designs a temperature control system based on STM32 portable frost experiment box.Makes it easier for researchers to carry out research on frost critical temperature and frost indicators of crops,provide references for frost monitoring,early warning and disaster risk assessment.This system uses STM32F103C8T6 as the main controller.The peripheral modules mainly include: DS18B20 sensor,SHT21 sensor,CH376 chip,OLED0561 Screen,PWM generator and relay.The main controller obtains the temperature data from the frost experiment box by controlling the DS18B20 and SHT21;the CH376 chip executes the reading and writing operation from U disk to capture the preset temperature file of the frost experiment and record the frost experiment record respectively;the OLED screen is used to display the temperature value measured by each temperature sensor in the box,the state of the U disk,the experimental state of the frost,the preset temperature and its variability of the temperature operation,and the current time in real-time.After the frost experiment starts,the main controller writes the target temperature at each time point in the temperature control process according to the preset temperature file,and makes the decision whether it should increase temperature or not by comparing the current temperature in the box.The main controller controls the power supply of fan via the closeand open operation of the relay.Meanwhile incremental PID algorithm is applied to output control increment and pass it to the PWM generator for outputting the corresponding duty cycle pulse waveform to control the speed of the cold/hot fan to achieve the temperature control effect;finally the entire process of frost experiment is displayed on the OLED screen in real-time,making it easier for the user to observe and debug the system.The main research results of this article are:(1)Design the box structure and air circulation circuit to make sure the stable circulation of gas temperature in the box.Summarize the working plan of the temperature control system,implementation the design of software and hardware;(2)The experimental device is light and portable.In the experiment,liquid nitrogen refrigeration was used to ensure the control of the temperature inside the cabinet.According to the frost cooling law of nature,by adding files and using incremental PID control to achieve accurate and regular temperature control.At present,the development of this frost experimental box is the first time.(3)The temperature control simulation model of the frost experiment box is established in the Matlab/Simulink environment,and the PID control and fuzzy PID control algorithm are used to simulate the temperature control process.The simulation experiment results show that fuzzy PID control can make the system have good stability,fast and smooth cooling,and can achieve the expected results compared with PID control. |