Application of temperature sensor PT100

Publisher:自由思想Latest update time:2011-03-01 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The temperature sensor used is PT100, which is a platinum wire thermal resistance sensor with good stability and linearity. It can work in the range of -200℃ to 650℃. This circuit chooses it to work in the range of -19℃ to 500℃.

The whole circuit is divided into two parts, one is the sensor preamplifier circuit, the other is the microcontroller A/D conversion and display, control, software nonlinear correction and other parts.

The schematic diagram of the preamplifier is as follows:

Working principle:

The sensor connection is very simple. It is connected to PT100 from the 5V power supply of the system through a 3K92 resistor. This connection method usually causes serious nonlinear problems, but with the software correction of the microcontroller as a backup, the sensor connection method is simplified.

According to the parameters of PT100, its resistance value is 100 to 280.9Ω in the range of 0℃ to 500℃. According to the disclosure of its series voltage division, we use the formula: Vcc/(PT100+3K92)*PT100 = output voltage (mV), and we can calculate its output voltage at full 100℃, see the table below:

Temperature ℃

PT100 resistance Ω

The voltage across the sensor is mV

0

100.00

124.38

1

100.39

124.8

50

119.40

147.79

100

138.51

170.64

150

157.33

192.93

200

175.86

214.68

250

194.10

235.90

300

212.05

256.59

350

229.72

276.79

400

247.09

296.48

450

264.18

315.69

500

280.98

334.42

The 10-bit A/D of the microcontroller can display a maximum of 1023 words at full scale. In order to obtain the input voltage of the microcontroller A/D conversion when the output voltage of the PT100 sensor displays 500 words, the original output voltage of the sensor must be amplified. The calculation formula is: (500/1023 * Vcc)/voltage across the sensor (mV/℃), (Vcc = system power supply = 5V), and the amplification factor is 10.466.

Regarding the explanation of the magnification: An enthusiastic user friend asked that according to (500/1023 * Vcc)/voltage across the sensor, the result cannot be 10.466, but 11.635. In fact, the ideal value of 500 words cannot be obtained naturally by the circuit itself, and the naturally obtained number is only 450 words. Therefore, the value of 500℃ in the formula is 450 instead of 500 in actual calculation. 450/1023*5/(0.33442-0.12438)≈10.47. In fact, there are many ways to calculate. The key is to base it on the mV/℃ of the sensor instead of the measured temperature value. Let's see if the nonlinear correction coefficient is added: 10.47*1.1117=11.639499, so that the calculation results of the enthusiastic friend are consistent.

The operational amplifier is divided into two stages. The rear stage has a fixed amplification of 5 times (12K/3K+1=5 in the schematic diagram), and the front stage has amplification of: 10.465922/5=2.0931844 times. In order to prevent components and other deviations during adjustment, a precision trimming potentiometer is used to fine-tune the amplification factor, which can ensure that the required amplification factor is adjusted more accurately (10K/(8K2+Rw)+1 in the schematic diagram).

Usually, in the temperature measurement circuit, there will be a "zero adjustment" and another "full adjustment" potentiometer to facilitate the adjustment of the sensor's correct display at "zero" and "full". This circuit does not use two potentiometers because as long as the "zero" is adjusted accurately, the correct display of the entire working range can be guaranteed, of course, including the maximum display problem at full scale.

So, how is the "zero degree" handled in the circuit? It is simply subtracted from the "zero degree" number in the MCU program. Within the entire working range, the program will automatically subtract the "zero degree" value and then use it as a valid value.

When the power supply voltage deviates, will it cause changes in the sensor input and affect the accuracy? When the power supply changes, the current flowing through the sensor will inevitably change, which will also cause the sensor output voltage to change. However, at the same time, the power supply of the microcontroller is also synchronously receiving this power supply change. When the A/D reference of the microcontroller uses the power supply voltage, it means that the measurement reference is also changing synchronously in the same direction. Therefore, as long as the parameters are properly selected, the system power supply change is within 20%, which will not affect the measurement accuracy. (Usually, the microcontroller system does not allow the power supply to change too much, and this is not only a requirement in the temperature measurement circuit.)

