Share this

Design a temperature acquisition system using a microcontroller and EDA.

2026-04-06 07:36:46 · · #1
Introduction Currently, most temperature acquisition cards on the market have their measurement range, measurement method, and measurement accuracy fixed at the factory. They offer a single measurement method, a fixed measurement range, and sensing methods suitable only for certain applications. Therefore, they are not well-suited for situations requiring multiple measurement methods and ranges. Furthermore, their measurement programs and lookup databases are fixed, making them unsuitable for applications with special requirements. This system uses a Field Programmable Gate Array (FPGA EP1K30QC208-3) to process data. Its program can be modified online, thus offering strong flexibility. The program and lookup database can be improved and updated in a timely manner, upgrading the system's performance and enabling it to meet the needs of different applications. 1 Temperature Acquisition System Hardware Design Since different sensors have different output values, all ultimately need to be converted to a 0-10V voltage value to meet the conversion requirements of the A/D converter. Therefore, each sensor requires different conversion and amplification circuits. The converted voltage value is selected by a multi-channel analog switch and sent to the same A/D converter for conversion. The data is then processed and displayed by the FPGA. The overall block diagram is shown in Figure 1. 1.1 PN junction temperature measurement principle Since the PN junction generates a voltage signal as the temperature changes, the forward voltage drop of the PN junction decreases by 1 mV for every 1℃ increase in temperature. However, the output voltage is required to be 0 V at 0℃, so the PN junction must be connected into a single-arm unbalanced DC bridge. And the output voltage is amplified to the range of 0~10 V and sent to the A/D conversion circuit. The circuit schematic is shown in Figure (2): 1.2 PT100 resistance temperature measurement principle hardware circuit Since the PT100 resistance temperature detector generates a resistance signal as the temperature changes, the resistance value increases when the temperature rises. Therefore, the resistance temperature detector must be connected into a single-arm DC bridge to convert its resistance value change into a voltage change signal. Then, this voltage signal is amplified to the range of 0~10 V and sent to the A/D conversion circuit. The circuit diagram is omitted. 1.3 Thermocouple temperature measurement principle hardware circuit The output of the thermocouple is a voltage signal that changes with temperature. It must be equipped with a cold junction compensation circuit to work properly, and its output must also be converted to the range of 0~10 V and sent to the A/D conversion circuit. The circuit diagram is shown in Figure 3. 2. Temperature Acquisition System Software Design The temperature acquisition system software consists of a microcontroller program and an FPGA program. The microcontroller program is written in assembly language to control the peripheral circuits. The FPGA program is written in VHDL to process the data and display the measured temperature. 2.1 Microcontroller Control The microcontroller controls the multi-channel analog switch and the FPGA, and displays the measurement method. Port P1 is connected to a single-digit LED display (representing the output measurement method code: 1 for PN junction measurement, 2 for thermocouple measurement, and 3 for RTD measurement). Port P2 is connected to the output analog switch control word, memory chip select signal, and FPGA program switching control signal. The program flowchart is shown in Figure 4. 2.2 FPGA Data Processing The FPGA processes data according to different measurement methods. When the PN junction measurement method is selected, the FPGA calculates the data based on the temperature-voltage change function of the PN junction to obtain the corresponding temperature value. When the thermocouple or RTD measurement method is selected, the FPGA sequentially searches the corresponding calibration table data and compares it with the A/D converted data to calculate the final temperature value. It can be seen that the data processing of thermocouple or RTD measurement methods is the same, only the calibration table is different. 2.2.1 PN junction data processing In the PN junction measurement method, the FPGA calculates the data according to the temperature-voltage change function of the PN junction (for every 1℃ increase in temperature, the forward conduction voltage drop of the PN junction decreases by 1 mV) to obtain the corresponding temperature value. 2.2.2 Thermocouple and RTD data processing In the thermocouple or RTD measurement method, the FPGA sequentially searches for the data in the corresponding calibration table and compares it with the data converted by A/D to calculate the final temperature value. The program flowchart is shown in Figure 5. 3 Temperature acquisition system installation and debugging Installation and debugging is the most critical and most prone to problems in a system. Some problems encountered in the installation and debugging of this system and the final solutions are as follows: (1) Thermocouples must have a cold junction compensation circuit to work properly. When building its cold junction compensation circuit, its bridge resistance parameters are difficult to determine. Because the resistance of each bridge arm and the current limiting resistance of different models of thermocouples will also be different, the parameters of each bridge arm were determined after adjusting each parameter many times. (2) Each amplifier circuit initially used a single-stage voltage amplification, which resulted in poor anti-interference capability and unstable amplification factor. To improve anti-interference capability and stabilize the voltage amplification factor, a two-stage amplification was later adopted. The first stage used a differential amplifier circuit with a low amplification factor to eliminate common-mode interference. The second stage then used voltage amplification, which effectively achieved interference-free and stable amplification. (3) During software debugging, the display was cleared. It was eventually found that the AD conversion data was not latched. The problem was solved by using software latching. 4 Conclusion This temperature acquisition system can realize temperature measurement in three ways: PN junction (20~100℃), RTD (PT100) (0~800℃), and thermocouple (NiN-NiSilicon K-type) (0~1000℃). It can meet the needs of different measurement ranges, different measurement accuracies, and different occasions. This design uses EDA as the development tool and is controlled by a microcontroller. This gives the entire design a relatively new design concept. The use of an 12ADC analog-to-digital converter greatly improves the measurement accuracy. Data processing uses a field-programmable gate array (FPGA) (EP1K30QC208-3), whose extremely high program execution speed makes the system response faster and more accurate.
Read next

CATDOLL Kelsie Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22