Design of Multi-point Temperature Measuring Instrument Based on Single Chip Microcomputer

Publisher:机器人总动员Latest update time:2011-10-11 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Design of Multi-point Temperature Measuring Instrument Based on Single Chip Microcomputer

Previous article:Design of communication between dsPlC and ISD voice chip based on SPI
Next article:Precise delay technology based on PIC12XX

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号