Background of the Invention
This invention relates to a method and apparatus for testing batteries, and is more in particular directed to a method and apparatus enabling the testing by a computer, e.g. a microcomputer, of a battery supply for the computer.
Batteries, such as battery packs, are frequently employed to power computers, especially portable computers. While the batteries may have sufficient energy to guarantee a determined service life of, for example, six months, experience has shown that the batteries can, in fact, last much longer in some computers, where the use of the computer is low, than in other computers having normal usage.
It is therefore desirable to be able to determine the condition of a battery for a computer readily and accurately, without removing the battery from the computer, in order to insure that the battery is not replaced prematurely.
Summary of the Invention
In order to enable testing by a computer of its batteries without removal, in accordance with the invention a test circuit and method are provided for determining the condition of the battery.
Briefly stated, in accordance with one embodiment of the invention, the circuit includes a transistor having its emitter-collector circuit connected to the battery via a plurality of resistors. The computer is connected to saturate the transistor, and the voltages across the resistors are sensed to determine if they fall within given voltage ranges indicative of the condition of the battery.
The voltage level ranges to be tested are advantageously set to be in accordance with the threshold input levels of an integrated circuit. A TTL device may be responsive, for example, to a minimum high input voltage of 2 volts and a maximum low input voltage of 0.8 volts to cause a change in its output state. The resistors of the testing circuit are selected such that voltages at their junctions, which are indicative of battery condition, are either 2 volts or 0.8 volts at determined arbitrarily defined discharge conditions of the battery. By applying the voltages at the different resistor terminals to the inputs of a TTL device, then the outputs of the TTL device have HIGH or LOW levels selectively responsive to the battery condition, and these levels may be readily interpreted by the computer to provide an indication of the condition of its batteries.
It is of course apparent that the invention is not limited to the use of TTL devices and transistors, as in the above discussed example, and that elements of other conventional device families may be alternatively employed in accordance with the invention.
Computers, such as microcomputers and the like, frequently have a few input and output port bits that are unused, and in an especially advantageous arrangement in accordance with the invention, such unused bits may be employed as an interface for the testing circuit.
The computer may thus have a program which enables the battery test circuit, senses the voltages across the resistors, and hence determines the condition of the battery connected thereto.
Brief Description of the Drawing
In order that the invention may be more clearly understood, it will now be explained in greater detail with reference to the accompanying drawing, wherein the single FIGURE of the drawing illustrates a preferred schematic diagram of a circuit in accordance with the invention.
Detailed Disclosure of the Invention
Referring now to the drawing, in accordance with a preferred embodiment of the invention, for testing the condition of a battery 10, the collector of a transistor 11 is connected to the positive terminal of the battery by way of resistors 12, 13 and 14, in that order, and the emitter of the transistor and the negative terminal of the battery are grounded. The resistor 12 is variable to permit calibration of the circuit.
Outputs D0-D1 of a buffer 15, such as an octal Tri-State buffer type 74HC244, are connected to the data bus 16 of a microcomputer 17, which may be of conventional construction, and the corresponding inputs I0-I1 are connected, via diodes 18,19, to the junction of resistors 13 and 14, and 12 and 13, respectively. These two inputs are also connected to the 5 volt supply via resistors 30,31 respectively.
The buffer inputs are thus held HIGH by the resistors 30,31 and are influenced by the voltages at the resistor junctions only when these voltage drop below about 4.4 volts (5 volts minus the drop across the diode). When the voltage at a resistor junction is above about 2 volts, the corresponding buffer output has one logic level, and when it is below about 0.8 volts the output has its other logic level. The output level, which is applied to the computer via the data bus, thus enables the computer to sense determined ranges of the voltages at the resistor junctions, based upon the threshold voltages of the buffer. In accordance with the invention, the resistors 12-15 are relatively proportioned such that the sensed ranges are representative of the conditions of the battery.
The base of the transistor 11 is connected to the output of a latch 20, which may be a type 74HC374 octal D-type transparent latch, via a resistor 21. The input of the latch is connected to the D0 line of the data bus.
The clock of the latch, indicated as negated OUT, and the enable input of the buffer 15, indicated as negated IN, are generated in the computer by conventional address decoding techniques, to clock the latch and enable the buffer, respectively.
The latch 20 serves the function of holding the bias of the transistor, during the sensing of the voltages of the resistor junctions, at a level at which the transistor is saturated, so that substantially the full voltage of the battery appears across the series resistors.
The connections of the other inputs and outputs of the buffer 15 and latch 20 are immaterial insofar as the invention is concerned. The computer preferably has a loudspeaker 17A that can be conventionally internally programmed to emit audio tones of controllable frequency.
Typical values for the components are shown on the drawing, and will not be discussed further, except to state that the resistance of resistor 13 is preferably much smaller than the sum of the resistances of resistors 12 and 14. The 5 volt supply may be derived from the battery 10, via a regulator, so that the supply for the components of the circuit will be substantially constant even though the voltage of the battery 10 varies. In the illustrated example, V.sub.BATTERY is the voltage of the battery 10, and may be up to 10 volts.
In the following analysis, V.sub.0 is the voltage at the junction of resistors 13 and 14, and V.sub.1 is the voltage at the junction of resistors 12 and 13. V.sub.GOOD is the voltage of the battery when replacement need not be considered, V.sub.REPLACE is the voltage of the battery when it should be replaced, and V.sub.MARGINAL is the voltage of the battery intermediate the GOOD and REPLACE values. These values may be assigned on the basis of experience.
In the calibration of the illustrated circuit, with a voltage applied to the battery terminal between V.sub.REPLACE and V.sub.GOOD, and the transistor saturated, the resistor 12 is adjusted such that the computer senses the level of V.sub.0 as being at logic HIGH level and senses the level of V.sub.1 as being at logic L0 level. If the voltage applied to the battery terminals is now set to V.sub.GOOD, the computer will sense HIGH levels at both V.sub.0 and V.sub.1. If the voltage applied to the battery terminals is less than V.sub.REPLACE, the computer will sense logic LOW levels at both V.sub.0 and V.sub.1, indicating a weak battery.
As above discussed, the negated IN and OUT signals for control of the buffer and latch may be generated by conventional addressing arrangements. For example, conventional decoders may be provided in the computer, for selecting addresses assigned to these functions, whereby addressing of the respective selected address in the program of the computer effects the generation of the negated IN and OUT signals.
Routines that may be employed in the computer 17 for controlling the circuit of the drawing are as follows:
In these programs, the TONE commands are directed to conventional routines for controlling the computer to emit low, medium and high pitched tones. The calibration routine employs these three tones to indicate GOOD. MARGINAL and REPLACE conditions of the battery.
In the calibration procedure, it is apparent that the tone emitted by the computer may be employed as an indicator in the setting of the resistor 12, i.e. the resistor 12 is adjusted when in the battery check routine, until the medium pitch tone is emitted, when the battery voltage is in the MARGINAL range.
The program as above discussed in written in assembly code for a Z-80 microprocessor.
While the invention has been disclosed with reference to a single example, it is apparent that many variations and modifications may be made therein, and it is therefore intended in the following claims to cover each such variation and modification as falls within the true spirit and scope of the invention.