The convenience and reliability of portable electronic devices depend on efficient management of batteries and their limitations. One universal, not to mention irritating, limitation of all (chemical) batteries is their finite capacity and lifetime. Moreover, while the inevitability of eventual discharge is bad enough, the effects of sudden and unexpected battery failure are usually much worse. This makes realtime estimation of remaining battery energy and life expectancy a useful feature in portable systems.

A battery’s expected lifetime at any given moment is equal to remaining battery charge divided by load current: T_{B} = Q_{B}/I_{B}. Measurement of I_{B} is easy enough, but we also need Q_{B} to predict battery life expectancy.

The simplest way to obtain Q_{B} is to estimate it from the battery output voltage. Unfortunately, the exact relationship of battery voltage to charge is a dauntingly messy nonlinear function of many parameters. Included among these are initial capacity, temperature, load current, discharge history, and battery chemistry (alkaline, NiCd, LiMnO_{2}, etc.). Even so, a usable approximation of Q_{B} can be obtained by using a simple linear model derived from a least-squares method. These are fit to the actual discharge curves of various popular battery types.

The circuit in Figure 1 is based on this idea. It outputs a 0- to 2.5-V signal that is proportional to the estimated remaining battery capacity. The circuit can be adapted to different battery voltages and types by proper selection of R1 and R2. This allows IQ to vary from 50 to 0 µA as battery charge varies from 100% to 0%. Then, the fixed-gain current-to-voltage converter A2 produces the calibrated output voltage. Listed below are the least-square R1/R2 approximations for four of the most popular battery chemistries (normalized to NCELLS = the number of cells in the battery; V_{R} = the 1.25-V reference voltage).

Alkaline: R1 = 12.2K * NCELLS R2 = V_{R} * R1 / (0.72 * NCELLS-1)

LiMnO2:R1 = 16.8K * NCELLS R2 = V_{R} * R1 / (1.85 * NCELLS-1)

NiCd: R1 = 6.83K * NCELLS R2 = V_{R} * R1 / (0.82 * NCELLS-1)

Pb-Acid: R1 = 6.76K * NCELLS R2 = V_{R} * R1 / (1.43 * NCELLS-1)

Translation of estimated battery charge to estimated life expectancy is more complicated due to the required arithmetic division of charge by load current. Figure 2 shows one way to implement this calculation by making A2’s transimpedance gain variable (inversely proportional to I_{B}) instead of fixed as in Figure 1. Key to this method is the addition of digitally controlled potentiometer DCP1 (a Xicor X9511 “PushPot”).

In operation, comparators A3 and A4 match V_{S}, the voltage developed across load-current sense resistor R4, to the voltage at DCP1’s V_{L} pin. As the load current increases, A3 asserts DCP1’s PD (decrement) control pin. This causes the VW wiper to step toward the V_{L} pin and drive R_{L} and V_{I} toward zero.

Conversely, as load current decreases, A4 asserts DCP1’s PU (increment) pin, driving the wiper toward V_{H} and R_{L} toward 10k. This establishes a feedback loop that continuously maintains: R_{L} = 10k(1-I_{L}R4/0.05 V). In other words, as IL goes from 0 to full-scale defined by 0.05 V/R_{4}, R_{L} goes from 10k to zero. The internal structure of DCP1 inherently establishes RH = 10k-R_{L}, so R_{H} = 10k*I_{L}R_{4/}0.05. Since A2’s transimpedance gain is given by R3^{2}/ R_{H}, the gain is R3^{2}/(10k*I_{L}R_{4/}0.05) = ~10k/I_{L.} A2’s gain is, as promised, inversely proportional to I_{L}.

With the component values shown, Figure 2 will work with a standard 9-V, 500-mAhr alkaline battery and 100 mA < I_{B} < 1 A. Together, they generate an output scaled to 1 V/hr of remaining battery life. Appropriate selection of resistors R1 through R4 can accommodate virtually any battery and any desired scale factor.