Patent Publication Number: US-2004041573-A1

Title: Method and circuit for measuring a voltage or a temperature and for generating a voltage with any predeterminable temperature dependence

Description:
[0001] The invention relates to a method and a circuit for measuring a voltage and/or a temperature and for generating a voltage with any predeterminable temperature dependence.  
       [0002] It is the object of the present invention to disclose a simple method for measuring a voltage and/or a temperature and for generating a voltage with any predeterminable temperature dependence, and a particularly simple circuit for implementing the method.  
       [0003] According to the invention, this object is met by a method comprising the following steps: determining a first forward voltage of a pn-transition of a semiconductor component, for example a diode, through which pn-transition a first current flows, and then determining a second forward voltage of the same pn-transition while a second current flows through it, with the magnitude of the two currents preferably differing by several powers of ten. Preferably, the two measurements are taken in immediate sequence so that the same measuring conditions are present at the time both readings are taken, i.e. that the temperature of the pn-transition is the same, and the supply voltage of the circuit used for implementing the method is constant. Subsequently, by means of a arithmetic circuit, a value which is proportional to the voltage to be measured is determined from the measured values and a parameter which characterises the pn-transition. This parameter is given by the relationship of temperature drifts in the forward voltages when the first and the second current are applied respectively.  
       [0004] This parameter can also be derived from the family of characteristics of the pn-transition.  
       [0005] Suitable proportionality factors are required for calculating the absolute value of the voltages to be measured. In order to determine the temperature, the arithmetic circuit needs to know the relationship between the temperature and the forward voltage of the pn-transition at least in the case of one current. This relationship is described by further parameters which characterise the pn-transition, which parameters can be determined from the family of characteristics of the pn-transition. From the temperature calculated, a voltage with a predetermined temperature dependence can be calculated. The desired temperature dependence is determined by further parameters or by a function.  
       [0006] A circuit according to the invention comprises an A/D converter, a controllable switch, a semiconductor component with a pn-transition, for example a diode, a voltage source, an arithmetic circuit and a control circuit for the controllable switch and the A/D converter. A current which is supplied by the voltage source and whose size can be switched between two values by the controllable switch can flow through the pn-transition. After each switch-over, the A/D converter scans the forward voltage which occurs at the pn-transition and supplies corresponding digital measured values. From the digital measured values and the parameters which characterise the pn-transition, the arithmetic circuit can calculate a value which is proportional to the forward voltage of the pn-transition, a value which is proportional to the supply voltage of the A/D converter, or if necessary, by means of suitable proportionality factors, said arithmetic circuit can also calculate their absolute value, as well as the temperature of the pn-transition. From the temperature, a voltage with any predeterminable temperature dependence can subsequently be calculated, and, if need be, issued in analog or digital form. Preferably, the parameters and the proportionality factors are stored in the arithmetic circuit. The relationship between the forward voltage of the pn-transition at the selected current and the temperature of the pn-transition, which relationship is required to determine the temperature, as well as the desired temperature dependence of the voltage to be generated, are stored in a way which is known per se, for example in a table or as a formula, also preferably in the arithmetic circuit or in a memory which the arithmetic circuit can access.  
       [0007] With the method or circuit according to the invention, a temperature-dependent voltage U (T)  can be generated whose temperature dependence can be set. Such a voltage can for example be used for controlling the discharging/charging process of an accumulator. However, the method or the circuit according to the invention can also be used to measure the battery voltage or accumulator voltage and/or temperature of a battery-operated or accumulator-operated device. In devices which comprise a microcontroller, the invention provides a special advantage in that these measurements can also be carried out using a microcontroller which comprises neither a reference voltage connection nor an internal circuit for generating a temperature-compensated reference voltage, and which is thus particularly economical. 
     
    
    
     [0008] Below, the invention is explained by means of embodiments of circuits according to the invention, and the determination of the parameters required in the method according to the invention is described by means of a family of characteristics. The following are shown:  
     [0009]FIG. 1 a diagrammatic view of a first circuit according to the invention;  
     [0010]FIG. 2 a diagrammatic view of a second circuit according to the invention;  
     [0011]FIG. 3 a family of characteristics of a pn-transition of a semiconductor component; and  
     [0012]FIG. 4 another view of the family of characteristics according to FIG. 3. 
    
    
     [0013] The circuit according to the invention, shown in FIG. 1, comprises an A/D converter W which is supplied by a voltage U O  from a voltage source, said voltage being related to the mass. The input of the A/D converter W is connected to mass via a pn-transition, which is switched in the direction of flow, of a semiconductor component, with said semiconductor component being a diode D. A further voltage source with the voltage U 1  is connected, via a first and a second resistor R 1 , R 2  and via a controllable switch S and the second resistor R 2 , to the input of the A/D converter W. When the switch S is open, a first current I 1  can flow via the first and second resistor R 1 , R 2 , and when the switch S is closed, a second current  12  can flow via the switch S and the second resistor R 2  through the diode D. The controllable switch S can be controlled by a clock pulse signal generated by a control circuit T, with said clock pulse signal also being fed to the A/D converter W. The output of the A/D converter W is connected to an arithmetic circuit R which can comprise an analog and/or a digital output at which the desired voltage can be tapped off or to which a display device (not shown in the Figure) can be connected. The controllable switch S, the control circuit T, the arithmetic circuit R and the A/D converter W are preferably integrated in a microcontroller M. With this circuit, a first forward voltage of the diode D can be measured, while with the switch S open, a first current I 1  flows through it, and a second forward voltage of the same diode D can be measured, while with the switch S closed, a second current I 2  flows through it, with the magnitude of the two currents I 1 , I 2  preferably differing by several powers of ten. The voltages U 1 , U 0  of the voltage sources, and the resistors R 1 , R 2  are dimensioned such that on the one hand the desired currents I 1  and I 2  result, and on the other hand the voltage at the input of the A/D converter W never exceeds its supply voltage U 0 .  
     [0014] In a variant of the circuit according to the invention, shown in FIG. 1, the voltages U 1 , U 0  of the two voltage sources are the same, i.e. instead of two voltage sources there is only one. In this case, the resolution of the A/D converter must be higher, if the same measuring accuracy is to be achieved as is the case with a circuit comprising two voltage sources.  
     [0015] In order to generate a voltage with any predeterminable temperature dependence according to the invention, first the desired temperature dependence is programmed as a function into the circuit or stored as a table in a memory. Preferably, the parameters are also stored in the same place, said parameters describing the characteristics of the pn-transition used. The determination of said characteristics is explained below by means of the family of characteristics of a pn-transition, shown in FIG. 3. Said family of characteristics reflects the relationship between the forward voltage of the pn-transition and the current flowing through the pn-transition at various temperatures of the pn-transition in semi-logarithmic representation. In this representation, the above-mentioned relationship is linear over a large area.  
     [0016] From the linear area of the family of characteristics, for two differently selected currents I 1 , I 2  at two differently selected temperatures T1, T2, a forward voltage each, U (I,T) , i.e. a total of four forward voltages U (I1,T1) , U (I1,T2) , U (I2,T1) , U (I2,T2)  are taken. As can be seen from the family of characteristics, the temperature drifts ΔU of the forward voltages  
     Δ U   (I1)   =U   (I1,T2)   −U   (I1,T1)  and  
     Δ U   (I2)   =U   (I2,T2)   −U   (I2,T1)   (1)  
     [0017] differ in the selected currents I 1 , I 2  and temperatures T1, T2 by a temperature-independent factor n, which represents a first parameter characterising the pn-transition:  
       n=ΔU   (I1)   |ΔU   (I2)   (2)  
     [0018] By inserting (1) and transforming (2) we arrive at  
       n*U   (I2,T2)   −U   (I1,T2)   =n*U   (I2,T1)   −U   (I1,T1)   =k   (3)  
     [0019] wherein k is a temperature-independent constant which represents a second parameter that characterises the pn-transition. As can be seen from the family of characteristics, the parameters n and k do not depend on whether, through the diode D of the circuit according to the invention, instead of the selected currents I 1 , I 2 , for example due to a fluctuating supply voltage, currents flow which are smaller or larger by a particular factor, than are the selected currents I 1 , I 2 . However, n and k do depend on the relationship  11 / 12 . Families of characteristics of other semiconductor components, for example of a pn-transition of a transistor, can be evaluated in the same way.  
     [0020] With the parameter n, the circuit can determine a value which is proportional to the supply voltage U 0  of the A/D converter at any temperature of the pn-transition, or it can determine a value which is proportional to the temperature of the pn-transition at any supply voltage U 0 . If in addition, a particular temperature function is entered in the arithmetic circuit, it can calculate a voltage with the respective temperature dependence and if required issue it at one of its outputs in analog or digital form.  
     [0021] First, determination of the supply voltage U 0  with the circuit shown in FIG. 1 is explained. At its output, the A/D converter supplies a measured value M (T)  if a voltage U (T)  is present at its input (provided no overflow of the A/D converter occurs):  
       M   (T)   =M   max   *U   (T)   /U   0   (4)  
     [0022] wherein U 0  is the supply voltage of the A/D converter and M max  is the largest value which can be represented by the A/D converter. Analogously, the following applies to the input voltages U (I1,T) , U (I2,T)  and the corresponding measured values M1 (T) , M2 (T) :  
       U   (I1,T)   =M 1 (T)   *U   0   /M   max  and U (I2,T)   =M 2 (T)   *U   0   /M   max   (5)  
     [0023] If (5) is inserted in (3), the following results:  
       n*M 2 (T)   *U   0   /M   max   −M 1 (T)   *U   0   /M   max   =k , or  
       U   0   =k*M   max /( n*M 2 (T)   −M 1 (T) )  (6)  
     [0024] Equation (6) states that the supply voltage U 0  of the value l/(n*M2 (T) −M1 (T) ) determined from the measured values M1, M2 is proportional to k*M max  as a proportionality factor. Determination of U 0  is independent of the temperature of the pn-transition, because k/(n*M2 (T) −M1 (T) ) is temperature-independent (compare equation 3).  
     [0025] Below, determination of the temperature T of the pn-transition with the circuit shown in FIG. 1 is explained. If (6) is inserted in (4), we arrive at  
       U   (T)   =k*M   (T) /( n*M 2 (T)   −M 1 (T) )  (7)  
     [0026] wherein the temperature dependence of the voltage U (T)  is defined by the characteristics of the pn-transition, as shown in FIG. 4. According to FIG. 4, the relationship between the temperature T and the forward voltage U (I,T)  of the pn-transition is largely linear, i.e. in the linear area of the family of characteristics, the forward voltages U (I1,T)  and U (I2,T)  are proportional to the temperature T. Thus, after inserting (6) in (5), the following results:  
       U   (I1,T)   =k*M 1 (T) /( n*M 2 (T)   −M 1 (T) )= a   1   *T+b   1    
     [0027] and  
       U   (I2,T)   =k*M 2 (T) /( n*M 2 (T)   −M 1 (T) )= a   2   *T+b   2   (8)  
     [0028] or  
       U   (I2)   /a   2   −b   2   /a   2   =T   (U)   =U   (I1)   /a   1   −b   1   /a   1   (9)  
     [0029] The parameters a 1 , b 1  or a 2 , b 2  can be determined from the family of characteristics of the pn-transition; preferably they are stored, together with parameters n and k, in the arithmetic circuit or in a memory to which the arithmetic circuit has access. Thus, in order to determine the absolute value of the temperature T of the pn-transition, the forward voltage U (I1,T)  or U (I2,T)  is measured using the method according to the invention, and subsequently the temperature T is calculated. Determining the temperature T is independent of the size of the supply voltage U 0 .  
     [0030] In order to generate a voltage U (T) , which can have any temperature dependence, the desired temperature dependence of the voltage must be programmed for example as a function U (T)  in the arithmetic circuit or it must be stored as a table in a memory to which the arithmetic circuit has access. Preferably, the table or programming can be changed as desired by way of an input device. After the temperature has been determined by means of equation (9), the voltage U (T)  with the corresponding temperature dependence can be calculated by the arithmetic circuit and can be output in analog or digital form.  
     [0031] If for example a voltage U (T) =a*T+b with defined parameters a, b is to be generated, then for example at first at temperature T′, the forward voltage U (I2,T′)  is determined according to equation (8). The desired voltage U (T′)  then results from equation (9) as follows:  
     
       U 
       (T′) 
       =U 
       (I2, T′) 
       *a/a 
       2 
       −b 
       2 
       *a/a 
       2 
       +b.  
     
     [0032] The circuit according to the invention, shown in FIG. 2, mainly differs from the circuit described with reference to FIG. 1 in that the input of the A/D converter W via diode D is not connected to mass but to the voltage source U 1 , and in that the input of the A/D converter W via the first and second resistor R 1 , R 2  and the controllable switch S is not connected to the voltage source but instead, is connected to mass. However, the first and second resistor R 1 , R 2  are not connected in series, instead, the second resistor R 2  is connected in series with the controllable switch S. The first resistor R 1  is situated parallel to this. Thus, when the switch S is open, the first current I 1  flows via the first resistor R 1 , while when the switch S is closed, the second current  12  flows via both resistors R 1 , R 2  and the switch S through diode D. Furthermore, only one voltage source U 1  exists which provides the supply voltage U 0  of the A/D converter via a voltage divider which is formed from a third and fourth resistor R 3 , R 4 .  
     [0033] In a variant of the circuit according to the invention, shown in FIG. 2, there are no third and fourth resistors R 3 , R 4 , i.e. the A/D converter is positioned between the voltage source U 1  and the mass. In this case, the resolution of the A/D converter must be higher, if the same measuring accuracy as that in the circuit according to the invention, shown in FIG. 2, is to be attained.  
     [0034] Calculation of the supply voltage U 0 , to be measured with the circuit shown in FIG. 2, of the A/D converter W and/or of the temperature T of the diode D is explained below. At its output, the A/D converter W delivers a measured value M if the voltage U drops at diode D, and thus, if at the input of the A/D converter W a voltage U 0 −U is present (provided the forward voltage U of diode D never exceeds the supply voltage U 0  of the A/D converter)  
       M=M   max *( U   0   −U )/ U   0   (4′)  
     [0035] wherein U 0  is the supply voltage of the A/D converter and M max  is the largest value which can be represented by the A/D converter. Analogously, the following applies to the input voltages U (I1) , U (I2)  and the corresponding measured values M1, M2:  
       U   (I1)   =U   0   −M 1 *U   0   /M   max  and  
       U   (I2)   =U   0   −M 2 *U   0   /M   max   (5′)  
     [0036] If (5′) is inserted in (3), the following results:  
       U   0   =k*M   max /( n ( M   max   −M 2)−( M   max   −M 1))  (6′)  
     [0037] If (6′) is inserted in (5′), the following applies to the forward voltages U (I1)  and U (I2)  with current I 1  and I 2  respectively:  
       U   (I1)   =k* ( M   max   −M 1)/( n ( M   max   −M 2)−( M   max   −M 1))  
     [0038] and  
       U   (I2)   =k *( M   max   −M 2)/( n ( M   max   −M 2)−( M   max   −M 1))  (8′)  
     [0039] A comparison of the relationships (6′), (8′) with the relationships (6), (8) shows that, with the circuit according to FIG. 2, calculation of the voltages to be measured takes place in exactly the same way as with the circuit according to FIG. 1, except that the measured values M1, M2 are to be replaced by (M max −M1) or (M max −M2) respectively.