Summary of the invention
According to the above-mentioned deficiencies of the prior art, the technical problem to be solved by the present invention is provide a kind of temperature measurement accuracy it is high and
The simple thermistor temperature sensor of temp measuring method.
The present invention solves scheme used by its technical problem: the present invention is using thermistor as the sensitive member of temperature
Part is connected in series to the capacitor the thermistor, based on the transient process of single order resistance-capacitance circuit, using timer only to the resistance-capacitance circuit
Charging process or discharge process carry out a timing, according to the timing result of timer at this time, by searching in memory
The resistivity-temperature characteristics data of the thermistor of storage are compared, and then determine the temperature value of measurement.
The present invention provides a kind of thermistor temperature sensors, it includes thermistor RT, capacitor C, alternative electricity
Sub switch K, electronic switch KD, controller, memory, digital clock, comparator CMP, serial ports and reference voltage Vr, wherein two
Selecting an electronic switch K includes two input terminals and a common end, and a certain moment, the common end can only be with one of input
Termination is logical, and disconnects with another input terminal, sensing element of the thermistor RT as measurement temperature, stores temperature-sensitive in memory
The resistivity-temperature characteristics data of resistance RT, comparator CMP realize the end voltage and reference voltage to the thermistor RT or capacitor C of input
Vr is compared, and serial ports realizes input or output with exogenous data or order, and core of the controller as whole system is responsible for
The control and operation of whole system operation, it is characterised in that: one end of one end connection capacitor C of thermistor RT, electronic switch
One end of KD and a comparison input terminal of comparator CMP, the other end of the other end connection electronic switch KD of thermistor RT
Common end or the ground connection of alternative electronic switch K are reconnected afterwards, and the other end connection alternative electronic switch K's of capacitor C is public
End or ground connection, an input terminal of alternative electronic switch K connect power supply V, another input end grounding, capacitor C and temperature-sensitive electricity
It hinders RT and forms single order resistance-capacitance circuit, pass through the charging process or discharge process realization thermometric process to capacitor C, the thermometric process base
Zero state response or zero input response in single order resistance-capacitance circuit transient response, during each thermometric, digital timing
Device only carries out a timing to the charging process or discharge process of capacitor C, when digital clock overflow when or comparator CMP it is defeated
Out the result shows that when the end voltage of thermistor RT or capacitor C reaches reference voltage Vr, digital clock stops timing, controller
According to the timing result of digital clock at this time, the resistivity-temperature characteristics of the thermistor RT of storage are compared by searching in memory
Data, and then determine the temperature value of measurement, which is exported by serial ports to the external world, and wherein reference voltage Vr is supply voltage
α times of V, i.e. Vr=α V, wherein α is the positive number less than 1.
The reference voltage Vr is fixed reference voltage or adjustable reference voltage.
When realizing thermometric process based on the zero state response in single order resistance-capacitance circuit transient response, hardware circuit connection can
There are two types of scheme is available:
1, one end of one end connection capacitor C, one end of electronic switch KD of thermistor RT and a ratio of comparator CMP
Compared with input terminal, it is grounded again after the other end of the other end connection electronic switch KD of thermistor RT, the other end connection two of capacitor C
The common end of an electronic switch K is selected, an input terminal of alternative electronic switch K connects power supply V, another input end grounding.
2, one end of one end connection capacitor C, one end of electronic switch KD of thermistor RT and a ratio of comparator CMP
Compared with input terminal, the public affairs of alternative electronic switch K are reconnected after the other end of the other end connection electronic switch KD of thermistor RT
End altogether, the other end ground connection of capacitor C, an input terminal of alternative electronic switch K connect power supply V, another input end grounding.
When realizing thermometric process based on the zero state response in single order resistance-capacitance circuit transient response, the thermistor
The thermometric program of formula temperature sensor are as follows: the closure of electronic switch KD first, the common end of alternative electronic switch K is grounded with it
Input terminal is connected, and after suitable time-delay, to realize the complete electric discharge of capacitor C, then opens electronic switch KD, then make digital timing
Device is reset, and the working condition of digital clock and comparator CMP is arranged, and removes the interruption mark of digital clock and comparator CMP
Will position, the interruption of open digital clock and comparator CMP, it is open it is total interrupt, then the common end of alternative electronic switch K with
Its input terminal for meeting power supply V is connected, and is started digital clock and comparator CMP, is then waited transformation result, and Change-over knot is being waited
During fruit, when the end voltage of thermistor RT or capacitor C before digital clock overflows reaches reference voltage Vr, compare
Device CMP is issued to controller interrupts application, and controller responds the interruption application, and controller stops digital clock and comparator
CMP, controller compare the thermistor RT's stored by searching in memory according to the clocking value of digital clock at this time
Resistivity-temperature characteristics data, and then determine the temperature value of measurement.
When realizing thermometric process based on the zero input response in single order resistance-capacitance circuit transient response, the one of thermistor RT
One end, one end of electronic switch KD and a comparison input terminal of comparator CMP of end connection capacitor C, thermistor RT's is another
The common end of alternative electronic switch K is reconnected after the other end of one end connection electronic switch KD, the other end of capacitor C is grounded,
An input terminal of alternative electronic switch K connects power supply V, another input end grounding.
When realizing thermometric process based on the zero input response in single order resistance-capacitance circuit transient response, the thermistor
The thermometric program of formula temperature sensor are as follows: the closure of electronic switch KD first, the common end of alternative electronic switch K connects power supply with it
Input terminal connect, after suitable time-delay, to realize that capacitor C's is fully charged, then open electronic switch KD, then keep number fixed
When device reset, be arranged digital clock and comparator CMP working condition, remove digital clock and comparator CMP interruption
Flag bit, the interruption of open digital clock and comparator CMP, open total interruption, then the common end of alternative electronic switch K
The input terminal being grounded with it is connected, and is started digital clock and comparator CMP, is then waited transformation result, and Change-over knot is being waited
During fruit, when the end voltage of capacitor C before digital clock overflows reaches reference voltage Vr, comparator CMP is to control
Device, which issues, interrupts application, and controller responds the interruption application, and controller stops digital clock and comparator CMP, controller root
The clocking value of digital clock when accordingly compares the resistivity-temperature characteristics number of the thermistor RT of storage by searching in memory
According to, and then determine the temperature value of measurement.
The method of the thermistor temperature sensor calibration measurement temperature value is to adjust reference voltage Vr or software
Amendment.
It is had the beneficial effect that possessed by thermistor temperature sensor of the present invention and number is carried out using timer
Coding, temperature measurement accuracy are high;Temperature measurement accuracy is unrelated with reference voltage, and adaptation voltage range is wide, can be applied to using battery powered
Occasion;Thermometric process is simple, and the thermometric time is short;Hardware circuit is simple, it is easy to accomplish;It is small by the electric current of thermistor, continue
Time is short, will not generate heat interference;In conjunction with integrated circuit technique, it is easy to be fabricated to cheap integrated temperature sensor.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawing.
The present invention provides a kind of thermistor temperature sensors, it includes thermistor RT, capacitor C, alternative electricity
Sub switch K, electronic switch KD, controller, memory, digital clock, comparator CMP, serial ports and reference voltage Vr, wherein two
Selecting an electronic switch K includes two input terminals and a common end, and a certain moment, the common end can only be with one of input
Termination is logical, and disconnects with another input terminal, sensing element of the thermistor RT as measurement temperature, stores temperature-sensitive in memory
The resistivity-temperature characteristics data of resistance RT, comparator CMP realize the end voltage and reference voltage to the thermistor RT or capacitor C of input
Vr is compared, and serial ports realizes input or output with exogenous data or order, and core of the controller as whole system is responsible for
The control and operation of whole system operation, it is characterised in that: one end of one end connection capacitor C of thermistor RT, electronic switch
One end of KD and a comparison input terminal of comparator CMP, the other end of the other end connection electronic switch KD of thermistor RT
Common end or the ground connection of alternative electronic switch K are reconnected afterwards, and the other end connection alternative electronic switch K's of capacitor C is public
End or ground connection, an input terminal of alternative electronic switch K connect power supply V, another input end grounding, capacitor C and temperature-sensitive electricity
It hinders RT and forms single order resistance-capacitance circuit, pass through the charging process or discharge process realization thermometric process to capacitor C, the thermometric process base
Zero state response or zero input response in single order resistance-capacitance circuit transient response, during each thermometric, digital timing
Device only carries out a timing to the charging process or discharge process of capacitor C, when digital clock overflow when or comparator CMP it is defeated
Out the result shows that when the end voltage of thermistor RT or capacitor C reaches reference voltage Vr, digital clock stops timing, controller
According to the timing result of digital clock at this time, the resistivity-temperature characteristics of the thermistor RT of storage are compared by searching in memory
Data, and then determine the temperature value of measurement, which is exported by serial ports to the external world, and wherein reference voltage Vr is supply voltage
α times of V, i.e. Vr=α V, wherein α is the positive number less than 1.
The reference voltage Vr is fixed reference voltage or adjustable reference voltage.
When realizing thermometric process based on the zero state response in single order resistance-capacitance circuit transient response, hardware circuit connection can
There are two types of scheme is available:
As shown in Fig. 1, one end of one end connection capacitor C, one end of electronic switch KD of thermistor RT and comparator
A comparison input terminal of CMP, thermistor RT the other end connection electronic switch KD the other end after be grounded again, capacitor C's
The other end connects the common end of alternative electronic switch K, and an input terminal of alternative electronic switch K connects power supply V, another
Input end grounding.
As shown in Fig. 2, one end of one end connection capacitor C, one end of electronic switch KD of thermistor RT and comparator
A comparison input terminal of CMP, thermistor RT the other end connection electronic switch KD the other end after reconnect alternative electricity
The common end of sub switch K, the other end ground connection of capacitor C, an input terminal of alternative electronic switch K connect power supply V, another
Input end grounding.
Before thermometric starts, need first electronic switch KD closure, and the common end of alternative electronic switch K is grounded with it
Input terminal is connected, and capacitor C is discharged to zero, when thermometric starts completely, disconnects electronic switch KD, and alternative electronic switch
The input terminal that the common end of K meets power supply V with it is connected, and circuit enters the transient response process of nought state.
In Fig. 1, based on the zero state response in single order resistance-capacitance circuit transient response, during capacitor C charging, heat
The end voltage of quick resistance RT isWherein τ is time constant, i.e. τ=RTC.
As the u in t=t0RT(t) reach reference voltage Vr, i.e. uRT(t)=Vr enables Vr=α V (α is the positive number less than 1),
ThenTo t0=- τ ln α.
T0=NT is enabled, wherein N is the clocking value of digital clock, and T is the counting pulse period of digital clock, then NT
=-τ ln α, so
Since capacitance C, pulse period T and factor alpha are definite value, so enablingThen N=ART.Heat
The resistance value of quick resistance RT is linked together with measured angle value by certain functional relation, i.e. tw=f (RT), and wherein tw indicates quilt
Thermometric angle value.
Continuous memory space is opened up in memory, and the first address of memory space is B, and wherein B is whole not less than zero
Temperature value tw is carried out discrete processes, i.e., indicates measured angle value with memory unit address in memory, deposit in storage unit by number
The content of storage is (ART), then it is (ART) that address, which is the memory cell data of (B+N), in memory, so in memory
Memory unit address and memory cell data form the resistivity-temperature characteristics of thermistor RT.
As it can be seen that the resistance that the producer that the resistivity-temperature characteristics of the thermistor RT stored in memory are not thermistor RT provides
Temperature characteristics, but according to the transformed data of formula N=ART.
The clocking value N and the resistance value of thermistor RT of digital clock are in a linear relationship and unrelated with voltage, according to number
The resistivity-temperature characteristics of the clocking value N and thermistor RT of timer are assured that the temperature value of measurement.
When realizing thermometric process based on the zero state response in single order resistance-capacitance circuit transient response, the thermistor
The thermometric program of formula temperature sensor are as follows: the closure of electronic switch KD first, the common end of alternative electronic switch K is grounded with it
Input terminal is connected, and after suitable time-delay, to realize the complete electric discharge of capacitor C, then opens electronic switch KD, then make digital timing
Device is reset, and the working condition of digital clock and comparator CMP is arranged, and removes the interruption mark of digital clock and comparator CMP
Will position, the interruption of open digital clock and comparator CMP, it is open it is total interrupt, then the common end of alternative electronic switch K with
Its input terminal for meeting power supply V is connected, and is started digital clock and comparator CMP, is then waited transformation result, and Change-over knot is being waited
During fruit, when the end voltage of thermistor RT before digital clock overflows reaches reference voltage Vr, comparator CMP to
Controller, which issues, interrupts application, and controller responds the interruption application, and controller stops digital clock and comparator CMP, control
Device compares the resistivity-temperature characteristics of the thermistor RT of storage by searching in memory according to the clocking value of digital clock at this time
Data, and then determine the temperature value of measurement.
In Fig. 2, based on the zero state response in single order resistance-capacitance circuit transient response, during capacitor C charging, electricity
Hold C end voltage beWherein τ is time constant, i.e. τ=RTC.
As the u in t=t0c(t) reach reference voltage Vr, i.e. uc(t)=Vr enables Vr=α V (α is the positive number less than 1), thenTo t0=- τ ln (1- α).
T0=NT is enabled, wherein N is the clocking value of digital clock, and T is the counting pulse period of digital clock, then NT
=-τ ln (1- α), so
Since capacitance C, pulse period T and factor alpha are definite value, so enablingThen N=
A·RT.The resistance value of thermistor RT is linked together with measured angle value by certain functional relation, i.e. tw=f (RT), wherein
Tw indicates measured angle value.
Continuous memory space is opened up in memory, and the first address of memory space is B, and wherein B is whole not less than zero
Temperature value tw is carried out discrete processes, i.e., indicates measured angle value with memory unit address in memory, deposit in storage unit by number
The content of storage is (ART), then it is (ART) that address, which is the data of storage unit of (B+N), in memory, so in memory
Memory unit address and memory cell data form the resistivity-temperature characteristics of thermistor RT.
As it can be seen that the resistance that the producer that the resistivity-temperature characteristics of the thermistor RT stored in memory are not thermistor RT provides
Temperature characteristics, but according to the transformed data of formula N=ART.
The clocking value N and the resistance value of thermistor RT of digital clock are in a linear relationship and unrelated with voltage, according to number
The resistivity-temperature characteristics of the clocking value N and thermistor RT of timer are assured that the temperature value of measurement.
When realizing thermometric process based on the zero state response in single order resistance-capacitance circuit transient response, the thermistor
The thermometric program of formula temperature sensor are as follows: the closure of electronic switch KD first, the common end of alternative electronic switch K is grounded with it
Input terminal is connected, and after suitable time-delay, to realize the complete electric discharge of capacitor C, then opens electronic switch KD, then make digital timing
Device is reset, and the working condition of digital clock and comparator CMP is arranged, and removes the interruption mark of digital clock and comparator CMP
Will position, the interruption of open digital clock and comparator CMP, it is open it is total interrupt, then the common end of alternative electronic switch K with
Its input terminal for meeting power supply V is connected, and is started digital clock and comparator CMP, is then waited transformation result, and Change-over knot is being waited
During fruit, when the end voltage of capacitor C before digital clock overflows reaches reference voltage Vr, comparator CMP is to control
Device, which issues, interrupts application, and controller responds the interruption application, and controller stops digital clock and comparator CMP, controller root
The clocking value of digital clock when accordingly compares the resistivity-temperature characteristics number of the thermistor RT of storage by searching in memory
According to, and then determine the temperature value of measurement.
It is when the embodiment for realizing thermometric process based on the zero state response in single order resistance-capacitance circuit transient response above.
As shown in Fig. 2, when realizing thermometric process based on the zero input response in single order resistance-capacitance circuit transient response, heat
One end, one end of electronic switch KD and a comparison input terminal of comparator CMP of one end connection capacitor C of quick resistance RT, heat
The common end of alternative electronic switch K is reconnected after the other end of the other end connection electronic switch KD of quick resistance RT, capacitor C's
One input terminal of other end ground connection, alternative electronic switch K connects power supply V, another input end grounding.
Before thermometric starts, need first to be closed electronic switch KD, and the common end of alternative electronic switch K connects power supply with it
Input terminal connect, with capacitor C is fully charged to voltage V, when thermometric starts, disconnect electronic switch KD, and alternative is electric
The input terminal that the common end of sub switch K is grounded with it is connected, and circuit enters the transient response process of zero input.
In Fig. 2, based on the zero input response in single order resistance-capacitance circuit transient response, during capacitor C electric discharge, electricity
Hold C end voltage beWherein τ is time constant, i.e. τ=RTC.
As the u in t=t0c(t) reach reference voltage Vr, i.e. uc(t)=Vr enables Vr=α V (α is the positive number less than 1), thenTo t0=- τ ln α.
T0=NT is enabled, wherein N is the clocking value of digital clock, and T is the counting pulse period of digital clock, then NT
=-τ ln α, so
Since capacitance C, pulse period T and factor alpha are definite value, so enablingThen N=ART.
The resistance value of thermistor RT is linked together with measured angle value by certain functional relation, i.e. tw=f (RT), and wherein tw is indicated
Measured angle value.
Continuous memory space is opened up in memory, and the first address of memory space is B, and wherein B is whole not less than zero
Temperature value tw is carried out discrete processes, i.e., indicates measured angle value with memory unit address in memory, deposit in storage unit by number
The content of storage is (ART), then it is (ART) that address, which is the data of storage unit of (B+N), in memory, so in memory
Memory unit address and memory cell data form the resistivity-temperature characteristics of thermistor RT.
As it can be seen that the resistance that the producer that the resistivity-temperature characteristics of the thermistor RT stored in memory are not thermistor RT provides
Temperature characteristics, but according to the transformed data of formula N=ART.
The clocking value N and the resistance value of thermistor RT of digital clock are in a linear relationship and unrelated with voltage, according to number
The resistivity-temperature characteristics of the clocking value N and thermistor RT of timer are assured that the temperature value of measurement.
When realizing thermometric process based on the zero input response in single order resistance-capacitance circuit transient response, the thermistor
The thermometric program of formula temperature sensor are as follows: the closure of electronic switch KD first, the common end of alternative electronic switch K connects power supply with it
Input terminal connect, after suitable time-delay, to realize that capacitor C's is fully charged, then open electronic switch KD, then keep number fixed
When device reset, be arranged digital clock and comparator CMP working condition, remove digital clock and comparator CMP interruption
Flag bit, the interruption of open digital clock and comparator CMP, open total interruption, then the common end of alternative electronic switch K
The input terminal being grounded with it is connected, and is started digital clock and comparator CMP, is then waited transformation result, and Change-over knot is being waited
During fruit, when the end voltage of capacitor C before digital clock overflows reaches reference voltage Vr, comparator CMP is to control
Device, which issues, interrupts application, and controller responds the interruption application, and controller stops digital clock and comparator CMP, controller root
The clocking value of digital clock when accordingly compares the resistivity-temperature characteristics number of the thermistor RT of storage by searching in memory
According to, and then determine the temperature value of measurement.
At the initial stage of capacitor C charge or discharge, electronic switch KD and alternative electronic switch K may flow through certain rush
Electric current is hit, but actual electronic switch all has certain internal resistance, by taking electronic switch KD as an example, as shown in figure 3, actual electronics
Switch KD can be equivalent to connecting for an equivalent resistance Rd and perfect switch Kd, and equivalent resistance Rd is exactly electronic switch KD
Internal resistance, it has good metering function, and due to the capacity very little of capacitor C, so by electronic switch KD and alternative
The internal resistance metering function of electronic switch K will not generate harmful current impulse.
The method of the thermistor temperature sensor calibration measurement temperature value is to adjust reference voltage Vr or software
Amendment.
As described above, charge or discharge time t0 and reference voltage Vr have direct relation, reference voltage Vr is adjusted just
Changeable time t0 value, that is, change NT value, and pulse period T value is certain, so adjusting reference voltage Vr
The count value N for changing digit counter, is finally reached the purpose of calibration measurement temperature value.
The method calibration measurement temperature value of software correction also can be used, that is, in software to the counting of digit counter
After value N is subject to amendment again, final required measurement temperature value can be just obtained.
The thermistor temperature sensor can be easily carried out the measurement of multi way temperature according to the present invention, such as
Shown in attached drawing 4, this realizes thermometric process, thermometric input electricity based on the zero state response in single order resistance-capacitance circuit transient response
Pressure is derived from the end thermistor RT voltage, i.e., using the end voltage of thermistor RT compared with reference voltage Vr.
In figure 4, it is the comparator respectively that single-chip microprocessor MCU, which has been internally integrated comparator a CMP, CMP- and CMP+,
Inverting input terminal and non-inverting input terminal, resistance R1, adjustable resistance R2 and resistance R3 are sequentially connected in series, another termination power of resistance R1
The other end of V, resistance R3 are grounded, and the adjustable tap of adjustable resistance R2 is connected to after the tie point of resistance R1 and adjustable resistance R2 again
The inverting input terminal CMP- of comparator CMP is connected, provides reference voltage Vr for comparator CMP, the one of thermistor RT1~RTn
The cathode at end, one end of capacitor C and switching diode D is connected to the non-inverting input terminal CMP+ of comparator CMP after linking together,
The other end of switching diode D is grounded, the I/O port I/O0 of the other end connection single-chip microprocessor MCU of capacitor C, thermistor
The other end of RT1~RTn is separately connected I/O port I/O1~I/On of single-chip microprocessor MCU, and switching diode D plays attached drawing 1
The effect of middle electronic switch KD.
In figure 4, by taking the thermometric of thermistor RT1 as an example, basic thermometric process are as follows: enable single-chip microprocessor MCU
I/O port I/O1~I/On is high-impedance state or is output low level state, and the I/O port I/O0 of single-chip microprocessor MCU is
Strong push-pull output state, and low level is exported, after suitable time-delay, so that capacitor C is discharged to zero completely;When thermometric starts, temperature-sensitive
One I/O port I/O1 of the single-chip microprocessor MCU that resistance RT1 is connected is strong push-pull output state, and exports low level, other
The other I/O ports for the single-chip microprocessor MCU that thermistor is connected are high-impedance state, then reset digital clock, and number is arranged
The working condition of word timer and comparator CMP removes the interrupt flag bit of digital clock and comparator CMP, open number
The interruption of timer and comparator CMP, it is open total to interrupt, then the I/O port I/O0 of single-chip microprocessor MCU be strong push-pull output
State, and high level is exported, start digital clock and comparator CMP, then wait transformation result, in the mistake for waiting transformation result
Cheng Zhong, when the end voltage of thermistor RT before digital clock overflows reaches reference voltage Vr, comparator CMP is to single-chip microcontroller
Controller in MCU, which issues, interrupts application, and the controller plc in single-chip microprocessor MCU responds the interruption application, in single-chip microprocessor MCU
Controller plc stop digital clock and comparator CMP, the controller plc in single-chip microprocessor MCU is according to number at this time
The clocking value of timer compares the resistivity-temperature characteristics data of the thermistor RT of storage by searching in memory, and then determines
The temperature value of measurement.
The thermometric process of other thermistors is same as described above.
Certainly, in the case where not departing from frame of the invention, there can also be other select and development and our energy
It is enough it is envisioned that equivalent device.