Circuit for measuring discharging and charging current of a battery providing offset/drift voltage for correcting amplifier output
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a current measuring circuit for measuring discharging current and charging current of a battery, which is selectively connected to a load such as an electronic apparatus or the like and a battery charger. 
     2. Description of the Related Art 
     Mobile terminals such as portable telephone sets are generally driven by a battery. Therefore, it is desirable to constantly measure the charged condition of the battery and to charge the battery when the residual capacity of the battery decreases. In a battery such as a nickel-cadmium battery, the voltage does not decrease significantly but the discharging current decreases remarkably when the residual capacity decreases. Accordingly, residual capacity meters adapted to detect the discharging current of a battery to thereby measure the residual capacity of the battery have been in wide use. For example, a discharging current measuring circuit of the prior art is disclosed for example in Japanese Laid-open Patent Publication No. 59-145485. In this reference, a resistor is connected to the positive terminal of a battery and a voltage is directly measured across the resistor through an A/D converter. With such a current measuring circuit, the current value I can be obtained by substituting the potential difference V across the resistor having the resistance value R in Ohm&#39;s law I=V/R. 
     In the prior art current measuring circuit, the discharging current of the battery is restrained by the inserted resistor, and therefore, there have been problems with such prior art current measuring circuits. These prior art current measuring circuits are not suitable for measuring the discharging current of a battery supplying a large current and are unable to measure a wide range of currents. 
     There is also known such a type of current measuring circuit, which is adapted such that the potential difference across a resistor for current detection is amplified by a differential amplifier before being output to an A/D converter. However, in correctly measuring the discharging current of a battery, an operational amplifier of an expensive low offset/low drift voltage type must be used in the differential amplifier. Hence, there has been a problem with this type in that the current measuring circuit incurs an increase in cost. 
     SUMMARY OF THE INVENTION 
     Accordingly, an object of the present invention is to provide a current measuring circuit capable of measuring battery discharging current and charging current over a wide range from a small current to a large current. 
     Another object of the present invention is to provide a current measuring circuit capable of correctly measuring the battery discharging current and charging current with an economical structure, which does not require the use of expensive parts. 
     In accordance with an aspect of the present invention, there is provided a current measuring circuit for measuring discharging current and charging current of a battery comprising a first battery, which is selectively connected to a load and a charger; a resistor connected in series with the first battery and having a sufficiently low resistance value as not to substantially restrain the output current from the first battery; and a first differential amplifier for amplifying a potential difference across the resistor, the first differential amplifier comprising a first operational amplifier, a first resistor connected between one end of the resistor and one input terminal of the first operational amplifier, a second resistor connected between the one input terminal and the output terminal of the first operational amplifier, a third resistor connected between the other end of the resistor and the other input terminal of the first operational amplifier, and a fourth resistor connected between the other input terminal of the first operational amplifier and ground, wherein the resistance value of the first resistor is set equal to the resistance value of the third resistor and the resistance value of the second resistor is set equal to the resistance value of the fourth resistor. 
     Preferably, the current measuring circuit is provided with a short-circuiting means for short-circuiting the one input terminal and the other input terminal of the first operational amplifier, so that the output voltage of the first operational amplifier in such short-circuited state, i.e., the offset/drift voltage of the operational amplifier, is obtained. By using this offset/drift voltage for correcting the output voltage from the first operational amplifier at the time of current measurement, it becomes possible to attain accurate measurement of the discharging current and charging current of the battery without using an expensive operational amplifier of a low offset/low drift type. 
     Preferably, the current measuring circuit is provided with a fifth resistor connected in parallel with the second resistor, a first switch connected in series with the fifth resistor and in parallel with the second resistor, a sixth resistor connected in parallel with the fourth resistor, and a second switch connected in series with the sixth resistor and in parallel with the fourth resistor. Then, by closing the first and second switches, the gain of the first operational amplifier can be decreased and, hence, the amplification factor of the first differential amplifier can be made smaller. By switching the gains of the operational amplifier as described above, it becomes possible to achieve measurement of a wide range of currents from a small current to a large current. 
     The above and other objects, features and advantages of the present invention and the manner of realizing them will become more apparent, and the invention itself will best be understood from a study of the following description and appended claims with reference to the attached drawings showing some preferred embodiments of the invention. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a first embodiment of the present invention; 
     FIG. 2 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a second embodiment of the present invention; 
     FIG. 3 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a third embodiment of the present invention; 
     FIG. 4 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a fourth embodiment of the present invention; 
     FIG. 5 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a fifth embodiment of the present invention; 
     FIG. 6 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a sixth embodiment of the present invention; 
     FIG. 7 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a seventh embodiment of the present invention; 
     FIG. 8 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to an eighth embodiment of the present invention; 
     FIG. 9 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a ninth embodiment of the present invention; 
     FIG. 10 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a tenth embodiment of the present invention; 
     FIG. 11 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to an eleventh embodiment of the present invention; and 
     FIG. 12 is a circuit diagram of a current measuring circuit for measuring battery discharging/charging current according to a twelfth embodiment of the present invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     Embodiments of the present invention will be described below in detail with reference to the accompanying drawings. 
     Referring first to FIG. 1, a current measuring circuit of a first embodiment of the present invention will be described. Reference numeral 10 denotes a rechargeable battery such as a nickel-cadmium battery. By connecting a switch 22 to the side of a load 20 such as a portable telephone set, the load 20 comes to be driven by the battery 10. When the switch 22 is connected to the side of a battery charger 21, the battery 10 is charged. 
     On the positive electrode side of the battery 10, there is connected a resistor R A  in series with the battery. The resistor R A  has a sufficiently low resistance value as not to virtually restrain the output current from the battery. Preferably, the resistance value of the resistor R A  is set below 0.1Ω. 
     When the switch 22 is connected to the side of the load 20 and the load is driven by the battery 10, a current I 1  flows in the direction of the arrow Y1 (discharging direction). On the other hand, when the switch 22 is connected to the side of the charger 21, the current I 1  flows in the direction of the arrow Y2 (charging direction) and the battery 10 is thereby charged. As the current I 1  flowing out of the battery 10 or flowing into the battery 10 flows through the resistor R A , there is generated a very small potential difference V 3  across the resistor R A  and this potential difference V 3  is applied to both inputs of a differential amplifier 1a. 
     The differential amplifier 1a comprises an operational amplifier 2. A first resistor R 1  is connected between one input terminal (the inverting input terminal `-` in FIG. 1) of the operational amplifier 2 and one end of the resistor R A . A second resistor R 2  is connected between the inverting input terminal `-` and the output terminal of the operational amplifier 2. A third resistor R 3  is connected between the other input terminal (the noninverting input terminal `+` in FIG. 1) of the operational amplifier 2 and the other end of the resistor R A . A fourth resistor R 4  is connected between the noninverting input terminal `+` of the operational amplifier 2 and ground 3. 
     When the resistance values of the first to fourth resistors R 1  to R 4  are set to R 1  =R 3  and R 2  =R 4  in the arrangement of the differential amplifier 1a as described above, the gain of the operational amplifier 2 equals R 2  /R 1  and this becomes the amplification factor of the differential amplifier 1a. Accordingly, by setting the resistance values of the resistors R 1  to R 4  at will under the conditions of R 1=R   3  and R 2  =R 4 , the amplification factor of the differential amplifier 1a can be set as desired. 
     The differential amplifier 1a amplifies the voltage V 3  applied thereto by the amplification factor R 2  /R 1  and outputs the amplified voltage from its output terminal 12 as a voltage V 0 . The output voltage V 0  becomes a positive or a negative voltage depending on the direction of the current with respect to the battery 10. The voltage V 0  becomes positive when the current flows out of the battery 10 in the discharging direction (in the direction of the arrow Y1) and becomes negative when the current flows in the charging direction (in the direction of the arrow Y2). 
     Thus, by measuring the voltage V 0  with a measuring apparatus, the discharging current or charging current of the battery 10 can be measured. However, since the output voltage V 0  becomes positive or negative, it is required to apply a bias voltage to the A/D converter circuit in the measuring apparatus for determining the positive or negative polarity of the voltage V 0 . 
     In the case of the circuit configuration shown in FIG. 1, operating power-supply voltages are applied to the positive power-supply terminal 13 and the negative power-supply terminal 14 of the operational amplifier 2. As the positive power-supply voltage, a positive voltage higher than the sum of the voltage of the battery 10 and the voltage of the potential difference V 3  is required, and as the negative power-supply voltage, a negative voltage lower than -V 3  is required. Accordingly, the positive power-supply terminal 13 is connected with a positive power supply, not shown, to supply such a positive voltage and the negative power-supply terminal 14 is connected with a negative power supply, not shown, to supply such a negative voltage. 
     When the load 20 such as a portable telephone set or the like is driven by the battery 10, the current I 1  flows in the direction of the arrow Y1 and thereby a very small potential difference V 3  is produced across the resistor R A . The very small potential difference V 3  is multiplied in the differential amplifier 1a by the amplification factor R 2  /R 1  and output from the output terminal 12 as the voltage V 0 . Then, the discharging current I 1  of the battery 10 can be measured by measuring the output voltage V 0 . As the battery 10 is used up, the discharging current I 1  decreases, and therefore, by observing the discharging current, the timing for charging the battery 10 can be determined. When the battery 10 is used up, the switch 22 is connected to the side of the charger 21 and the battery 10 is charged. When the battery 10 is sufficiently charged, the charging current I 1  decreases and, hence, the output voltage V 0  of the differential amplifier 1a lowers. Therefore, the timing at which the battery 10 is fully charged can be determined by observing the output voltage V 0 . 
     Referring to FIG. 2, there is shown a current measuring circuit of a second embodiment of the present invention. The current measuring circuit in this embodiment is composed of two sets of the differential amplifiers 1a shown in FIG. 1. In order to distinguish between the two differential amplifiers, a single prime (&#39;) is attached to reference numerals of one differential amplifier. 
     The current measuring circuit of the second embodiment is arranged by interconnecting differential amplifiers 1a and 1a&#39;. One end of the resistor R 1  of the differential amplifier 1a is connected with one end of the resistor R 3  &#39; of the differential amplifier 1a&#39;, while one end of the resistor R 3  is connected with one end of the resistor R 1  &#39;. Further, the negative power-supply terminals 14 and 14&#39; of the operational amplifiers 2 and 2&#39; are connected with ground 3. 
     In the described arrangement, when the discharging current I 1  of the battery 10 flows through the resistor R A , a very small potential difference V 3  is generated across the resistor R A  and the voltage V 3  of the potential difference is applied between both the input terminals of the differential amplifiers 1a and 1a&#39;. The voltage V 3  is amplified by the factor R 2  /R 1  in the differential amplifier 1a and a positive voltage V 01  is output from the output terminal 12. At this time, the output voltage V 02  of the differential amplifier 1a&#39; becomes 0 volt. 
     On the other hand, when the battery 10 is charged by the charger 21, the voltage V 3  of the potential difference due to the charging current I 1  is generated across the resistor R A , and the voltage V 3  of the potential difference is applied between both the input terminals of the differential amplifiers 1a and 1a&#39;. At this time, the output voltage V 01  of the differential amplifier 1a becomes 0 volt, while in the differential amplifier 1a&#39;, the voltage V 3  of the potential difference is amplified by the factor R 2  &#39;/R 1  &#39; and this voltage is output from the output terminal 12&#39; as a positive voltage V 02 . Thus, according to the present embodiment, regardless of whether the current flows in the discharging direction or in charging direction, the output voltage can be measured as a positive voltage. Hence, it becomes unnecessary to distinguish between positive and negative voltages as in the above described first embodiment. Therefore, by measuring the positive voltage V 01  or V 02  with a measuring apparatus, the discharging current or charging current of the battery 10 can be measured. Since measurement of only positive voltage is made in the present embodiment, negative power supplies as the operating power supplies for the operational amplifiers 2 and 2&#39; are not required. That is, the negative power-supply voltage can be 0 V. Therefore, the negative power-supply terminals 14 and 14&#39; of the operational amplifiers 2 and 2&#39; can be connected to ground 3 as described above. Thus, the negative power supply can be eliminated and, hence, the power supply circuit can be simplified. 
     Referring to FIG. 3, there is shown a current measuring circuit of a third embodiment of the present invention. In this third embodiment, the battery 10 in the first and second embodiments is divided into two batteries 15 and 16 and the resistor R A  is connected between the batteries 15 and 16 in series with them. The positive power-supply terminal 13 is connected with the positive side of the battery 16. 
     As a current I 2  flowing out of or into the batteries 15 and 16 flows through the resistor R A , a very small potential difference V 4  is generated across the resistor R A . The potential difference V 4  is amplified by the differential amplifier 1a to be output therefrom as a positive or negative voltage V 03 . As mentioned herein-above, the positive power-supply voltage as the operating power supply for the operational amplifier 2 is only required to be a voltage higher than the sum of the voltage of the battery 15 and the voltage of the potential difference V 4 . Therefore, as shown in FIG. 3, the positive power-supply terminal 13 can be connected to the positive side of the battery 16 to thereby utilize the battery voltage. Thus, in the present embodiment, a separate positive power supply can be eliminated and, hence, the power supply circuit can be simplified. 
     Referring to FIG. 4, there is shown a current measuring circuit of a fourth embodiment of the present invention. The current measuring circuit of this embodiment is arranged by adding a differential amplifier 1a&#39; to the current measuring circuit shown in FIG. 3. More specifically, one end of a resistor R 3  &#39; of the differential amplifier 1a&#39; is connected to one end of the resistor R 1  of the differential amplifier 1a and one end of a resistor R 1  &#39; is connected to one end of the resistor R 3 , and a positive power-supply terminal 13&#39; of an operational amplifier 2&#39; is connected to the positive side of the battery 16 the same as the positive power-supply terminal 13 of the operational amplifier 2. 
     The operation of the current measuring circuit of the present embodiment is the same as in the second embodiment shown in FIG. 2. A positive output voltage V 04  is output from the output terminal 12 of the differential amplifier 1a when a discharging current flows out of the batteries 15 and 16, while a positive output voltage V 05  is output from the output terminal 12&#39; of the differential amplifier 1a&#39; when the batteries 15 and 16 are charged by the charger 21. 
     Therefore, the current flowing in either the discharging direction or the charging direction can be measured as a positive voltage. Thus, the negative power-supply voltages for the operational amplifiers 2 and 2&#39; can be 0 V and, hence, the negative power-supply terminals 14 and 14&#39; can be connected to ground to eliminate the negative power supply. Further, since voltages of the batteries 15 and 16 can be utilized as the positive power supplies for the operational amplifiers 2 and 2&#39;, no positive and negative power-supply apparatuses are required to be additionally provided for driving the operational amplifiers 2 and 2&#39;. 
     Referring to FIG. 5, there is shown a current measuring circuit of a fifth embodiment of the present invention. The differential amplifier 1b in this embodiment is arranged by adding a fifth resistor R 5  and a sixth resistor R 6  to the differential amplifier 1a shown in FIG. 1. More specifically, the fifth resistor R 5  is connected in parallel with the second resistor R 2  through a first switch 4, and the sixth resistor R 6  is connected in parallel with the fourth resistor R 4  through a second switch 5. Further, the first and second switches 4 and 5 are adapted to be turned on/off responding to a first control signal 6 output from a control means. When the first and second switches 4 and 5 are turned on responding to the first control signal 6 as indicated by the respective broken lines, the resistance value determining the gain of the operational amplifier 2 becomes {R 2  ·R 5  /(R 2  +R 5 )}/R 1 , which is smaller than the resistance value determining the gain R 2  /R 1  in the previous state. Thus, the gain of the operational amplifier 2 can be decreased and, hence, the amplification factor of the differential amplifier 1b can be made smaller. 
     Accordingly, even when the current flowing through the resistor R A  is a large current, it becomes possible, by turning on the first and second switches 4 and 5, to output the potential difference generated across the resistor R A  after amplifying the same by a smaller amplification factor adjusted according to the magnitude of the large current. Thus, it becomes possible to bring the output voltage V 0  of the differential amplifier 1b to such a suitable voltage value as can be measured by a measuring means. That is, according to the present embodiment, currents widely ranging from a large current to a small current can be measured by switching the first and second switches. 
     The above described advantage of measuring a wide range of current can be equally obtained by a sixth embodiment, a seventh embodiment and an eighth embodiment shown in FIGS. 6,7 and 8, respectively. The sixth embodiment shown in FIG. 6 is improved, in comparison with the second embodiment shown in FIG. 2, because the sixth embodiment substitutes differential amplifiers 1b and 1b&#39; in place of the differential amplifiers 1a and 1a&#39; in the second embodiment. The seventh embodiment shown in FIG. 7 is improved, in comparison with the third embodiment shown in FIG. 3, because the seventh embodiment substitutes a differential amplifier 1b in place of the differential amplifier 1a in the third embodiment. Further, the eight embodiment shown in FIG. 8 is improved, in comparison with the fourth embodiment shown in FIG. 4, because the eighth embodiment substitutes differential amplifiers 1b and 1b&#39; in place of the differential amplifiers 1a and 1a&#39; in the fourth embodiment. 
     Since the sixth to eighth embodiments can easily change the amplification factors of the differential amplifiers, they can make measurements of a wide range of currents. Operations and other advantages of the sixth to eighth embodiments are equal to those of the second to fourth embodiments shown in FIGS. 2 to 4, respectively. 
     Referring now to FIG. 9, a current measuring circuit of a ninth embodiment of the present invention will be described. The current measuring circuit of this embodiment is arranged by using a third switch 8 and a fourth switch 9 in addition to the components making up the fifth embodiment. 
     More specifically, there is provided the third switch 8 which, responding to a second control signal 7, either connects one input terminal of the differential amplifier 1b (one end of the first resistor R 1  in FIG. 9) and one end of the resistor R A  or isolates that input terminal of the differential amplifier 1b and that end of the resistor R A  and, in addition, short-circuits that input terminal and the other input terminal of the differential amplifier 1b (one end of the third resistor R 3  in FIG. 9). Further, there is provided the fourth switch 9, which similarly responding to the second control signal 7, either connects the other input terminal of the differential amplifier 1b and the other end of the resistor R A  or isolates them. 
     With the third and fourth switches 8 and 9 provided as described above, if both the input terminals of the operational amplifier 2 are short-circuited, an offset/drift voltage V 0  &#39; is output from the operational amplifier 2. By correcting the voltage V 0  output from the differential amplifier 1b using the offset/drift voltage V 0  &#39;, the discharging and charging current measurements of the battery 10 can be performed more accurately. 
     At the time of the measurement, the third switch 8 and the fourth switch 9 are switched to the sides indicated by the broken lines. Thereby, the resistor R A  is isolated from the resistor R 1  and the inverting input terminal (-) and the non-inverting input terminal (+) are short-circuited through the resistors R 1  and R 3  and, hence, the potential difference between both the input terminals becomes zero. The offset/drift voltage V 0  &#39; output from the operational amplifier 2 when both its input terminals are short-circuited is measured by and stored in a processing unit through an A/D converter circuit. 
     Then, the third and fourth switches 8 and 9 are switched to the sides indicated by the solid lines and the output voltage V 0  of the operational amplifier 2 at this time is measured by the processing unit through the A/D converter circuit, and the difference between the thus measured voltage V 0  and the earlier stored voltage V 0  &#39; is obtained. This difference provides a proper current value after correction. 
     By correcting the output voltage of the operational amplifier at the time of current measurement using the offset/drift voltage, a highly accurate current measuring circuit can be provided economically, without using an expensive operational amplifier of a low offset/low drift voltage type. Further, an advantage is obtained in that power consumption in the current measuring circuit can be reduced by turning off the fourth switch 9 thereby isolating the other input terminal of the differential amplifier 1b from the other end of the resistor R A  and cutting off the useless current flowing through the resistors R 3  and R 4  when the current measurement is not performed. 
     The above described two advantages obtained in the ninth embodiment are similarly obtained by a tenth to a twelfth embodiment shown in FIGS. 10-12. The tenth embodiment shown in FIG. 10 has the arrangement of the sixth embodiment shown in FIG. 6 with a third switch 8 and a fourth switch 9 added thereto. In the tenth embodiment, the third switch 8 and the fourth switch 9 are switched responding to a second control signal 7 to the side indicated by the broken lines, and an offset/drift voltage V 01  &#39; or V 02  &#39; then output from the differential amplifier 1b or 1b&#39; is measured by and stored in a processing unit through an A/D converter circuit. Then, the third and fourth switches 8 and 9 are switched to the side indicated by the solid lines. The output voltage V 01  or V 02  at this time is measured by the processing unit through the A/D converter circuit and the difference between the thus measured voltage V 01  or V 02  and the earlier stored voltage V 01  &#39; or V 02  &#39; is obtained. 
     Thus, highly accurate measurement of the discharging current or charging current of the battery 10 can be achieved and, further, power consumption in the current measuring circuit when no current is measured can be reduced by turning off the fourth switch 9. 
     FIG. 11 shows the eleventh embodiment of the present invention. This embodiment has the arrangement of the seventh embodiment shown in FIG. 7 with a third switch 8 and a fourth switch 9 added thereto. Also in this embodiment, an offset/drift voltage V 03  &#39; is similarly measured and stored. Then, the output voltage V 03  of the differential amplifier 1b is measured and the difference between this measured voltage V 03  and the earlier stored voltage V 03  &#39; is obtained. Thereby, highly accurate measurement of the discharging current or charging current can be achieved. Further, by turning off the fourth switch 9 when the current I 2  is not measured, power consumption in the current measuring circuit can be reduced. 
     FIG. 12 shows the twelfth embodiment of the present invention. This embodiment has the arrangement of the eighth embodiment shown in FIG. 8 with a third switch 8 and a fourth switch 9 added thereto. Also in this embodiment, an offset/drift voltage V 04  &#39; is V 05  &#39; is similarly measured and stored. Then output voltage V 04  or V 05  of the differential amplifier 1b or 1b&#39; is measured and the difference between this measured output voltage V 04  or V 05  and the earlier stored voltage V 04  &#39; or V 05  &#39;  is obtained. Thereby, highly accurate measurement of the discharging current or charging current can be achieved. Further, power consumption in the current measuring circuit when no current is measured can be reduced by turning off the fourth switch