CN109374148A - A kind of temperature measuring device and measurement method - Google Patents
A kind of temperature measuring device and measurement method Download PDFInfo
- Publication number
- CN109374148A CN109374148A CN201811417550.8A CN201811417550A CN109374148A CN 109374148 A CN109374148 A CN 109374148A CN 201811417550 A CN201811417550 A CN 201811417550A CN 109374148 A CN109374148 A CN 109374148A
- Authority
- CN
- China
- Prior art keywords
- capacitor
- comparator
- ref
- chip microcontroller
- timer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01K—MEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
- G01K7/00—Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements
- G01K7/16—Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements
Abstract
The invention discloses a kind of temperature measuring device and measurement methods, including resistance temperature detector Rx, single-chip microcontroller, capacitor C, charging resistor Rfill, reference resistance Rref;The single-chip microcontroller is built-in with comparator and timer, the reference resistance RrefOne end, temperature sensor RxOne end, charging resistor RfillOne end is connected with the common pin of single-chip microcontroller respectively, and the other end connects one end of capacitor C after linking together, and is connected to the in-phase end of comparator built in single-chip microcontroller simultaneously, and the other end ground connection of the capacitor C, the reverse side of the comparator connects reference voltage Vref, the output end of the comparator is output to the capture input terminal of timer.Component needed for temperature measuring device of the invention is few, saves circuit board space, at low cost, and measurement result is accurate, and consistency is good;The present invention is lower to the required precision of component, is suitable for using battery powered super low-power consumption application.
Description
Technical field
The present invention relates to technical field of temperature measurement, and in particular to a kind of temperature measuring device and measurement method.
Background technique
In electronic field, thermistor, PT1000 etc. are often used as sensor for measuring temperature, measures biography using bridge method
Then referring to Fig. 1 temperature value is calculated according to sensor " resistance value-temperature " corresponding relationship in the resistance value of sensor.But
Using bridge method as the common electronics temperature measurement method of representative, require resistance precision that high, component is more, power quality is to survey
Amount result is affected, needs to give interlock circuit continued power, is not suitable for circuit board space anxiety, using battery power reguirements
The applications such as low-power consumption.
Application No. is 201610162237.9 patent of invention " temperature measuring circuit and methods ", disclose a kind of temperature survey
Circuit and method are measured, input and output pin IO2 " is set as input state, triggering input pin CP1 is set by specification [0011]
It is set as high level output for high level down trigger input state, input and output pin IO1, starting internal timer is opened from zero
Beginning timing ", which is used to charge to capacitor C1, but IO2 is set as input state, and some single-chip microcontrollers also have larger current and disappear
Consumption causes measurement to fail, it should be understood that setting high-impedance state for IO;Similarly the setting of down trigger pin CP1 may also cause compared with
High current consumption.The patent determines whether charging terminates using the high level down trigger of CP1 pin, can from patent content
Know that CP1 is a common I/O pin, inside is simultaneously not connected to comparator, and the down trigger of common I/O pin is by IO
High/low electrical level judging, and the high/low electrical level judging of IO is unstable, even if if capacitor C1 can be charged to requirements, most
The temperature being calculated afterwards is also inaccuracy.
Summary of the invention
It is an object of the invention to overcome disadvantage of the existing technology, a kind of temperature measuring device and measurement side are provided
Method.
To achieve the goals above, the invention is realized by the following technical scheme:
One, a kind of temperature measuring device, it is characterised in that: including resistance temperature detector Rx, single-chip microcontroller, capacitor C, fill
Resistance Rfill, reference resistance Rref;The single-chip microcontroller is built-in with comparator and timer, the reference resistance RrefOne end and list
The common pin GPIO1 of piece machine is connected, the temperature sensor RxOne end is connected with the common pin GPIO3 of single-chip microcontroller, described
Charging resistor RfillOne end is connected with the common pin GPIO2 of single-chip microcontroller, the reference resistance Rref, temperature sensor Rx, charging
Resistance RfillThe other end link together after connect one end of capacitor C, and connect the same phase of comparator built in single-chip microcontroller simultaneously
End, the other end ground connection of the capacitor C, the reverse side of the comparator connect reference voltage Vref, the output end of the comparator
It is output to the capture input terminal of timer.
Two, a kind of thermometry, which comprises the following steps:
1) comparator is closed;
2) setting GPIO1, GPIO3 is high-impedance state, and GPIO2 is set as high level output, passes through charging resistor RfillTo electricity
Hold C and charges to ceiling voltage;
3) setting GPIO2, GPIO3 is high-impedance state, and GPIO1 is set as low level output, by reference to resistance RrefTo capacitor
C electric discharge, opens simultaneously comparator, when detecting the voltage of capacitor C, and opening the timer in single-chip microcontroller simultaneously, when capacitor C is put
Electricity is lower than reference voltage V to voltagerefWhen, comparator becomes low level from output high level, and timer captures signal stopping
Timing records the timing time t of timer at this timeref;
4) it is again switched off comparator;
5) setting GPIO1, GPIO3 is high-impedance state, and GPIO2 is set as high level output, passes through charging resistor RfillTo electricity
Hold C and charges to ceiling voltage;
6) setting GPIO1, GPIO2 is high-impedance state, and GPIO3 is set as low level output, passes through temperature sensor RxTo electricity
Hold C electric discharge, open simultaneously comparator, when detecting the voltage of capacitor C, and opening the timer in single-chip microcontroller simultaneously, as capacitor C
Voltage is discharged into lower than reference voltage VrefWhen, comparator becomes low level from output high level, and timer captures the signal and stops
Only timing records the timing time t of timer at this timex;
7) the resistance value R of temperature sensor is calculated by formula (1)x;
8) temperature value is obtained by searching for " resistance value-temperature " corresponding table.
Beneficial effects of the present invention: component needed for temperature measuring device of the invention is few, saves circuit board space, cost
It is low, it is only necessary to be built-in with single-chip microcontroller, the charging resistor R of comparator and timerfill, reference resistance Rref, temperature sensor RxWith
Temperature measurement function can be realized in charge and discharge capacitance C, and measurement result is accurate, and consistency is good;Precision of the present invention to component
It is required that lower;And it only needs to carry out charge and discharge to capacitor when carrying out temperature measurement, other times do not consume electric energy, are suitble to use
In the battery powered super low-power consumption application of use.
Detailed description of the invention
Fig. 1 is bridge method measuring resistance system structure diagram;
Fig. 2 is temperature measuring device composition schematic diagram of the present invention;
Fig. 3 is the resistance measurement schematic illustration of temperature measuring device of the present invention.
Specific embodiment
Temperature measuring principle of the present invention:
As shown in figure 3, the measuring principle of temperature measuring device of the present invention is to carry out charge and discharge to capacitor by resistance, it will be electric
The measurement of resistance resistance value is converted to the measurement of charge and discharge time.Series circuit, the transient process of circuit are formed by resistance R and capacitor C
For the charge or discharge process of capacitor C.When switch gets to position K1, is charged by resistance R to capacitor C, reached to capacitor C voltage
To VccAfterwards, by switch conversion to position K2, then capacitor C begins through resistance R electric discharge, according to Kirchhoff's second law, at this time
Circuit meets formula (2), wherein UcFor the voltage at the both ends capacitor C, i is the electric current for flowing through resistance R.
Uc+ iR=0 (2)
If the electricity of capacitor C is Qc, then in capacitor C discharge process, loop current i can be stated with formula (3), i.e., electric current is
Capacitor electricity time differential.
Starting voltage when electric discharge after capacitor C is fully charged in Fig. 3 is Vcc, bring formula (3) into formula (2) with this condition
Capacitor both end voltage U can be obtainedcAs described in formula (4), it can be obtained according to formula (4) and capacitor is discharged into voltage Uc, required discharge time
As formula (5) are stated.
Based on the above theory, when capacitor C is charged to VccAfterwards, respectively by one only with reference to resistance RrefWith one to testing temperature
Sensor RxDischarge into same reference voltage voltage value VrefIf through resistance RrefTime used in discharging is tref, pass through RxElectric discharge institute
It is t with the timex, bringing formula (5) into respectively can be obtained formula (1) described relationship, i.e., discharge time and discharge resistance resistance value at
Proportionate relationship.The reference resistance R in formula (1)refKnown to resistance value, it is only necessary to obtain trefAnd txProportionate relationship can calculate
To resistance value R to be measuredx。
Embodiment 1:
As shown in Fig. 2, a kind of temperature measuring device, including resistance temperature detector Rx, single-chip microcontroller, capacitor C, charging electricity
Hinder Rfill, reference resistance Rref;The single-chip microcontroller is built-in with comparator A and timer, the reference resistance RrefOne end and monolithic
The common pin GPIO1 of machine is connected, the temperature sensor RxOne end is connected with the common pin GPIO3 of single-chip microcontroller, described to fill
Resistance RfillOne end is connected with the common pin GPIO2 of single-chip microcontroller, and the resistance of access charge-discharge circuit is controlled by single-chip microcontroller,
The reference resistance Rref, temperature sensor Rx, charging resistor RfillThe other end link together after connect capacitor C one end,
And the in-phase end of comparator A built in single-chip microcontroller is connected simultaneously, the comparator A moment detects the voltage value of charge and discharge capacitance C;The electricity
Hold the other end ground connection of C, the reverse side of the comparator A connects reference voltage Vref, compared with in-phase end voltage;The ratio
Output end compared with device A is output to timer capture input terminal, when the voltage value for detecting capacitor C is lower than reference voltage VrefWhen ratio
It exports and changes compared with device A, the timer built in the single-chip microcontroller captures comparator A output variation, stops timing, obtains capacitor
C discharge time.
A kind of thermometry, comprising the following steps:
1) comparator A is closed;
2) setting GPIO1, GPIO3 is high-impedance state, and GPIO2 is set as high level output, passes through charging resistor RfillTo electricity
Hold C and charges to ceiling voltage;
3) setting GPIO2, GPIO3 is high-impedance state, and GPIO1 is set as low level output, by reference to resistance RrefTo capacitor
C electric discharge, opens simultaneously comparator A, when detecting the voltage of capacitor C, and opening the timer in single-chip microcontroller simultaneously, as capacitor C
Voltage is discharged into lower than reference voltage VrefWhen, comparator A becomes low level from output high level, and timer captures the signal
Stop timing, records the timing time t of timer at this timeref;
4) it is again switched off comparator A;
5) setting GPIO1, GPIO3 is high-impedance state, and GPIO2 is set as high level output, passes through charging resistor RfillTo electricity
Hold C and charges to ceiling voltage;
6) setting GPIO1, GPIO2 is high-impedance state, and GPIO3 is set as low level output, passes through temperature sensor RxTo electricity
Hold C electric discharge, open simultaneously comparator A, when detecting the voltage of capacitor C, and opening the timer in single-chip microcontroller simultaneously, works as capacitor
C discharges into voltage lower than reference voltage VrefWhen, comparator A becomes low level from output high level, and timer captures the signal
Stop timing, records the timing time t of timer at this timex;
7) the resistance value R of temperature sensor is calculated by formula (1)x;
8) temperature value is obtained by searching for " resistance value-temperature " corresponding table.
Embodiment described above is the preferable scheme of the present invention, is not intended to limit the present invention in any form,
There are also other variations and modifications on the premise of not exceeding the technical scheme recorded in the claims.
Claims (2)
1. a kind of temperature measuring device, it is characterised in that: including resistance temperature detector Rx, single-chip microcontroller, capacitor C, charging resistor
Rfill, reference resistance Rref;The single-chip microcontroller is built-in with comparator and timer, the reference resistance RrefOne end and single-chip microcontroller
Common pin GPIO1 is connected, the temperature sensor RxOne end is connected with the common pin GPIO3 of single-chip microcontroller, the charging electricity
Hinder RfillOne end is connected with the common pin GPIO2 of single-chip microcontroller, the reference resistance Rref, temperature sensor Rx, charging resistor
RfillThe other end link together after connect one end of capacitor C, and be connected to the in-phase end of comparator built in single-chip microcontroller simultaneously,
The other end of the capacitor C is grounded, and the reverse side of the comparator connects reference voltage Vref, the output end of the comparator is defeated
The capture input terminal of timer is arrived out.
2. a kind of measurement method of temperature measuring device described in claim 1, which comprises the following steps:
1) comparator is closed;
2) setting GPIO1, GPIO3 is high-impedance state, and GPIO2 is set as high level output, passes through charging resistor RfillCapacitor C is filled
Electricity is to ceiling voltage;
3) setting GPIO2, GPIO3 is high-impedance state, and GPIO1 is set as low level output, by reference to resistance RrefCapacitor C is put
Electricity opens simultaneously comparator, when detecting the voltage of capacitor C, and opening the timer in single-chip microcontroller simultaneously, when capacitor C discharges
It is lower than reference voltage V to voltagerefWhen, comparator becomes low level from output high level, and timer captures the signal and stops meter
When, record the timing time t of timer at this timeref;
4) it is again switched off comparator;
5) setting GPIO1, GPIO3 is high-impedance state, and GPIO2 is set as high level output, passes through charging resistor RfillCapacitor C is filled
Electricity is to ceiling voltage;
6) setting GPIO1, GPIO2 is high-impedance state, and GPIO3 is set as low level output, passes through temperature sensor RxCapacitor C is put
Electricity opens simultaneously comparator, when detecting the voltage of capacitor C, and opening the timer in single-chip microcontroller simultaneously, when capacitor C discharges
It is lower than reference voltage V to voltagerefWhen, comparator becomes low level from output high level, and timer captures the signal and stops meter
When, record the timing time t of timer at this timex;
7) pass through formulaCalculate the resistance value R of temperature sensorx;
8) temperature value is obtained by searching for " resistance value-temperature " corresponding table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811417550.8A CN109374148A (en) | 2018-11-26 | 2018-11-26 | A kind of temperature measuring device and measurement method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811417550.8A CN109374148A (en) | 2018-11-26 | 2018-11-26 | A kind of temperature measuring device and measurement method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109374148A true CN109374148A (en) | 2019-02-22 |
Family
ID=65383347
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811417550.8A Pending CN109374148A (en) | 2018-11-26 | 2018-11-26 | A kind of temperature measuring device and measurement method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109374148A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109932639A (en) * | 2019-03-29 | 2019-06-25 | 北京唯实兴邦科技有限公司 | FPGA solder joint failure diagnostic method and diagnostic device based on single capacitor |
CN110567603A (en) * | 2019-09-29 | 2019-12-13 | 杨柳 | Single ADC multichannel temperature monitoring circuit controlled by GPIO |
CN112504413A (en) * | 2020-11-25 | 2021-03-16 | 西南科技大学 | Full-digitalization conversion method and device for six-component balance bridge detection |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2725866Y (en) * | 2004-09-08 | 2005-09-14 | 深圳市和而泰电子科技有限公司 | Digital temp measuring circuit |
CN104390718A (en) * | 2014-10-10 | 2015-03-04 | 记忆科技(深圳)有限公司 | Temperature detection method |
CN204422094U (en) * | 2015-03-05 | 2015-06-24 | 佛山市顺德区美的电热电器制造有限公司 | Temperature measurement circuit and electromagnetic oven |
CN105547514A (en) * | 2016-01-25 | 2016-05-04 | 四川长虹电器股份有限公司 | Temperature measurement circuit and method |
CN105698957A (en) * | 2016-03-21 | 2016-06-22 | 四川长虹电器股份有限公司 | Temperature measuring circuit and method |
-
2018
- 2018-11-26 CN CN201811417550.8A patent/CN109374148A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN2725866Y (en) * | 2004-09-08 | 2005-09-14 | 深圳市和而泰电子科技有限公司 | Digital temp measuring circuit |
CN104390718A (en) * | 2014-10-10 | 2015-03-04 | 记忆科技(深圳)有限公司 | Temperature detection method |
CN204422094U (en) * | 2015-03-05 | 2015-06-24 | 佛山市顺德区美的电热电器制造有限公司 | Temperature measurement circuit and electromagnetic oven |
CN105547514A (en) * | 2016-01-25 | 2016-05-04 | 四川长虹电器股份有限公司 | Temperature measurement circuit and method |
CN105698957A (en) * | 2016-03-21 | 2016-06-22 | 四川长虹电器股份有限公司 | Temperature measuring circuit and method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109932639A (en) * | 2019-03-29 | 2019-06-25 | 北京唯实兴邦科技有限公司 | FPGA solder joint failure diagnostic method and diagnostic device based on single capacitor |
CN110567603A (en) * | 2019-09-29 | 2019-12-13 | 杨柳 | Single ADC multichannel temperature monitoring circuit controlled by GPIO |
CN110567603B (en) * | 2019-09-29 | 2024-03-19 | 江苏久卫智能科技有限公司 | Single ADC multipath temperature monitoring circuit controlled by GPIO |
CN112504413A (en) * | 2020-11-25 | 2021-03-16 | 西南科技大学 | Full-digitalization conversion method and device for six-component balance bridge detection |
CN112504413B (en) * | 2020-11-25 | 2022-03-22 | 西南科技大学 | Full-digitalization conversion method and device for six-component balance bridge detection |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101082644B (en) | Method for mirror-image constant flow source measuring capacitance | |
CN109374148A (en) | A kind of temperature measuring device and measurement method | |
CN106501618B (en) | Capacitor's capacity measuring circuit | |
US20130116956A1 (en) | Capacitance measurement circuit | |
WO2017152479A1 (en) | Method and apparatus for rapidly detecting remaining capacity and state of health of storage battery | |
CN2766247Y (en) | Ultra-capacitor tester | |
CN103513106A (en) | Measuring method, measuring circuit and monitoring apparatus | |
JPS60502227A (en) | Device and method for measuring the capacitance value of a capacitor | |
CN104345214A (en) | Method for indirectly judging whether impedance of electronic detonator ignition circuit is qualified or not | |
CN106768457B (en) | A kind of thermistor temp Acquisition Circuit and its self checking method | |
TW200928403A (en) | Battery module and method for determining a charging state thereof | |
CN107543972A (en) | One kind measurement capacitor system and its measuring method | |
CN103675463A (en) | Liquid dielectric constant measuring system self-adapting to scale and precision | |
CN201057533Y (en) | Multimeter with accurate capacitance measuring function | |
CN203881844U (en) | Residual voltage detecting system based on MSP430 | |
CN201215570Y (en) | Voltage detecting circuit for battery | |
CN104390718A (en) | Temperature detection method | |
CN110133528A (en) | A kind of the internal resistance measurement device and its measurement method of automatic measure on line lithium battery | |
CN202068387U (en) | RC oscillator circuit for capacitance type touch press key | |
CN102565708A (en) | Battery capacity detection system | |
CN204925248U (en) | Measure circuit of adjustable resistance resistance | |
CN106124995A (en) | Battery electric quantity checking device and mobile electronic device | |
CN106017717B (en) | Thermistor temperature sensor | |
CN104897964B (en) | A kind of circuit and method for measuring variable resistor resistance | |
CN110375876A (en) | A kind of IGBT temperature detection circuit and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190222 |
|
RJ01 | Rejection of invention patent application after publication |