Many occasions require monitoring of multi-point temperatures. There are many sensors for measuring temperature, and currently thermocouples and thermal resistors are commonly used. Thermocouples have a wide temperature measurement range, high accuracy, and stable performance, but they are expensive and have low output thermoelectric potential, making them inconvenient to use. The temperature measurement range of metal thermal resistors is within several hundred degrees, and the measurement accuracy is also high, but the output sensitivity is low. Semiconductor thermal resistors, also known as thermistors, have the characteristics of high output sensitivity, and with the improvement of processing technology, the measurement accuracy and interchangeability have been greatly improved, and the price is low.
1 Design of measurement circuit
The multi-point temperature measuring instrument consists of a thermistor, a multi-way conversion switch, a resistance-pulse width conversion circuit, a single-chip microcomputer, a display part, and an RS232 serial output interface, as shown in Figure 1. Each thermistor is controlled by a single-chip microcomputer, connected to a resistance-pulse width conversion circuit through a multiplexer, and converted into a pulse width signal proportional to its resistance value. The single-chip microcomputer measures the pulse width signal to obtain the resistance value of the thermistor, and then obtains the measured temperature by looking up the table.
1.1 Resistor-Pulse Width Conversion Circuit
The resistor-pulse width conversion circuit consists of a 555 chip, a resistor R, and a capacitor C, as shown in Figure 2. The resistor-pulse width conversion circuit is actually a monostable trigger circuit. The dotted box in the figure shows the principle circuit of 555. The 555 circuit includes a transistor switch T1, two voltage comparators C1 and C2, a basic RS trigger, and a voltage divider composed of three resistors with a resistance value of 5 kΩ [1].
For this monostable trigger, as long as a low-level trigger signal is applied to its trigger end (pin 2), it will output a high-level signal. The duration of the high level is the time required for the voltage on the capacitor C to rise from zero to 2Ec/3, and the length of this time is determined by the external resistor R and the capacitor C. If the capacitor C remains unchanged, this high-level time is proportional to the external resistor R. Therefore, the size of the resistor R can be known based on the duration of the output high level, that is, the pulse width. The relationship between the high-level width (time t) output by the conversion circuit and the external resistor and capacitor is t=RCln3.
Here, the temperature sensor is a thermistor. Compared with metal thermistors, the temperature coefficient of the thermistor is relatively large and the resistance is higher. In this way, the capacitor C of the conversion circuit can be selected as a small capacitor with relatively stable performance to ensure the long-term stability of the conversion circuit.
1.2 Microcontroller
The microcontroller uses the PIC16F876 model microcontroller from Microchip [2]. In order to accurately measure the pulse width output by the resistance-pulse width conversion circuit, the capture input interface of the microcontroller is used here. The PIC16F876 microcontroller has two capture input interfaces, CCP1 and CCP2, each of which consists of two 8-bit registers. CCP1 corresponds to the RC2 pin, and CCP2 corresponds to the RC1 pin. For the capture input interface CCP1, when the RC2 pin has a rising edge or falling edge (which can be set), the content of a 16-bit timer inside the microcontroller is sent to the two 8-bit registers of the capture interface. Based on this function, the pulse width output by the resistor-pulse width conversion circuit can be accurately measured. The specific measurement method is as follows: First, the microcontroller sends a pulse to trigger the resistor-pulse width conversion circuit, causing its output terminal to become a high level, and at the same time, the 16-bit timer inside the microcontroller starts timing. When the pulse signal output by the resistor-pulse width conversion circuit ends, a falling edge will appear on the RC2 pin. After CCP1 captures this falling edge, it immediately sends the data of the 16-bit timer inside the microcontroller to the two 8-bit registers of CCP1 [3]. This data is the pulse width output by the resistor-pulse width conversion circuit. Since the capture of the falling edge is completed by the internal hardware of the single-chip microcomputer, the measurement accuracy of the pulse width can be guaranteed by this method.
1.3 Multiplexer switch circuit
Since the thermistor is converted into a pulse width signal by a resistor-pulse width conversion circuit, in order for multiple thermistors to share a resistor-pulse width conversion circuit, a CD4051 multiplexer switch is used. CD4051 is an 8-to-1 electronic switch. The specific way to be connected can be controlled by the single-chip microcomputer through three control terminals.
1.4 Display circuit
The display circuit is composed of digital tubes, triodes and other components, as shown in Figure 3. In order to reduce costs and make full use of single-chip microcomputer resources, a scanning display method is adopted, that is, the single-chip microcomputer controls the digital tube to display in time. For example, after the single-chip microcomputer converts the lowest bit to be displayed into a 7-segment code, it is sent to CHa~CHg through the I/O port, and then CH1 is changed to high, so that the digital tube L1 is displayed, and after a period of time, the digital tube L2 is displayed, and then the digital tube L3 is displayed. Since a cycle display period is very short, no flickering occurs. In addition, the number of digital tubes can be increased or decreased according to the number of display digits. [page]
1.5 RS232 interface circuit
In addition to being directly displayed, the measured temperature can also be serially output. Since the asynchronous serial communication interface of the single-chip microcomputer cannot be transmitted over long distances, an RS232 interface circuit is required to convert it into a standard RS232 serial communication signal. The RS232 interface circuit uses the MAX232 chip, which contains two sets of RS232 interface circuits. The maximum transmission distance can reach 15 m, which can generally meet the needs of temperature measurement.
2 Measurement error and compensation
2.1 Causes of measurement error
Since the relationship between the pulse width output by the resistance-pulse width conversion circuit and the external resistance and capacitance is: t=RCln3, for the temperature measuring instrument, the resistance R here includes the thermistor Rt, the connection wire resistance Rcond and the multi-way switch on resistance Ron. The connection wire Rcond can be considered unchanged after the length is determined, but when the multi-way switch model is different or the temperature changes, Ron will change. In addition, the conversion capacitor C has different capacitance values due to different models or aging, so even if the measured temperature does not change, the pulse width output by the resistance-pulse width conversion circuit will change, that is, temperature measurement error will occur.
2.2 Compensation of measurement error
The multi-point temperature measuring instrument based on the single-chip microcomputer uses a thermistor as a temperature sensor, which is processed by the resistance-pulse width conversion circuit and the PIC16F876 single-chip microcomputer to realize the digital display of multi-point temperature. The temperature data can also be transmitted over long distances through the RS232 communication interface. The comparison method is used to eliminate the measurement error caused by the change of device parameters of the resistance-pulse width conversion circuit, and the measurement accuracy is improved. The multi-point temperature measuring instrument has the characteristics of simple circuit, no need for debugging, high measurement accuracy, low cost, etc., and has good application prospects.
References
[1] Kang Huaguang. Fundamentals of Electronic Technology [M]. Beijing: Higher Education Press, 2006.
[2] Liu Heping. Practical Software and Interface Technology of PIC16F876X Microcontroller [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2002.
[3] Dou Zhenzhong. Principle and Program Design of PIC Series Microcontrollers [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 1998.
Previous article:Design of communication between dsPlC and ISD voice chip based on SPI
Next article:Precise delay technology based on PIC12XX
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- [Help Post] High-frequency oscillation of high-frequency switching power supply current
- Pre-registration for the live broadcast with prizes: TI's latest application of millimeter-wave radar in the automotive field
- Can DLP dynamic projection be used to create a prototype of the famous ancient Chinese sword - the Hanguang Sword?
- Smart wearable classic data collection
- SHT31 Review - Unboxing and First Impressions
- HuaDa MCU Ucos FreeRtos RTThread real-time operating system
- IoT security himqtt firewall data structure ringbuffer ring buffer
- Changes in car rear lighting design
- A collection of essential basic knowledge for electronic engineers
- Last day! Live broadcast with prizes | RSL15 - ON Semiconductor's more efficient, smarter and safer BLE 5.2 Bluetooth chip