A Brief Discussion on the Application of Microcontrollers in Temperature Control Systems
2026-04-06 05:51:26··#1
Abstract: Based on a microcontroller, this paper takes a car temperature control system and a liquid storage container temperature control system as examples to illustrate the application principle of the microcontroller in temperature control systems. Keywords: Microcontroller , Temperature control I. Application of Microcontroller in Liquid Storage Container Temperature Control System In this system, the temperature of the liquid storage container is the controlled parameter, the steam flow rate is the control parameter, and the initial temperature of the cold material input to the liquid storage container is the feedforward control, forming a feedforward-feedback control system. By leveraging the advantages of both feedforward and feedback control, measurable but uncontrollable disturbances are overcome by feedforward control, while other disturbances are overcome by feedback control, thereby achieving the goal of controlling the temperature of the liquid storage container to meet the process requirements. (I) Hardware Design. The AT89C51 microcontroller is selected as the host, equipped with two-channel sensor transmitters, multiplexers, A/D converters, D/A converters, V/I converters, regulating valves, etc., to achieve automatic control of the liquid storage container temperature. An alarm circuit, keyboard, and display circuit are also included. In steady state, the temperature of the liquid storage container remains constant at the value required by the process. When the initial temperature of the cold material changes compared to its set value, if the change is small, the feedforward control will completely overcome the influence of this change on the system; if the change is large, the feedforward control cannot completely overcome the influence of this change on the system, and the feedback control will start to act. When the initial temperature of the cold material remains unchanged, but the temperature of the liquid storage container changes due to other disturbances, only the feedback control will act, and the system will eventually reach a steady state again. 1. The design of the forward channel adopts the JUMU90 series temperature sensor transmitter, with an input range of 0℃~500℃, an output of 4mA~20mA (DC), and a measurement accuracy of 0.5%. The 10-bit successive approximation A/D conversion chip AD571[2] is selected. After receiving a valid CONV ERT command, the internal successive approximation register starts from the highest bit and is sequentially compared with the current generated by the analog quantity through the DAC output current on the comparator. After detecting all bits, the SAP contains the converted 10-bit binary code. After the conversion is completed, SAP sends a DR signal (active low). When the microcontroller finds DR=0, it opens the tri-state buffer to output data. 2. Backward channel design (1) Design of D/A converter. In order to meet the accuracy requirements of the system, a 10-bit D/A converter DAC1020 is selected. Since it does not have an internal latch, it must be connected to the AT89C51 microcontroller through the I/O port. Since the word length of AT89C51 is 8 bits, it can only transmit 8 bits of data at a time. Therefore, AT89C51 must perform two operations to send a complete 10-bit data to AC1020. In order to send 10 bits of data to DAC1020 at the same time and avoid the output voltage waveform from having glitches, a double buffer method must be used. The AT89C51 first outputs the high 2 bits of data to 74LS74(1), and then outputs the low 8 bits of data to 74LS377. At the same time, the chip select signal of 74LS377 is also used as the clock pulse of 74LS74(2), which loads the contents of 74LS74(1) into 74LS74(2), so that a complete set of data arrives at the data input terminal of DAC1020 at the same time. This eliminates the glitches at the DAC output terminal. (2) Design of actuator and conditioning circuit. The system uses a logarithmic flow characteristic regulating valve of model ZMAN 16BG, ZGICr18Ni9Ti. The input signal of the valve is a gas signal, while the output of the D/A converter is a voltage signal of 0V~5V. Therefore, a V/I converter and an electric valve positioner need to be added between the D/A converter and the regulating valve to first convert the 0V~5V voltage signal into a 4mA~20mA current signal, and then convert the 4mA~20mA current signal into a 0.02MPa~0.1MPa gas signal. This allows the regulating valve to receive the gas signal and operate. (II) Software Design. After analysis, the system software can adopt a structured modular programming design, mainly including the system main program, watchdog interrupt service routine, keyboard scanning subroutine, display subroutine, alarm subroutine, A/D conversion subroutine, D/A conversion subroutine, PID data processing subroutine, and BCD code conversion subroutine. After the main program starts, the AT89C51 and 8155 chips of the microcontroller are initialized first. Next, interrupts are enabled, the keyboard scanning subroutine is called, the first channel of the multi-channel analog switch is selected, and the collected data is sent to the A/D converter for conversion and then transmitted to the microcontroller. If the temperature exceeds the limit, an alarm is triggered; otherwise, the data is processed directly and sent to the display. Then, channel 2 of the multi-channel analog switch is selected, and the collected data is sent to the A/D converter for conversion, then to the microcontroller for overall processing. The output is then sent to the D/A converter to become an analog signal to change the opening of the regulating valve. II. Application of Microcontroller in Automotive Air Conditioning Temperature Control System (I) Hardware System. This system uses the AT89C52 from ATMEL's AT89 series microcontrollers. The AT89C52 is a new type of low-power, high-performance 8-bit CMOS microcontroller with 8K bytes of built-in lightning memory, fully compatible with the industry standard MCS-51 instruction set and pinout. It has strong encryption capabilities; programming and erasing of its on-chip lightning memory are entirely electrically implemented, preventing data loss and offering fast programming/erasing speeds. The AT89C52 chip has six internal interrupt sources: two external interrupts, INTO and INT1; three timer interrupts (Timer 0, 1, 2); and one serial port interrupt. This system involves five interrupt sources related to the AT89C52 chip: external interrupt INT1, timer/counters T0, T1, and T2, and serial port interrupt. This measurement and control system uses a level-activated mode, meaning INT1 = 0. Once the sampled value of the INT1 pin is low, TCON registers timers T0 and T1, controlling and selecting the timer/counter function and operating mode through registers TMOD and TCON. The contents of these registers are set by software; all bits are cleared during system reset. The operation of T2 is defined by software settings of the T2CON register. This system uses timer T0 to calculate the time interval for collecting the carriage temperature, set to operating mode 1 (16-bit counting timing mode); timer T1 is used as a baud rate generator, selected in operating mode 2 (8-bit auto-load mode); timer T2 is used to determine the frequency of the input pulses to the mixing damper stepper motor, set to a 16-bit constant auto-reload mode. When using a 12MHz crystal oscillator, the counting rate is 1MHz. Microcomputer serial ports typically use RS232 level, while microcontroller serial ports use 1TTL level, making them incompatible. Therefore, level conversion is necessary for the interface. The MAX232 level converter chip from Maxim Integrated is used. The microcontroller's serial port TXD, RXD, and GND are level-converted and connected to the microcontroller's RXD, TXD, and SG respectively. Pins 9 and 10 of the MAX232 level converter chip are connected to pins 10 and 11 of the microcontroller, respectively. Pins 2 and 3 of the DB9 serial port are connected to pins 7 and 8 of the MAX232 level converter chip, respectively. By using the MAX232's TTL level and the RS232 input/output ports, the level matching between the microcontroller's TTL signal and the RS232 serial communication signal is automatically adjusted. Data transmission begins with a write instruction to the transmit register (SBUF). Then, start and stop bits are automatically added to the serial port by hardware to form a complete frame format. Finally, under the action of shift pulses, the frame is serially output from the TXD pin. After one character frame is transmitted... Keep the TXD output line in the "1" state and set the TI bit of the serial control register SCON to "1" to notify the CPU that it can send the next character. (II) Software System. The working modes of the car air conditioning intelligent temperature control system are divided into "normal operation mode", "soft shutdown mode", "manual control mode" and "automatic control mode". When the system is powered on, the software enters the power-on self-test state. At this time, the system will first read the system status information stored in the EEPROM before the last power failure from the monitoring chip x25045, initialize each interrupt and restore the air conditioning controller to the state before the last power failure. After power-on initialization, the intelligent temperature control system will restore to the "normal operation mode" before the last power failure. At this time, the required temperature value can be set by the temperature adjustment button. The temperature sensor detects the temperature of the car compartment at regular intervals. The display shows the temperature set value and the temperature measurement value. The opening of the mixing damper will be automatically adjusted according to the temperature difference and temperature difference changes. The temperature control system can exchange data with the PC through serial communication. Pressing the "ON/OFF" button will put the temperature control system into "soft shutdown mode". At this time, the system can no longer perform temperature detection, temperature setting and serial communication, the display is off, and the mixing damper stepper motor stops running. References: [1] Li Hua, Practical Interface Technology of MCS-51 Series Microcontrollers [M]. Beijing: Beijing University of Aeronautics and Astronautics Press. 1993. 306405. [2] Tang Yan, Application of AT89C52 Microcontroller in Car Air Conditioning Temperature Control System [M]. Agricultural Equipment and Vehicle Engineering. 2007.9. [3] He Limin, Microcontroller Application System Design System Configuration and Interface Technology [M]. Beijing: Beijing University of Aeronautics and Astronautics, 1990.