The content of the invention
To solve problem above, the invention provides a kind of temperature-detecting device and temperature checking method, to unite
One NTC thermistor and PT100 resistance sampling circuits, and realize the automatic knowledge of two types temperature sensor
Other and temperature detection.
According to an aspect of the invention, there is provided a kind of temperature-detecting device, including:
First resistor, it is connected with reference power supply;
Second resistance, it connects with the first resistor, and in parallel with critesistor to be measured;
Control module, gathers the second resistance and critesistor parallel connection two ends and the first resistor two ends
Voltage signal, based on the voltage signal calculate critesistor resistance, and based on calculated temperature-sensitive electricity
The resistance of resistance obtains testing temperature to be checked.
According to one embodiment of present invention, the critesistor includes PT100 resistance and NTC thermistor.
According to one embodiment of present invention, also it is parallel with the two ends of the second resistance and the critesistor
Filter capacitor, to the voltage signal to being input to the control module process is filtered.
According to one embodiment of present invention, the control module includes:
First sample circuit, for sampling to the voltage at the first resistor two ends;
Second sample circuit, for the second resistance, the critesistor and the filter capacitor parallel connection portion
The voltage at point two ends is sampled;
Computing the resistor value circuit, based on the voltage signal that first sample circuit and second sample circuit are exported
Calculate the resistance in parallel and the resistance ratio of the first resistor of the critesistor and the second resistance, and base
The resistance of critesistor described in computing the resistor value in the first resistor and the second resistance.
According to one embodiment of present invention, the control module also includes what is be connected with the computing the resistor value circuit
Decision circuitry, its resistance for being based on the computing the resistor value circuit output distinguishes the species of critesistor and detects circuit
It is whether short-circuit.
According to one embodiment of present invention, the decision circuitry is based on the second resistance, the critesistor
The species of the critesistor is distinguished with the Standard resistance range at the filter capacitor parallel connection part two ends, wherein,
When the resistance of the computing the resistor value circuit counting is less thanWhen, the critesistor is PT100 resistance;
When the resistance of the computing the resistor value circuit counting is more thanWhen, the critesistor is NTC temperature-sensitives electricity
Resistance,
Wherein, b1For the maximum in Standard resistance range of the PT100 resistance in a range of temperature, a2For
Minima in Standard resistance range of the NTC thermistor in same temperature excursion, a2> b1, R2For second
The resistance of resistance.
According to one embodiment of present invention, the control module also includes first be connected with the decision circuitry
Resistance-temperature conversion module, for carrying out resistance and temperature transition by change type to the PT100 resistance,
The change type is:
Wherein, RPT100For the resistance of PT100 resistance, T is testing temperature to be checked.
According to one embodiment of present invention, the control module also includes second be connected with the decision circuitry
Resistance-temperature conversion module, for carrying out resistance and temperature turn by lookup table mode to the NTC thermistor
Change.
According to another aspect of the present invention, additionally provide a kind of for any of the above item temperature-detecting device
Temperature checking method, including:
Obtain the resistance of first resistor and second resistance;
Read the voltage signal and second resistance at first resistor two ends and the voltage signal at critesistor parallel connection two ends;
Based on the voltage signal at first resistor two ends, second resistance and critesistor parallel connection two ends voltage signal,
The resistance of the computing the resistor value critesistor of first resistor and second resistance;
Resistance based on calculated critesistor obtains testing temperature to be checked.
According to one embodiment of present invention, the resistance based on calculated critesistor obtains testing temperature to be checked
The step of further include:
Thermistor type is judged, when the resistance for calculating is less thanWhen, the critesistor is that PT100 is electric
Resistance, when the resistance for calculating is more thanWhen, the critesistor is NTC thermistor, wherein, b1For
Maximum in Standard resistance range of the PT100 resistance in a range of temperature, a2It is NTC thermistor same
The minima in Standard resistance range in one range of temperature, a2> b1, R2For the resistance of second resistance;
When the critesistor is PT100 resistance, resistance is converted to by temperature, the conversion by change type
Formula is:
Wherein, R2For the resistance of PT100 resistance, T is temperature;
When the critesistor is NTC thermistor, resistance is converted to by temperature by lookup table mode.
Beneficial effects of the present invention:
The present invention brings corresponding resistance into based on first resistor and the ratio of the resistance of second resistance place circuit
Resistance can calculate the resistance of critesistor, and then be calculated and treat testing temperature, in parallel resistance, can be with
The resistance of temperature sensor is limited within the detection range of control module, can be with compatible NTC thermistor
With the two kinds of temperature sensor of PT100 resistance, circuit design is simplified, save cloth board space, processed
Software also achieves compatibility, is provided simultaneously with the function of short-circuit detecting.
Other features and advantages of the present invention will illustrate in the following description, also, partly from description
In become apparent, or by implement the present invention and understand.The purpose of the present invention and other advantages can pass through
Specifically noted structure is realizing and obtain in description, claims and accompanying drawing.
Specific embodiment
Describe embodiments of the present invention in detail below with reference to drawings and Examples, whereby to the present invention how
Application technology means solving technical problem, and reach technique effect realize that process can fully understand and real according to this
Apply.As long as it should be noted that do not constitute conflict, in each embodiment and each embodiment in the present invention
Each feature can be combined with each other, and the technical scheme for being formed is within protection scope of the present invention.
Different motors may select different types of temperature sensor, this diversity to cause temperature detection electricity
The species on road increases, and the state of system increases, and is unfavorable for the control to product quality and cost.Conventional two
NTC thermistor is respectively adopted for kind temperature sensor and PT100 resistance is made, temperature made by both resistance
Degree sensor has different Cleaning Principles.
Fig. 1 show conventional NTC thermistor sample circuit topological diagram, and NTC thermistor passes through constant pressure
The mode of source partial pressure is sampled.High-precision constant pressure source VrefBy accurate fixed resistance R and NTC temperature-sensitives
Resistance carries out partial pressure, and the magnitude of voltage after partial pressure is sent to the AD sample port of MCU (micro-control unit) and enters
Row sampling, then calculates the resistance of corresponding NTC thermistor, by looking into NTC temperature-sensitives by MCU
The R-T tables of resistance, realize the detection of temperature.
Fig. 2 show conventional PT100 resistance sampling circuit topological diagrams, and constant current source passes through PT100 resistance
Generation voltage signal is delivered to the AD sample port of MCU and is sampled, and then calculates correspondence by MCU
PT100 resistance resistance R, calculated by T=(R-100)/0.385 formula in MCU corresponding
Temperature value.
For the sample circuit of NTC thermistor, typically by NTC thermistor in whole temperature range
The voltage change range of bleeder circuit is as big as possible, and the analog quantity AD sample port full scale for making MCU is sampled,
To improve the precision of temperature sensing circuit.The resistance range of NTC thermistor is usually tens kilo-ohms and arrives
Hundreds of Europe, and the resistance range of PT100 resistance is tens Europe to hundreds of Europe, therefore NTC thermistor
Sample circuit may not apply to the sampling of PT100 resistance because the change in voltage that AD sample port is detected
Scope is too little, designs unreasonable.Example:Certain model PT100 resistance is 100 Ω~177 Ω (correspondences 0 DEG C~200
DEG C) linear change.NTC thermistor (R (25 DEG C)=30k Ω) is 97.663k Ω~0.191k Ω (correspondences
0 DEG C~200 DEG C) nonlinear change.According to the benchmark of 5V, reference resistance R is 2k Ω, then 0 DEG C~200 DEG C,
The sampling circuit samples voltage range of NTC thermistor is:0.1V~4.564V, MCU analog quantity AD is adopted
Sample port is full scale sampling.The sampling circuit samples voltage range of PT100 resistance is:4.7619V~
4.5935V, i.e., sampled voltage excursion only has 0.1684V, far smaller than analog quantity in whole temperature range
AD sample port ranges (5V), designs unreasonable.
For the sample circuit of PT100 resistance, typically the PT100 resistance maximums in temperature range are multiplied by
The value of constant-current source is equal to or slightly less than MCU analog quantitys sample port sampling maximum.Because NTC thermistor
Standard resistance range is far longer than PT100 resistance, so NTC thermistor cannot be carried out using the mode of constant-current source
Sampling.
Both the above temperature sensing circuit needs the precision for producing constant pressure source or constant-current source, constant pressure source or constant-current source
Higher, the temperature of sampling is more accurate, while the cost of circuit is also higher.For different types of temperature sensing
Device, both the above sample circuit does not possess versatility.The diversity of two kinds of circuits will cause the increasing of circuit board type
Plus, it is unfavorable for system type and the management of product.
Therefore, the invention provides a kind of temperature sensing circuit, to unified NTC thermistor and PT100
Resistance sampling circuit, and realize automatic identification and the detection of two kinds of temperature sensors.It is as shown in Figure 3 according to this
The schematic diagram of the temperature sensing circuit of one embodiment of invention, is carried out in detail below with reference to Fig. 3 to the present invention
Explanation.
The temperature-detecting device includes first resistor R1, second resistance R2 and control module, wherein, first is electric
Resistance R1 is connected with reference power supply Vref.Second resistance R2 is connected in series with first resistor R1, and also with one
Critesistor R0 for detection temperature is in parallel.Control module gathers second resistance R2 and critesistor R0 two
End and the voltage signal at first resistor R1 two ends, and the resistance based on collection voltages signal of change critesistor,
And the resistance based on calculated critesistor obtains testing temperature to be checked.
In the present invention, critesistor R0 to be measured is in parallel with second resistance R2, the resistance after parallel connection can be little
In R2, so as to limit the voltage at critesistor R0 two ends.For example, when temperature is in 0 DEG C~200 DEG C of change
During scope, Ω~177 Ω of Standard resistance range 100 of PT100 resistance, after parallel connection is with the R3 of suitable resistance, after parallel connection
Resistance change and less.The Standard resistance range of NTC thermistor is 97.663k Ω~0.191k Ω, then exist
One second resistance R2 of two ends parallel connection of NTC thermistor, it is possible to by the voltage at NTC thermistor two ends
R2 is limited in, by the value for adjusting second resistance R2, its both end voltage scope can be made to PT100 resistance
Standard resistance range be close to.So, by matching the value of second resistance R2, the temperature-detecting device just can be with
Measurement Standard resistance range difference and the larger PT100 resistance of Standard resistance range difference and NTC thermistor, so as to
The sample circuit of unified two kinds of critesistor, saves cost of manufacture, so as to be conducive to the layout of circuit board, improves
The reliability of circuit.
In one embodiment of the invention, also it is parallel with coupling at the two ends of second resistance R2 and critesistor R0
Electric capacity C3 is closed, to the voltage signal to being input to control module process is filtered.
In one embodiment of the invention, control module includes the first sample circuit, the second sample circuit and resistance
Value counting circuit.Wherein, the first sample circuit is used to sample the voltage at first resistor R1 two ends;The
Two sample circuits are used for the electricity to second resistance R2, critesistor R0 and filter capacitor C3 parallel connection parts two ends
Pressure is sampled;Computing the resistor value circuit, based on the voltage signal that the first sample circuit and the second sample circuit are exported
Calculate the resistance in parallel and the resistance ratio of first resistor of critesistor and second resistance, and based on first resistor with
The resistance of the computing the resistor value critesistor of second resistance.
Specifically, the first sample circuit is in parallel with first resistor R1, and the voltage for collecting R1 two ends is U1.
Second sample circuit is in parallel with second resistance R2, critesistor R0 and filter capacitor C3, collects parallel connection
The voltage at two ends is U2.Based on U1/R1=U2/ (R0//R2), because U1, U2 can be by the accurate meters of sampling
Obtain, R2 can by circuit, accurately sampling out or directly passes through accurate circuit tester when R0 is not met
Measure, R1 can also be measured by accurate circuit tester, so value R0 of temperature sensor can be counted
Calculate.
In one embodiment of the invention, control module also includes the judgement electricity being connected with computing the resistor value circuit
Road, its resistance for being based on computing the resistor value circuit output distinguishes the species of critesistor and detects whether circuit is short-circuit.
Specifically, decision circuitry is based on second resistance R2, critesistor R0 and filter capacitor C parallel connection parts two ends
Standard resistance range is distinguishing the species of critesistor R0.Setting (a1,b1) for PT100 resistance Standard resistance range, b1For
Maximum in Standard resistance range of the PT100 resistance in a range of temperature, (a2,b2) it is NTC thermistor
Standard resistance range, a2For the minima in Standard resistance range of the NTC thermistor in same temperature excursion,
And a2> b1, illustrate the Standard resistance range of the two kinds of resistance non-overlapping region within the temperature range of setting.
Due to a2> b1, a2The value of //R2 is more than b2//R2, the then arbitrary resistance in the Standard resistance range of PT100 resistance
Value is less than or equal to b with the parallel value of R22//R2 values, the arbitrary resistance in the Standard resistance range of NTC thermistor with
The parallel value of R2 is more than or equal to a2//R2 values.From more than analyze, when the resistance of computing the resistor value circuit counting it is little
InWhen, the critesistor is PT100 resistance;When the resistance of computing the resistor value circuit counting is more than
When, the critesistor is NTC thermistor.
Analyze from more than, as long as resistance of the critesistor in certain temperature range includes not overlapping region,
Just different types of critesistor can be distinguished.
In addition, second resistance R2, critesistor R0 and the filter capacitor C that obtain when computing the resistor value circuit counting
The resistance at parallel connection part two ends it is close 0 when, it is possible to judge that the detection circuit occurs in that short circuit.
Because PT100 resistance and NTC thermistor carry out resistance and temperature transition, institute using different methods
So that in one embodiment of the invention, the control module also includes the first resistance-temperature being connected with decision circuitry
Modular converter, for carrying out resistance and temperature transition by change type to PT100 resistance, the change type is:
Wherein, RPT100For the resistance of PT100 resistance, T is testing temperature to be checked.
The control module also includes the second resistance-temperature conversion module being connected with decision circuitry, for NTC
Critesistor carries out resistance and temperature transition by lookup table mode.
According to another aspect of the present invention, a kind of temperature inspection of temperature-detecting device of the employing above is additionally provided
Survey method, as shown in figure 4, the method includes following several steps.
First in step s 110, the resistance of first resistor R1 and second resistance R2 is obtained.Then in step
In S120, reference power supply is introduced into the device, read the voltage signal and second resistance at first resistor R1 two ends
The voltage signal at R2 and critesistor R0 parallel connections two ends.Then in step s 130, based on first resistor R1
Voltage signal, the first resistor of the voltage signal, second resistance R2 and critesistor R0 parallel connections two ends at two ends
The resistance of the computing the resistor value critesistor of R1 and second resistance R2.Finally in step S140, based on calculating
The resistance of the critesistor for obtaining obtains testing temperature to be checked.
In one embodiment of the invention, the resistance based on calculated critesistor obtains testing temperature to be checked
The step of further include to judge thermistor type and obtained by different modes based on different thermistor types
Take the step for the treatment of testing temperature.
In thermistor type step is judged, when the resistance for calculating is less thanWhen, critesistor R0 is
PT100 resistance, when the resistance for calculating is more thanWhen, critesistor R0 is NTC thermistor, wherein,
(a1,b1) be Standard resistance range of the PT100 resistance in a range of temperature, b1It is PT100 resistance in a temperature
The maximum in Standard resistance range in excursion, (a2,b2) for NTC thermistor in same temperature excursion
Interior Standard resistance range, a2For the minimum in Standard resistance range of the NTC thermistor in same temperature excursion
Value, a2> b1, R2For the resistance of second resistance;When critesistor is PT100 resistance, by change type (1)
Resistance is converted to into temperature.When critesistor is NTC thermistor, resistance is changed by lookup table mode
For temperature.
Employing MAX31865 chips according to an embodiment of the invention are illustrated in figure 5 as sample circuit
Circuit theory diagrams.MAX31865 chips itself can sample to PT100 resistance or PT1000 resistance,
Its detection range is adjusted by selecting the resistance of peripheral resistance R1.Resistance R1 is needed more than between detection port
R0 and R2 parallel value.It is in the present invention 100 Ω~177 Ω (correspondences 0 with certain model PT100 resistance
DEG C~200 DEG C) linear change.NTC thermistor (R (25 DEG C)=30k Ω) is 97.663k Ω~0.191k Ω
(0 DEG C~200 DEG C of correspondence) nonlinear change, the resistance value scope in parallel with R3 is 95 Ω~1919.7 Ω (0
DEG C~200 DEG C), therefore the value of R2 is chosen to be 3k Ω, 0.1W, precision is 0.1%, 10ppm.MAX31865
The measuring accuracy of chip is 0.5 DEG C, and by test, the accuracy of detection of its resistance is higher than 0.1%.Should according to engineering
With electric capacity C3 is increased, appropriate filtering is carried out to input signal.
The MAX31865 chips are powered using 3.3V DC sources, and power port respectively increases a 0.1uF electricity
Hold as decoupling purposes, chip carries out data exchange by serial communication interface and control chip, and/DRDY is number
According to transition status signal, i.e., the status signal that whether collection of MAX31865 chip temperatures and conversion complete.R2
From 2k Ω, 0.1W, precision is the resistance of 0.1%, 10ppm.Individually below to PT100 resistance and NTC
Error analyses when critesistor is detected.Based on the sample circuit of different voltage references, can flexibly select
The value of first resistor R1 and second resistance R2.
During with MAX31865 chips as sample circuit, first, R0 is disconnected, R2 is detected by accurate circuit tester
Resistance value and be cured in the data processor of control module, in order to follow-up circuit counting.Accurate ten thousand
With the precision that table is 6 half, the resistance of 2k Ω is measured, that is, be accurate to 0.01 Ω, be scaled PT100 resistance pair
The temperature answered is 0.03 DEG C, can ignore, that is, the resistance value for thinking R2 is accurate.
PT100 resistances are the linear changes of 100 Ω~177 Ω (0 DEG C~200 DEG C of correspondence).By with R2 simultaneously
Resistance range after connection is:Detect circuit precision for 0.1%, i.e. error about
Equal to 0.177 Ω, the error of R2 is added, total error is less than 0.2 Ω, i.e., 0.52 DEG C.Consider resistance and chip pole
Low temperature drift, the sampling precision of PT100 resistance can be met within ± 1 DEG C.Meet engineer applied requirement.
The resistance of NTC thermistor is 97.663k Ω~0.191k Ω (0 DEG C~200 DEG C of correspondence) nonlinear change.
Resistance range after in parallel with R3 is:Detection electricity
Road precision is 0.1%, i.e., less than 2 Ω, add the error of R2, and total error is again smaller than 2 Ω.For convenience of description,
Taking R2=2.002k Ω carries out circuit counting and analysis:If temperature often raises 1 DEG C, NTC thermistor and R2
The difference of the resistance after parallel connection is more than 2 Ω, then it is considered that the accuracy of detection of circuit is higher than 1 DEG C, calculate NTC hot
Parallel value of the quick resistance with R2 in the case of different temperatures is as shown in table 1 below.
Resistance difference formula is:Δ R=Rt-5-Rt, RtFor NTC thermistor in temperature t with R2 parallel resistance values.
For purposes of illustration only, temperature change that can be approximately by NTC thermistor in 5 DEG C of intervals regards linear change as, then
If temperature often raises 5 DEG C, NTC thermistor and R2 it is in parallel after the difference of resistance be more than 10 Ω, then it is assumed that circuit
Accuracy of detection is same more than 1 DEG C to be set up, except the change of resistance when temperature is from 0 DEG C to 5 DEG C is less than 10 Ω, i.e. error
More than 1 DEG C, less than 2 DEG C, temperature of NTC detections often increases by 5 DEG C at a temperature of other, and change in resistance is all higher than 10 Ω,
It follows that in the range of 0 DEG C~200 DEG C, the accuracy of detection of circuit of the present invention is above ± 2 DEG C, completely
Meet engineer applied demand.
Table 1
MAX31865 chip initiations are arranged, protection limit value, work side are arranged based on critesistor R0 species
Formula etc..The parallel value of R2 and R0 (PT100 resistance or NTC thermistor) is read by MAX31865 chips
R4, if R4 is less than 162 Ω, it is possible to determine that the temperature sensor for being detected is PT100 resistance, by control module
The resistance value of R0 is calculated, then corresponding temperature value is calculated through calculating formula (1);If R4 is more than 174 Ω,
Can be determined that detected temperature sensor is NTC thermistor, calculate the resistance value of R0, then through looking into
The R-T tables of NTC thermistor, read corresponding temperature value.Consider the shadow of control module and All other routes resistance
Ring, if R4 is approximately equal to 0 ± 10 Ω, can be determined that detection short circuit.
While it is disclosed that embodiment as above, but described content only to facilitate understand the present invention
And the embodiment for adopting, it is not limited to the present invention.Technology people in any the technical field of the invention
Member, on the premise of without departing from spirit and scope disclosed in this invention, can be in the formal and details implemented
On make any modification and change, but the scope of patent protection of the present invention still must be with appending claims institute
The scope for defining is defined.