The schematic diagram of the subsequent microcontroller circuit is as follows:

The signal output from the sensor preamplifier circuit is sent to the HT46R23 A/D conversion input port (PB0/AN0), and the microcontroller performs various necessary processing. The first is to perform software non-linear correction, divide the input signal into different segments according to different temperature values, and then multiply it by different compensation coefficients according to the segment it is in, so that it is as close to the theoretical value as possible. The digital after non-linear correction is sent to display, compare the control value set by the user, etc.

The nonlinear compensation coefficients of each segment are shown in the following table (only the data of the main segments are listed, not all the table contents):

Sensor voltage

mV/℃

Internal AD reading

Correction factor

124.3781

Supply resistance = 3K92 ± 1%, supply voltage = 5.000V ± 1%

124.8450

0.4670

1.00

1.0000

147.7942

0.4683

50.14

0.9972

170.6414

0.4626

99.06

1.0095

192.9326

0.4570

146.80

1.0218

214.6802

0.4515

193.36

1.0343

235.8961

0.4461

238.79

1.0469

256.5918

0.4407

283.11

1.0597

276.7898

0.4355

326.36

1.0724

296.4779

0.4302

368.52

1.0854

315.6891

0.4251

409.65

1.0985

334.4220

0.4201

449.76

1.1117

Another feature of this circuit is that the user can set 3 over-limit control values ​​arbitrarily within the working range. When the measured display value is greater than the set value, the corresponding control port will output a high level. Using this high-level signal, and then connecting a first-level transistor drive relay circuit, automatic control can be achieved. When a certain control port outputs a high level, the LED light-emitting tube connected in series with it will light up at the same time to remind the user which set value is outputting the control signal.

The 24C02 in the circuit is an electrical storage device that can reliably store the control values ​​set by the user, and the data will not be lost even if the power is off.

There are 3 buttons in the circuit diagram, which are "Set", "Add" and "Subtract" operation buttons, which are used by users to set the over-limit value. The usage is as follows:

Press the setting key, and the screen will display "1--", indicating that the first over-limit value setting has been entered. After three seconds, the screen will automatically jump to display "***" and flash (*** represents the over-limit value stored in the original electronic memory). Then, press the addition key (or subtraction key), and the lowest digit on the screen will increase (or decrease). If the key is pressed for more than three seconds, the first two digits on the screen will be quickly added (or subtracted). After adjusting the number on the screen to the required number, the over-limit value is set.

Next, press the setting key again and the screen displays "2--", indicating that you are now entering the setting of the second over-limit value. After three seconds, the screen automatically jumps to display "***" and flashes.... The following operations are exactly the same as those for the first over-limit value.

The third over-limit setting is exactly the same as the above two.

After setting the three over-limit values, you must press the set key one last time to exit the setting state and return to normal working state. If you forget to press the exit key for the last time, the program will automatically return to normal working state after waiting for 10 seconds.

Simple debugging method:

You can use a 100Ω resistor to simulate the resistance of PT100 at 0℃, connect it to the sensor input, and see if the display is = 000. If not, you can adjust the fine-tuning potentiometer to achieve it; then use a 281Ω resistor to simulate the resistance of the PT100 sensor at 500℃, and the display should be 500 characters ± 1 character; finally, use a 194Ω resistor to replace the 250℃ sensor resistance input, and it should display 250 ± 1 character. If there is no problem after the above debugging, you can connect the real PT100 sensor and put it into use. (The real sensor also has errors, and you can fine-tune the preamplifier potentiometer to correct it.)

In actual work, the circuit power supply voltage is required to be 5V±5%. If the measured display value is greater than a certain limit value, the corresponding control port will immediately output a high level.

If the sensor has an open circuit fault, the display will show "HHH". If the sensor and its leads are short-circuited, the display will immediately show "LLL". In order to prevent the adverse consequences that may be caused by an open circuit or short circuit in the sensor, at this time, the three control output ports will be closed first.

Previous article:
Next article:Integrated temperature sensor LM94022 and its application

Latest sensor Articles
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号