Design of an intelligent temperature controller for dry-type transformers based on the ATmega16 microcontroller
2026-04-06 06:42:33··#1
Abstract: This paper introduces an intelligent controller for dry-type transformers composed of an ATmega16 microcontroller. This controller can simultaneously monitor four temperature channels with an error of less than ±0.5℃ and operates stably in the field. Users can control the start and stop of the transformer cooling fan and set alarm and trip thresholds through a human-machine interface. Keywords: Microcontroller, A/D conversion, temperature 1. Working Principle The temperature controller consists of three parts: temperature monitoring, signal processing, and output control. The system block diagram is shown in Figure 1. It obtains the winding temperature value through three platinum resistance sensors embedded in the three-phase windings of the transformer. After processing by the signal conditioning circuit, the value is directly sent to the A/D conversion input terminal of the controller. The microcontroller performs calculations and processing according to the signal data and various set control parameters, following the embedded software control rules. It automatically displays the temperature value of the transformer windings, outputs corresponding control signals, controls the start and stop of the fan, and outputs normal, alarm, and trip signals according to the current status. Simultaneously, it transmits various data to the host computer via RS-485 for centralized monitoring. The temperature controller's core uses the ATmega16 microcontroller, a low-power CMOS 8-bit microcontroller based on AVR RISC. It executes one instruction per clock cycle and achieves a performance of 1 MIPS/MHz, thus possessing real-time capabilities. It has 16KB of on-chip FLASH and 512B of E2PROM for temporary storage of fault and over-temperature values. 1.1 Analog Conversion Circuit The analog conversion control circuit converts the analog temperature signal into an electrical signal that the microcontroller can recognize. The conversion principle is shown in Figure 2. When the temperature changes, the resistance of the PT100 changes linearly with the temperature. Its voltage division value is compared with the voltage division value of a fixed circuit, and the result is sent to the operational amplifier to convert it into an analog signal within the A/D conversion range. The A/D conversion accuracy in the ATmega16 is 10 bits. Since the reference voltage is 5V, the analog signal must be converted to a voltage of 0-5V. Therefore, the parameters of each component in this circuit are designed according to this requirement. Simultaneously, linearization must be considered. To ensure linear calculations in the software design, the temperature must be linearly related to the digital value converted to the microcontroller during hardware design. From the circuit diagram, it can be seen that the resulting A/D conversion voltage is not proportional to R<sub>w</sub>, failing to meet the linearity requirement. If R<sub>3</sub> ≥ R<sub>w</sub>, the conversion voltage will be approximately proportional to R<sub>w</sub>, and also approximately proportional to the temperature. This allows for linear calculation of the temperature at any point. However, using linearization to calculate this approximately linear graph introduces minor errors, which can be addressed in the software design. 1.2 Output Circuit The output circuit reflects the microcontroller's calculation and control results of the analog-to-digital conversion, as shown in Figure 3. The control signal output from the microcontroller is input to the JK port. If this signal is low, the optocoupler conducts, turning on the CMOS transistor, which in turn energizes the relay, closing the normally open contact and outputting 220V. Otherwise, it outputs 0V. In the actual circuit, four similar circuits monitor the motor, fault alarm, over-temperature alarm, and over-temperature trip, respectively. For example, when the temperature exceeds the fan's upper temperature limit, the microcontroller sets the JK terminal to low via software, turning on the CMOS transistor. This applies 12V to the relay, energizing the fan and starting it. If the temperature rises further, reaching the over-temperature alarm upper limit, an over-temperature alarm will sound; if the temperature reaches the over-temperature trip upper limit, an over-temperature trip will occur. This achieves real-time monitoring of the controlled object. 2 Software Implementation The software adopts a modular structure, including one main module and five sub-modules (button processing sub-module, setting upper limit temperature and collecting boundary point digital quantum module, communication sub-module, fault output processing sub-module and display sub-module). The main module completes the initialization of each sub-module and calls the fault output processing sub-module and display sub-module. The button processing sub-module, setting upper limit temperature and collecting boundary point digital quantum module and communication module work in interrupt mode. The main module communicates with them through a shared RAM area. Since the analog input signal of the microcontroller application system contains various noises and interferences, this program uses digital filtering technology for filtering. In addition, for the linearization problem mentioned above, we divide 0 to 200℃ into four regions and perform linearization calculations in each region. This is much more accurate than directly calculating in the 0 to 200℃ region, and can achieve an accuracy of 0.1℃. The functions of each sub-module are as follows: (1) When a key is pressed, the button processing sub-module requests an interrupt from ATmega16 and modifies the pre-set flag bit in the interrupt subroutine. (2) The digital quantum module for setting the upper limit temperature and collecting boundary points can enter the interface for modifying the upper limit temperature by entering a password when the button is pressed for a long time. The digital quantities corresponding to 0℃, 50℃, 100℃, 150℃ and 200℃ are collected by pressing the button and the results are stored in E-2PROM. This data is used as boundary points to calculate any temperature between 0 and 200℃. (3) The communication submodule can connect to the remote controlled object through the LBC184 (converting RS232 signals to RS485 signals) chip and the microcontroller to perform RS485 communication. (4) The fault output submodule can determine whether there is an abnormal situation on site by comparing the actual temperature with the upper limit temperature. At the same time, a flag is set to determine whether to perform A/D conversion and whether to display. (5) The display submodule sends the linearly calculated result to a 5-digit LED display after binary to BCD code conversion. 3. Application of Anti-interference Technology in Temperature Controllers (1) To solve AC power interference in temperature controllers, a power filter is connected in series at the input end of the AC power supply, i.e., the primary winding of the power transformer. This can effectively suppress the intrusion of high-frequency interference (Figure 4). (2) Optocouplers are used in the fault output circuit to give the output high electrical isolation and anti-interference capability. (3) Varistors are used at both ends of the temperature sensor in the analog conversion circuit and in other places to absorb overvoltages of different polarities. (4) Electromagnetic interference tests are conducted at the operating site of dry-type transformers. The test results are analyzed by probability statistics. By carefully selecting components and adopting hardware and software anti-interference technologies, the electromagnetic interference generated by the interference source is minimized. This temperature controller has low power consumption, advanced technology, complete functions, simple operation, and reliable performance. It can work stably for a long time in very harsh electromagnetic interference or high-temperature environments and is an ideal monitoring device for dry-type transformers.