Temperature measurement apparatus
The temperature measuring device addresses inaccuracies in existing devices by using a resistance circuit with a thermistor and multiple resistors, and a microcomputer with switchable terminals, ensuring accurate temperature measurement despite power supply and AD converter errors.
Patent Information
- Application Number
- JP2023054360
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing temperature measuring devices face inaccuracies due to fluctuations in power supply voltage, gain errors, offset errors, and self-heating effects, especially when using AD converters, which affect the measurement of thermistor resistance values across a wide temperature range.
A temperature measuring device utilizing a resistance circuit with a thermistor and multiple resistors, an AD converter, and a microcomputer with general-purpose input/output terminals that switch between voltage states, allowing for accurate resistance value calculation of the thermistor by minimizing the impact of power supply fluctuations and AD converter errors.
The device achieves high-accuracy temperature measurement by suppressing power supply voltage fluctuations and AD converter errors, enabling precise resistance value determination of the thermistor across a wide temperature range.
Smart Images

Figure 2024142250000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a temperature measuring device using a microcomputer. [Background technology]
[0002] For example, as shown in Patent Documents 1 and 2, there has been proposed a temperature measuring device that includes a resistor circuit in which a reference resistor with a known resistance value and a thermistor whose resistance value changes with temperature are connected in series, an AD converter built into a microcomputer, and a temperature calculation unit that calculates a temperature based on the resistance value of the thermistor. In this temperature measuring device, one end of the resistor circuit is connected to a power supply terminal that supplies a set voltage, and the other end of the resistor circuit is connected to ground.
[0003] In this temperature measurement device, when the temperature of the object to be measured changes and the resistance value of the thermistor changes, the voltage at the connection point between the reference resistor and thermistor also changes. Because the power supply voltage and the resistance value of the reference resistor are known, it is possible to measure the temperature of the object to be measured by acquiring the voltage value at the connection point between the reference resistor and thermistor using an AD converter. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2005-274372 A [Patent Document 2] Japanese Patent Application Publication No. 05-026741 Summary of the Invention [Problem to be solved by the invention]
[0005] In a temperature measuring device such as that described above, the resistance value of the thermistor is calculated based on a known power supply voltage and the resistance value of the reference resistor, so if the power supply voltage deviates from the known value, the resistance value of the thermistor cannot be accurately calculated.
[0006] Furthermore, in an AD converter for acquiring the voltage value of the connection point, there is a risk that the voltage value of the connection point cannot be acquired accurately due to the influence of gain error, offset error, and the like.
[0007] Here, the gain error is an error that occurs when the slope of the characteristic of the converted value with respect to the input voltage differs from the theoretical value, and the offset error is an error that occurs uniformly overall in the characteristic of the converted value with respect to the input voltage.
[0008] Patent Document 1 discloses a temperature measuring device that solves the problem of fluctuations in the power supply voltage, but this temperature measuring device cannot solve the problems of various errors in the AD converter.
[0009] Patent Document 2 discloses a temperature measuring device that solves the problems of power supply voltage fluctuation and gain and offset errors of the AD converter, but this temperature measuring device is configured so that a current continues to flow through the thermistor, and therefore the self-heating effect of the thermistor makes it impossible to measure temperature with high accuracy. Furthermore, there is a problem in that the results contain large errors because multiple reference resistors with the same value are used.
[0010] Furthermore, in Patent Documents 1 and 2, since the resistance value of the reference resistor is constant, it is difficult to measure temperatures with high accuracy from low temperature range to high temperature range.
[0011] In consideration of the above circumstances, the present invention aims to provide a temperature measuring device that can measure temperature with high accuracy over a wide temperature range from low temperature to high temperature by suppressing the effects of power supply voltage fluctuations and gain error and offset error of an AD converter. [Means for solving the problem]
[0012] The temperature measuring device of the present invention comprises a resistance circuit having a thermistor and a plurality of resistors with known resistance values, an AD converter built into a microcontroller, and a temperature calculation unit that calculates a temperature based on the resistance value of the thermistor, wherein the microcontroller has a plurality of general-purpose input / output terminals that can be switched between a first voltage state for supplying a set voltage and a second voltage state having a lower voltage than the first voltage state, wherein one ends of the thermistor and the plurality of resistors are respectively connected to different general-purpose input / output terminals of the microcontroller, and the other ends of the thermistor and the plurality of resistors are connected to a common input terminal of the microcontroller, and the temperature calculation unit calculates the resistance value of the thermistor using the voltage of the input terminal measured by the AD converter.
[0013] The temperature calculation section may further calculate a resistance value of the thermistor using the voltages of the general-purpose input / output terminals measured by the AD converter.
[0014] The resistance circuit may include at least one compensation resistor connected in parallel with the thermistor.
[0015] The resistance value of the compensation resistor may be set to the resistance value of a thermistor corresponding to a specific temperature to be measured with high accuracy.
[0016] At least one of the general-purpose input / output terminals may be at a fixed potential, and the temperature calculation section may further calculate a resistance value of the thermistor using a voltage of the fixed potential. Effect of the Invention
[0017] According to the temperature measuring device of the present invention, it is possible to measure temperature with high accuracy over a wide temperature range from low temperature to high temperature by using a single temperature measuring device, while suppressing the effects of fluctuations in power supply voltage and gain errors and offset errors of the AD converter. [Brief description of the drawings]
[0018] [Figure 1]1 is a diagram showing a circuit configuration of a temperature measuring device according to a first embodiment of the present invention. [Diagram 2] 1 is a graph showing the relationship between temperature and resistance value in a thermistor. [Diagram 3] 1 is a graph showing the relationship between temperature and the voltage at the connection point between a reference resistor and a thermistor. [Figure 4] 1 is a diagram for explaining a gain error in an AD converter. [Diagram 5] FIG. 1 is a diagram for explaining an offset error in an AD converter. [Figure 6] FIG. 4 is a diagram showing a circuit configuration of a temperature measuring device according to a second embodiment of the present invention. [Figure 7] FIG. 11 is a diagram showing a circuit configuration when the number of correction resistors is two in the temperature measuring device of the second embodiment. [Figure 8] FIG. 2 is a diagram showing input / output characteristics of an AD converter. [Figure 9] FIG. 11 is a diagram showing a circuit configuration of a temperature measuring device according to a modified example of the second embodiment of the present invention. [Figure 10] FIG. 13 is a diagram showing a circuit configuration when the number of correction resistors is two in a temperature measuring device according to a modified example of the second embodiment. [Figure 11] FIG. 13 is a diagram showing a circuit configuration of a temperature measuring device according to a fourth embodiment of the present invention. [Figure 12] FIG. 13 is a diagram showing a circuit configuration of a temperature measuring device according to Application Example 1 of the fourth embodiment of the present invention. [Figure 13] FIG. 13 is a diagram showing a circuit configuration of a temperature measuring device according to Application Example 2 of the fourth embodiment of the present invention. [Figure 14] FIG. 13 is a diagram showing a circuit configuration of a temperature measuring device according to Application Example 3 of the fourth embodiment of the present invention. [Figure 15] FIG. 13 is a diagram showing a circuit configuration of another temperature measuring device according to Application Example 3 of the fourth embodiment of the present invention. [Figure 16] 1 is a graph showing the relationship between temperature and the voltage at a connection point between a thermistor and a plurality of reference resistors having different resistance values. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0019] Next, an embodiment of the present invention will be described with reference to the drawings.
[0020] [First embodiment] First, a description will be given of a temperature measuring device 1 according to a first embodiment of the present invention. Fig. 1 is a diagram showing a circuit configuration of the temperature measuring device 1 according to the first embodiment of the present invention.
[0021] As shown in FIG. 1, the temperature measuring device 1 includes a resistance circuit 10 in which a reference resistor 11 having a known resistance value and a thermistor 12 are connected in series, an AD converter 21 built into a microcomputer 20, and a temperature calculation unit 22 that calculates the temperature based on the resistance value Rth of the thermistor 12.
[0022] One end of the resistor circuit 10 is connected to a general-purpose input / output terminal GPIO of the microcomputer 20. The other end of the resistor circuit 10 is connected to ground.
[0023] The general-purpose input / output terminal GPIO of the microcontroller 20 can be switched between three states: "high level" which is at the same potential as the power supply voltage, "low level" which is at the same potential as ground, and "high impedance" which is in an electrically open state.
[0024] When the general-purpose input / output terminal GPIO of the microcomputer 20 is set to a "high level" state, the general-purpose input / output terminal GPIO functions as a power supply terminal that supplies a set voltage to the resistor circuit 10. During the temperature measurement period, the general-purpose input / output terminal GPIO of the microcomputer 20 is set to a "high level" state.
[0025] When the general-purpose input / output terminal GPIO of the microcomputer 20 is set to a "low level" state, the general-purpose input / output terminal GPIO functions as a ground potential.
[0026] In this embodiment, the thermistor 12 side of the resistor circuit 10 is connected to the general-purpose input / output terminal GPIO, and the reference resistor 11 side is connected to ground.
[0027] The general-purpose input / output terminal GPIO is connected to an input terminal Ain of the AD converter 21. A connection point 13 between the reference resistor 11 and the thermistor 12 is connected to an input terminal Bin of the AD converter 21. The ground is connected to an input terminal Cin of the AD converter 21.
[0028] By using the switch 23 to switch the input terminal connected to the AD converter 21, the AD converter 21 can measure the voltage Vgpio of the general-purpose input / output terminal GPIO, the voltage Vraw of the connection point 13, and the ground voltage Vgnd.
[0029] Temperature calculation unit 22 is built into microcomputer 20. Temperature calculation unit 22 also calculates the resistance value of thermistor 12 using the voltage of general-purpose input / output terminal GPIO serving as a power supply terminal measured by the same AD converter 21 also built into microcomputer 20, the voltage of connection point 13 between reference resistor 11 and thermistor 12, and the ground voltage.
[0030] The temperature measurement method in the temperature measurement device 1 of this embodiment will be described in detail below. Figures 2A and 2B are graphs showing the relationship between temperature and resistance value in the thermistor 12. Figure 3 is a graph showing the relationship between temperature and voltage Vraw at connection point 13 between reference resistor 11 and thermistor 12. Figure 4 is a diagram for explaining gain error in AD converter 21. Figure 5 is a diagram for explaining offset error in AD converter 21.
[0031] In the temperature measuring device 1, the temperature of the object to be measured is measured by the thermistor 12. The thermistor 12 provided in the temperature measuring device 1 of this embodiment is an NTC (Negative Temperature Coefficient) thermistor, and has the characteristic that the resistance value decreases as the temperature increases, as shown in Figures 2A and 2B.
[0032] When the temperature of the object to be measured changes and the resistance value Rth of thermistor 12 changes as shown in Figure 2B, the value of voltage Vraw at connection point 13 between reference resistor 11 and thermistor 12 changes as shown in Figure 3. That is, as the temperature of thermistor 12 increases, the value of voltage Vraw at connection point 13 increases.
[0033] By inputting the voltage Vraw at the connection point 13 to an AD converter 21, the value of the voltage Vraw can be measured.
[0034] The voltage Vraw can be expressed by the following formula (1): where Vgpio is the voltage of the general-purpose input / output terminal GPIO, Vgnd is the ground voltage of the resistor circuit 10, and Rref is the known resistance value of the reference resistor 11. Vraw=(Vgpio-Vgnd) / (1+Rth / Rref)+Vgnd …(1)
[0035] By measuring the voltage Vraw at the connection point 13 with the AD converter 21, the temperature calculation section 22 can calculate the resistance value Rth of thermistor 12 from equation (1), thereby making it possible to obtain the temperature of the object to be measured.
[0036] However, as is clear from equation (1), the resistance value Rth of thermistor 12 depends on the voltage Vgpio of the general-purpose input / output terminal GPIO and the ground voltage Vgnd of the resistor circuit 10, and unless these values are accurately known, the resistance value Rth of thermistor 12 cannot be accurately calculated.
[0037] The relationship between the input voltage Vin to AD converter 21 and the output code Dout of AD converter 21 can be expressed by the following equation (2A) if the resolution voltage per bit of AD converter 21 is a, the offset voltage of AD converter 21 is b, and quantization error is ignored. Here, the ground voltage value of AD converter 21 is assumed to be zero. Hereinafter, the ground voltage value of AD converter 21 is assumed to be zero. Moreover, by transforming equation (2A), the following equation (2B) is obtained. Vin = a × Dout + b … (2A) Dout=(Vin-b) / a=Vin / ab / a …(2B)
[0038] In the AD converter 21, there is variation in the resolution voltage a per bit, and the variation of 1 / a is called a gain error. Such a gain error is shown in FIG.
[0039] In addition, even if Vin is zero, Dout may not be zero. This is called an offset error. In equation (2B), -b / a represents the offset error. Such an offset error is shown in Figure 5.
[0040] In the temperature measuring device 1 of the present embodiment, the voltages Vgpio, Vraw, and Vgnd are measured by the same AD converter 21. In this case, the following equations (3), (4), and (5) hold based on equation (2A). Vgpio = a × Dgpio + b … (3) Vraw = a × Draw + b … (4) Vgnd = a × Dgnd + b … (5)
[0041] Moreover, based on equations (3), (4), and (5), the following equation (6) is established. (Vraw-Vgnd) / (Vgpio-Vgnd)=(Draw-Dgnd) / (Dgpio-Dgnd) …(6)
[0042] Moreover, by applying equation (6) to equation (1), the following equation (7) is obtained. (Draw-Dgnd) / (Dgpio-Dgnd)=1 / (1+Rth / Rref) …(7)
[0043] Equation (7) does not include the voltage Vraw at the connection point 13, the voltage Vgpio at the general-purpose input / output terminal GPIO, and the ground voltage Vgnd of the resistor circuit 10, and does not include the gain error 1 / a and offset error −b / a of the AD converter 21.
[0044] Therefore, when the resistance value Rth of the thermistor 12 is calculated in the temperature calculation unit 22, it is not affected by the gain error and offset error of the AD converter 21.
[0045] Furthermore, even if the voltage Vgpio of the general-purpose input / output terminal GPIO or the ground voltage Vgnd of the resistor circuit 10 fluctuates, the resistance value Rth of the thermistor 12 can be calculated based on the measured values of the voltage Vgpio, voltage Vraw, and voltage Vgnd measured by the AD converter 21.
[0046] From the above, even if there are fluctuations in the power supply voltage and gain and offset errors in the AD converter, the temperature can be measured with high accuracy.
[0047] Furthermore, except during the period when the temperature is being measured, the general-purpose input / output terminal GPIO of the microcontroller 20 can be set to a "low level" state or a "high impedance" state to suppress the self-heating effect of the thermistor 12, thereby enabling the temperature to be measured with higher accuracy.
[0048] [Second embodiment] Next, a temperature measuring device 2 according to a second embodiment will be described. Fig. 6 is a diagram showing a circuit configuration of a temperature measuring device 2 according to the second embodiment of the present invention.
[0049] In the above-described first embodiment, it is possible to overcome the fluctuation of the power supply voltage and the gain error and offset error of the AD converter 21. However, it is not possible to cope with a case where the AD converter 21 has a negative offset or where the voltage Vgpio exceeds the measurement range of the AD converter 21. The temperature measuring device 2 of the second embodiment is an aspect that solves such problems.
[0050] 6, the temperature measuring device 2 differs from the temperature measuring device 1 of the first embodiment in that a resistor circuit 10 includes a plurality of correction resistors 14a, 14b...14n connected in parallel with the thermistor 12. The resistance value of each of the correction resistors 14a, 14b...14n is known. These correction resistors 14a, 14b...14n are resistors for acquiring correction information for the AD converter 21.
[0051] In this embodiment, one end of the correction resistors 14a, 14b, . . . 14n is connected to different general-purpose input / output terminals GPIO1, GPIO2, . . . GPION, respectively. The other end of the correction resistors 14a, 14b, .
[0052] The general-purpose input / output terminal GPIO is connected to an input terminal Ain of the AD converter 21. The general-purpose input / output terminal GPIO1 is connected to an input terminal Ain1 of the AD converter 21. The general-purpose input / output terminal GPIO2 is connected to an input terminal Ain2 of the AD converter 21. The general-purpose input / output terminal GPION is connected to an input terminal AinN of the AD converter 21. A connection point 13 between the reference resistor 11 and thermistor 12 is connected to an input terminal Bin of the AD converter 21. The ground is connected to an input terminal Cin of the AD converter 21.
[0053] The number of the correction resistors 14 may be any number as long as it is at least one.
[0054] A method of measuring temperature in the temperature measuring device 2 of this embodiment will be described in detail below. Here, as shown in FIG. 7, a case where the number N of correction resistors 14 is two will be described as an example.
[0055] The general-purpose input / output terminal GPIO1 and the general-purpose input / output terminal GPIO2 are set to a "high impedance" state, the general-purpose input / output terminal GPIO is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may be further switched between Ain and Cin to measure the voltages Vgpio and Vgnd. This state is substantially the same as in Figure 1, so equations (1), (3), (4), and (5) hold.
[0056] Next, the general-purpose input / output terminal GPIO and the general-purpose input / output terminal GPIO2 are set to a "high impedance" state, the general-purpose input / output terminal GPIO1 is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. The voltage Vraw at this time is set to voltage Vraw1. At this time, the input terminal connected to the AD converter 21 may further be switched to Ain1 to measure the voltage Vgpio1.
[0057] The voltage Vraw1 at this time can be expressed by the following equation (8). Vraw1 = a × Draw1 + b … (8)
[0058] Next, the general-purpose input / output terminal GPIO and the general-purpose input / output terminal GPIO1 are set to a "high impedance" state, the general-purpose input / output terminal GPIO2 is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. The voltage Vraw at this time is set to voltage Vraw2. At this time, the input terminal connected to the AD converter 21 may also be switched to Ain2 to measure the voltage Vgpio2.
[0059] The voltage Vraw2 at this time can be expressed by the following equation (9). Vraw2 = a × Draw2 + b … (9)
[0060] Furthermore, from equations (8) and (9), the following equations (10) and (11) hold. a=(Vraw1-Vraw2) / (Draw1-Draw2) …(10) b=(Draw1×Vraw2-Draw2×Vraw1) / (Draw1-Draw2) …(11)
[0061] Furthermore, the following equations (12) and (13) hold true. Vraw1=kraw1×(Vgpio1-Vgnd)+Vgnd …(12) Vraw2=kraw2×(Vgpio2-Vgnd)+Vgnd …(13)
[0062] Here, Vgnd is the ground voltage of the resistor circuit 10. Furthermore, as expressed in equation (14), kraw1 is the ratio of the voltage Vraw1 at the connection point 13 between the reference resistor 11 and the correction resistor 14a to the voltage Vgpio1. Furthermore, as expressed in equation (15), kraw2 is the ratio of the voltage Vraw2 at the connection point 13 between the reference resistor 11 and the correction resistor 14b to the voltage Vgpio2. kraw1=1 / (1+R1 / Rref) …(14) kraw2=1 / (1+R2 / Rref) …(15)
[0063] Since the reference resistor is common, the error contained in the measured values of the voltages Vraw1 and Vraw2 can be made smaller than in Patent Document 2.
[0064] The values of the voltages Vgpio, Vgpio1, Vgpio2...VgpioN vary and are not the same between different microcomputers, but the values of the voltages Vgpio, Vgpio1, Vgpio2...VgpioN are almost the same within the same microcomputer 20. When the voltages Vgpio1 and Vgpio2 are almost equal to the voltage Vgpio, applying the formulas (12) and (13) to the formulas (10) and (11) gives the following formulas (16) and (17). a=(Vgpio-Vgnd)×(kraw1-kraw2) / (Draw1-Draw2) …(16) b=(Vgpio-Vgnd)×(Draw1×kraw2-Draw2×kraw1) / (Draw1-Draw2)+Vgnd …(17)
[0065] When the formulas (16) and (17) are applied to the formulas (3), (4), and (5), the following formula (18) is obtained. (Vraw-Vgnd) / (Vgpio-Vgnd)={(kraw1-kraw2)×Draw+(Draw1×kraw2-Draw2×kraw1)} / (Draw1-Draw2) …(18)
[0066] When this equation (18) is applied to equation (1), the following equation (19) is obtained. {(kraw1-kraw2)×Draw+(Draw1×kraw2-Draw2×kraw1)} / (Draw1-Draw2)=1 / (1+Rth / Rref) …(19)
[0067] Here, if R1 / Rref→0, then kraw1→1, Vraw1→Vgpio, and Draw1→Dgpio, and if R2 / Rref→∞, then kraw2→0, Vraw2→Vgnd, and Draw2→Dgnd.
[0068] Therefore, if R1 / Rref→0 and R2 / Rref→∞, equation (19) coincides with equation (7), so it can be understood that the temperature measuring device 2 of the second embodiment is an advanced form of the temperature measuring device 1 of the first embodiment.
[0069] Here, since the resistance values of the reference resistor 11, the correction resistor 14a, and the correction resistor 14b are known, kraw1 and kraw2 are also known. For example, if R1=2×Rref, then Vraw1=Vgpio / 3, and as a result, kraw1=1 / 3. If R2=Rref / 2, then Vraw2=2×Vgpio / 3, and as a result, kraw2=2 / 3.
[0070] The resistance value Rth of the thermistor 12 can be calculated based on the known values kraw1 and kraw2 and equation (19).
[0071] Equation (19) does not include the voltage Vraw at the connection point 13, the voltage Vgpio at the general-purpose input / output terminal GPIO, the voltage Vgpio1 at the general-purpose input / output terminal GPIO1, the voltage Vgpio2 at the general-purpose input / output terminal GPIO2, and the ground voltage Vgnd of the resistor circuit 10, nor does it include the gain error 1 / a and offset error -b / a of the AD converter 21.
[0072] Therefore, when the resistance value Rth of the thermistor 12 is calculated in the temperature calculation unit 22, it is not affected by the gain error and offset error of the AD converter 21.
[0073] Furthermore, even if the voltage Vgpio of the general-purpose input / output terminal GPIO, the voltage Vgpio1 of the general-purpose input / output terminal GPIO1, the voltage Vgpio2 of the general-purpose input / output terminal GPIO2, and the ground voltage Vgnd of the resistor circuit 10 fluctuate, the resistance value Rth of the thermistor 12 can be calculated based on the measured values of the voltages Vraw1 and Vraw2.
[0074] As described above, according to the temperature measuring device 2 of the second embodiment, the measurement values of the voltage Vgpio of the general-purpose input / output terminal GPIO, the voltage Vgpio1 of the general-purpose input / output terminal GPIO1, the voltage Vgpio2 of the general-purpose input / output terminal GPIO2, and the ground voltage Vgnd of the resistor circuit 10 are not included. Therefore, even if the AD converter 21 has a negative offset or even if the voltage Vgpio of the general-purpose input / output terminal GPIO, the voltage Vgpio1 of the general-purpose input / output terminal GPIO1, and the voltage Vgpio2 of the general-purpose input / output terminal GPIO2 exceed the measurement range of the AD converter 21, the temperature can be measured with high accuracy.
[0075] Furthermore, the input / output characteristics of the AD converter 21 are not linear, as shown in Fig. 8. This nonlinearity is called a nonlinearity error. According to the temperature measuring device 2 of the second embodiment, the input / output characteristics of the AD converter 21 can be divided into input sections to obtain an approximate straight line, so that the nonlinearity can be approximated by a broken line divided into sections.
[0076] Furthermore, if the AD converter 21 does not have a negative offset and the voltage Vgpio is within the measurement range of the AD converter 21, an approximation line of the input / output of the AD converter 21 can be obtained from the voltage Vgpio and the voltage Vgnd, as in the temperature measuring device 1 of the first embodiment, and partial correction from the approximation line can be performed.
[0077] When approximating with a broken line divided into segments, or when performing partial correction from a straight line obtained from the voltage Vgpio and the voltage Vgnd, the gain error 1 / a and offset error -b / a of the AD converter 21 are not constant but differ for each segment. Therefore, by increasing the number of correction resistors 14 from two so that the measurement points are finely distributed within the measurement range of the AD converter 21, the gain error 1 / a and offset error -b / a can be corrected more finely, so that the nonlinearity error of the AD converter 21 can be corrected more accurately, and the temperature can be calculated more accurately than in the first embodiment.
[0078] The second embodiment can also be realized by a configuration like that of a temperature measuring device 3 shown in Fig. 9. This temperature measuring device 3 differs from the above-mentioned temperature measuring device 2 in that the reference resistor 11 side is connected to a power supply terminal Vdd, and the thermistor 12 and correction resistor 14 sides of the resistor circuit 10 are connected to a general-purpose input / output terminal GPIO. In Fig. 9, the general-purpose input / output terminal GPIO switches between two states: a "high impedance" state and a "low level" state.
[0079] It should be noted that a temperature measuring device 3A shown in FIG. 10 is a temperature measuring device 3 configured with two correction resistors 14.
[0080] [Third embodiment] The temperature measuring device of the third embodiment is the temperature measuring device 2 of the second embodiment described above, in which the resistance value of the correction resistor 14 is set to the resistance value of the thermistor 12 corresponding to a specific temperature to be measured with high accuracy.
[0081] 6 or 9, the resistance value R1 of the compensation resistor 14a and the resistance value R2 of the compensation resistor 14b are selected to be approximately equal to the resistance values of the thermistor 12 corresponding to temperatures near where high accuracy is particularly required, such as 25° C. and 0° C. In the case of the thermistor 12 having the characteristics shown in FIG.
[0082] In this embodiment, the AD converter 21 can be corrected at an input point corresponding to the vicinity of a specific temperature, so that the temperature can be obtained more accurately in the vicinity of the specific temperature.
[0083] [Fourth embodiment] Next, a temperature measuring device 4 according to a fourth embodiment will be described. Fig. 11 is a diagram showing a circuit configuration of a temperature measuring device 4 according to the fourth embodiment of the present invention.
[0084] 11, the resistor circuit 10 of the temperature measuring device 4 has a thermistor 12 and a plurality of resistors 15a, 15b...15m with known resistance values. One end of the thermistor 12 and the plurality of resistors 15a, 15b...15m are connected to different general-purpose input / output terminals GPIO, GPIO1...GPIOM of the microcomputer 20, and the other ends of the thermistor 12 and the plurality of resistors 15a, 15b...15m are connected to a common input terminal Bin.
[0085] In addition, the general-purpose input / output terminal GPIO is connected to an input terminal Ain of the AD converter 21. The general-purpose input / output terminal GPIO1 is connected to an input terminal Cin1 of the AD converter 21. The general-purpose input / output terminal GPIO2 is connected to an input terminal Cin2 of the AD converter 21. The general-purpose input / output terminal GPIOM is connected to an input terminal CinM of the AD converter 21. A connection point 13 between the resistors 15a, 15b...15m and the thermistor 12 is connected to an input terminal Bin of the AD converter 21.
[0086] The temperature calculation unit 22 calculates the resistance value of thermistor 12 using the voltage of the input terminal Bin measured by the same AD converter 21 built into the microcomputer 20. At this time, the resistance value of thermistor 12 may be calculated by further using the voltages of the general-purpose input / output terminals GPIO, GPIO1, . . . GPIOM.
[0087] The temperature measuring device 4 of this embodiment can give different functions to the multiple resistors 15a, 15b, . . . 15m, each having a known resistance value, by appropriately setting the voltage state of the general-purpose input / output terminals GPIO, GPIO1, .
[0088] The resistance value of thermistor 12 changes significantly depending on the temperature, as shown in Figures 2A and 2B. Figure 16 shows the voltage Vraw when the value of the reference resistor for determining the temperature operating point of the thermistor in Figure 1 is set to the resistance value of thermistor 12 corresponding to 0°C, when it is set to the resistance value of thermistor 12 corresponding to 25°C, and when it is set to the resistance value of thermistor 12 corresponding to 60°C.
[0089] 16, when the reference resistance Rref is set to 100 kΩ, which is approximately equal to the resistance value of the thermistor 12 corresponding to 25° C., the output voltage Vraw changes greatly with temperature near 25° C., so the detection sensitivity of the AD converter is sufficiently high, whereas when the temperature exceeds 60° C. or falls below 0° C., the output voltage Vraw changes little with temperature, so the detection sensitivity of the AD converter is low. Thus, when the reference resistance Rref is constant, it is difficult to measure temperatures with high accuracy from low temperature range to high temperature range.
[0090] In the temperature measuring device 4 of the fourth embodiment, each of the multiple resistors 15a, 15b...15m can be used as a reference resistor for determining the temperature operating point of the thermistor, and can also be used as a correction resistor for obtaining information for correction of the AD converter 21.
[0091] <Application Example 1 of the Fourth Embodiment> Hereinafter, a detailed description will be given of a temperature measurement method in which each of a plurality of resistors 15a, 15b...15m with known resistance values is used as a reference resistor for determining the temperature operating point of a thermistor. Here, as shown in Fig. 12, an example will be described in which the number M of resistors 15 with known resistance values is two.
[0092] The resistance values of the two resistors 15a and 15b are selected to be approximately equal to the resistance values of the thermistor 12 corresponding to temperatures near those temperatures where high accuracy is particularly required, such as 25° C. and 0° C. In the case of the thermistor 12 having the characteristics shown in FIG. 2, the resistance values are 100 kΩ and 400 kΩ, respectively.
[0093] Here, the resistance value R1 of resistor 15a is set to 100 kΩ, which is approximately equal to the resistance value of thermistor 12 corresponding to 25° C., and the resistance value R2 of resistor 15b is set to 400 kΩ, which is approximately equal to the resistance value of thermistor 12 corresponding to 0° C.
[0094] The general-purpose input / output terminal GPIO is set to a "high level" state, the general-purpose input / output terminal GPIO1 is set to a "low level" state, the general-purpose input / output terminal GPIO2 is set to a "high impedance" state, the input terminal connected to the AD converter 21 is set to Ain, and the voltage Vgpio is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Bin and Cin1 to measure the voltage Vraw and the voltage Vgpio1 (corresponding to the voltage Vgnd).
[0095] As can be seen from FIG. 16, the voltage Vraw at this time is near the center of the measurement range of the AD converter 21 at around 25° C., and changes significantly with temperature. Therefore, the temperature can be determined more accurately at around 25° C.
[0096] Next, the general-purpose input / output terminal GPIO is set to a "high level" state, the general-purpose input / output terminal GPIO1 is set to a "high impedance" state, the general-purpose input / output terminal GPIO2 is set to a "low level" state, the input terminal connected to the AD converter 21 is set to Ain, and the voltage Vgpio is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Bin and Cin1 to measure the voltage Vraw and the voltage Vgpio2 (corresponding to the voltage Vgnd).
[0097] As can be seen from FIG. 16, the voltage Vraw at this time is near the center of the measurement range of the AD converter 21 near 0°C and changes significantly with temperature, so that the temperature can be determined more accurately near 0°C.
[0098] Similarly, if the reference resistance for determining the temperature operating point of the thermistor is set to 20 kΩ, which is approximately equal to the resistance value of thermistor 12 corresponding to 60°C, then voltage Vraw will be near the center of the measurement range of AD converter 21 at around 60°C, and its change with temperature will be large, making it possible to determine the temperature more accurately at around 60°C.
[0099] In this way, in the temperature measuring device 4 of the fourth embodiment, it is possible to switch between multiple reference resistors Rref depending on the measurement temperature range, making it possible to measure temperatures with high accuracy from low temperature ranges to high temperature ranges.
[0100] <Application Example 2 of the Fourth Embodiment> Next, a detailed description will be given of a method for measuring temperature when a configuration is adopted in which one reference resistor and multiple correction resistors are mixed for each of the multiple resistors 15a, 15b, ..., 15m whose resistance values are known. Here, as shown in Fig. 13, the description will be given taking as an example a case in which the number M of resistors 15 whose resistance values are known is three.
[0101] Here, the resistance value R1 of resistor 15a is set to 100 kΩ, which is approximately equal to the resistance value of thermistor 12 corresponding to 25° C. Resistor 15a is used as a reference resistor for determining the temperature operating point of the thermistor.
[0102] The resistance value R2 of the resistor 15b is set to R2=2×R1. The resistance value R3 of the resistor 15c is set to R3=R1 / 2. The resistors 15b and 15c are used as correction resistors for acquiring information for correction of the AD converter 21.
[0103] The general-purpose input / output terminal GPIO2 and the general-purpose input / output terminal GPIO3 are set to a "high impedance" state, the general-purpose input / output terminal GPIO1 is set to a "low level" state, the general-purpose input / output terminal GPIO is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may further be switched between Ain and Cin1 to measure the voltages Vgpio and Vgpio1 (corresponding to the voltage Vgnd).
[0104] Next, the general-purpose input / output terminal GPIO and the general-purpose input / output terminal GPIO3 are set to a "high impedance" state, the general-purpose input / output terminal GPIO1 is set to a "low level" state, the general-purpose input / output terminal GPIO2 is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Cin1 and Cin2 to measure the voltages Vgpio1 (corresponding to the voltage Vgnd) and Vgpio2.
[0105] Next, the general-purpose input / output terminal GPIO and the general-purpose input / output terminal GPIO2 are set to a "high impedance" state, the general-purpose input / output terminal GPIO1 is set to a "low level" state, the general-purpose input / output terminal GPIO3 is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Cin1 and Cin3 to measure the voltages Vgpio1 (corresponding to the voltage Vgnd) and Vgpio3.
[0106] By adopting this aspect, it is possible to correct the AD converter 21 in the same manner as in the temperature measuring device 2 of the second embodiment.
[0107] <Application Example 3 of the Fourth Embodiment> Next, a detailed description will be given of a method for measuring temperature when a configuration is adopted in which a plurality of reference resistors and a plurality of correction resistors are mixed for each of the plurality of resistors 15a, 15b, ..., 15m whose resistance values are known. Here, as shown in Fig. 14, a case will be described in which the number M of resistors 15 whose resistance values are known is four.
[0108] Here, resistors 15a and 15b are used as reference resistors for determining the temperature operating point of the thermistor, and resistors 15c and 15d are used as correction resistors for obtaining information for correction of AD converter 21.
[0109] The resistance values of the two resistors 15a and 15b are selected to be approximately equal to the resistance values of the thermistor 12 corresponding to temperatures near those temperatures where high accuracy is particularly required, such as 25° C. and 0° C. In the case of the thermistor 12 having the characteristics shown in FIG. 2, the resistance values are 100 kΩ and 400 kΩ, respectively.
[0110] Here, the resistance value R1 of resistor 15a is set to 100 kΩ, which is approximately equal to the resistance value of thermistor 12 corresponding to 25° C., and the resistance value R2 of resistor 15b is set to 400 kΩ, which is approximately equal to the resistance value of thermistor 12 corresponding to 0° C.
[0111] The general-purpose input / output terminal GPIO is set to a "high level" state, the general-purpose input / output terminal GPIO1 is set to a "low level" state, the general-purpose input / output terminals GPIO2, GPIO3, and GPIO4 are set to a "high impedance" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Ain and Cin1 to measure the voltage Vgpio and the voltage Vgpio1 (corresponding to the voltage Vgnd).
[0112] At this time, the voltage Vraw is near the center of the measurement range of the AD converter 21 at around 25°C, and changes significantly with temperature. Therefore, the temperature can be obtained more accurately at around 25°C.
[0113] Next, the general-purpose input / output terminal GPIO is set to a "high level" state, the general-purpose input / output terminals GPIO1, GPIO3, and GPIO4 are set to a "high impedance" state, the general-purpose input / output terminal GPIO2 is set to a "low level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Ain and Cin1 to measure the voltage Vgpio and the voltage Vgpio2 (corresponding to the voltage Vgnd).
[0114] At this time, the voltage Vraw is near the center of the measurement range of the AD converter 21 near 0°C and changes significantly with temperature, so that the temperature can be determined more accurately near 0°C.
[0115] The resistance value R3 of the resistor 15c is set to R3=R1, and the resistance value R4 of the resistor 15d is set to R4=2×R1.
[0116] The general-purpose input / output terminals GPIO, GPIO2, and GPIO4 are set to a "high impedance" state, the general-purpose input / output terminal GPIO1 is set to a "low level" state, the general-purpose input / output terminal GPIO3 is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Cin1 and Cin3 to measure the voltages Vgpio1 (corresponding to the voltage Vgnd) and Vgpio3.
[0117] Next, the general-purpose input / output terminals GPIO, GPIO2, and GPIO3 are set to a "high impedance" state, the general-purpose input / output terminal GPIO1 is set to a "low level" state, the general-purpose input / output terminal GPIO4 is set to a "high level" state, the input terminal connected to the AD converter 21 is set to Bin, and the voltage Vraw is measured. At this time, the input terminal connected to the AD converter 21 may also be switched between Cin1 and Cin4 to measure the voltage Vgpio1 (corresponding to the voltage Vgnd) and the voltage Vgpio4.
[0118] By adopting such an embodiment, the temperature is near the center of the measurement range of the AD converter 21 near the specific temperature, and the change with respect to temperature is large, so that the temperature can be calculated more accurately near the specific temperature. Also, the AD converter 21 can be corrected at an input point corresponding to the specific temperature, so that the temperature can be calculated more accurately near the specific temperature.
[0119] Therefore, it is possible to detect temperature with high accuracy from low temperature range to high temperature range without being affected by fluctuations in the power supply voltage, offset fluctuations of the AD converter 21, gain fluctuations, integral nonlinearity, and the like.
[0120] The resistors 15, each having a known resistance value, may be connected as shown in Fig. 15. Here, resistors 15a, 15b...15m are used as reference resistors for determining the temperature operating point of the thermistor. Resistors 15c, 15d...15n are used as correction resistors for acquiring information for correction of the AD converter 21.
[0121] Even in the connection relationship shown in FIG. 15, by arbitrarily changing the states of the general-purpose input / output terminals GPIO, GPIOA1, GPIOA2, ... GPIOAN and GPIOC1, GPIOC2, ... GPIOCM, it is possible to achieve both optimization of the temperature operating point of the thermistor using multiple reference resistors and correction of the AD converter 21.
[0122] In this embodiment, the "low level" state and the "high level" state of the general-purpose input / output terminals GPIO, GPIO1, GPIO2, . . . GPIOM may be reversed.
[0123] Also, in the above explanation, the voltages Vgpio, Vgpio1, Vgpio2, Vgpio3, and Vgpio4 are measured multiple times, but they may be measured only once.
[0124] Furthermore, if the values (high and low) of the voltage Vgpio in the same microcomputer can be considered to be substantially the same, the multi-point measurement of Vgpio by the AD converter 21 may be omitted.
[0125] Furthermore, when measuring temperature using the equation explained in the temperature measuring device 2 of the second embodiment, the measurement of Vgpio by the AD converter 21 may be omitted. [Explanation of symbols]
[0126] 1, 2, 2A, 3, 3A, 4, 4A, 4B, 4C, 4D temperature measuring device 10 Resistor circuit 11 Reference Resistor 12 Thermistor 13 Connection points 14a, 14b, 14n Compensation resistors 15, 15a, 15b, 15m resistance 20 Microcomputer 21 A / D converter 22 Temperature calculation section 23 Switch
Claims
1. a resistor circuit having a thermistor and a plurality of resistors with known resistance values; The AD converter built into the microcontroller a temperature calculation unit that calculates a temperature based on the resistance value of the thermistor, the microcomputer includes a plurality of general-purpose input / output terminals that are switchable between a first voltage state for supplying a set voltage and a second voltage state having a lower voltage than the first voltage state; one end of the thermistor and one end of the plurality of resistors are connected to different general-purpose input / output terminals of the microcomputer, the other ends of the thermistor and the plurality of resistors are connected to a common input terminal of the microcomputer; The temperature calculation unit calculates a resistance value of the thermistor using the voltage of the input terminal measured by the AD converter. Temperature measuring device.
2. The temperature calculation unit further calculates a resistance value of the thermistor using the voltages of the general-purpose input / output terminals measured by the AD converter. The temperature measuring device of claim 1 .
3. The resistor circuit includes at least one compensation resistor connected in parallel with the thermistor.
3. The temperature measuring device according to claim 1 or 2.
4. The resistance value of the compensation resistor is set to the resistance value of the thermistor corresponding to a specific temperature to be measured with high accuracy.
4. The temperature measuring device according to claim 3.
5. At least one of the general-purpose input / output terminals is at a fixed potential; The temperature calculation unit further calculates a resistance value of the thermistor using the voltage of the fixed potential.
3. The temperature measuring device according to claim 1 or 2.
Citation Information
Patent Citations
Thermistor temperature detection device using a / d converter
JP1993026741A
Temperature detector
JP2005274372A
