The better the analog front-end for measuring battery current, the more accurately you'll be able to gauge the remaining run-time for your battery-backup system.
Here's a discrete front-end design that gets the job done.
How long will it run?
When power fails, many home and commercial alarm systems go to a backup battery, most commonly a 12-volt sealed lead-acid type. If you're able to accurately sense the current draw, and the battery is well-characterized, you'll be able to accurately determine the amount of time remaining before your mission-critical system dies.
With careful design, you can measure battery current to within 0.2 percent of full scale. With that information, the most accurate gauging systems, taking battery age, temperature, self-discharge, and discharge-charge cycle history into account, can usually estimate remaining battery life to within 1 percent. The sealed lead-acid (SLA) batteries used in most backup systems specify between 250 and 1,000 full discharge-charge cycles over their service life, which can be as long as three to five years with good treatment. Home-alarm systems may draw as much as a few amperes, though 1 amp or less is common in today's typical system. An uninterruptible power supply (UPS) for a single computer may draw 16 amps or more from the battery at full load. A network equipment rack filled with a large organization's switches and routers, plus built-in wireless and broadband modems may draw 50 amps or more. The system designer's end goal is to be able to accurately determine remaining battery life across a wide range of load demands.
Apart from its basic function, current-sensing circuitry is often part of a system for recharging the battery as fast as possible. Integrated solutions to this problem exist using such chips as Analog Devices' ADP3808 battery charger IC, which features both fast charge mode and float charge mode. Still, for flexibility and to maintain high accuracy up to 0.2 percent over temperature, a discrete solution is often preferable. Either way, the best estimate of remaining charge is obtained by active methods such as current sensing, and the more accurately you can do that, the more accurate the end result.
Source characteristics
SLA batteries are very robust compared to most chemistries. Their charge capacities decrease at temperatures below 25°C and at higher discharge rates, so demanding applications will shorten battery life. Charging a SLA battery at more than a 0.2 C rate, one fifth its charge capacity in ampere-hours, can damage the battery and decrease its ability to store charge. Proper charging, including varying the charging voltage with temperature and correctly terminating at full-charge, maximizes the expected battery life.
The SLA batteries self-discharge 3 to 10 percent of their capacity each month if they sit at room temperature without being charged. In backup applications, continuous float-charging at the total cell-voltage eliminates the self-discharge problem and avoids damage from overcharge.
Basic considerations
Sensing begins with converting the battery current to a voltage as measured across a low-value sense resistor. The sense resistor connects between the battery and the load, in either the negative or positive leads. Set up the circuit for positive-lead sensing when possible; that way, the system ground won't be disrupted.
Next, find an appropriate low-offset op amp to boost the ultra low-voltage input before introducing it to an A/D converter for sampling. Finding a low-offset amplifier with the required high input-voltage range can be difficult for high-voltage applications. In these cases, an instrumentation amplifier such as the AD8210 (high-voltage, bidirectional current shunt monitor), will often stand in well. For an accurate measurement, the amplifier's input range needs to extend beyond the supply rails.
For a 12-volt system, on the other hand, it's much easier to find low-offset amplifiers for sensing the current at the negative terminal using low-side current sensing. The input range still needs to extend below ground to include the amplifier's supply current in the measurement.
For power backup systems, current sensing is a low-frequency activity, so 30 Hz to 50 Hz sample rates are more than enough as the load currents do not vary quickly and the resultant Nyquist rate is about 100 Hz. Rates of 10 Hz or lower minimize the overhead on the processor monitoring the current, while still providing accurate estimates of remaining charge. The low sample rate emphasizes the need for amplifiers with low 1/f noise for best accuracy. In addition, the offset voltage drift (TCVOS) of an amplifier due to temperature variation mimics the low-frequency noise, so it should be minimal as well. The typical discharge temperature range for many SLA batteries is -20 to +50°C.
The maximum system current sets the sense resistor value and absolute measurement accuracy. For example, a maximum sense-resistor voltage of 50 mV complies with the input limits of an amplifier while still providing some operating margin over temperature.
Given the above requirements, an auto-zero amplifier such as Analog Devices' AD8638 is a good candidate. The AD8638 can handle inputs up to 100 mV below ground and it can be directly powered from a 16-volt supply. Its auto-zero design gives the required low offset for accurate low-current measurement—10 microvolts at +25°C, and 20 microvolts maximum over -40 to +125°. Furthermore, its auto-zero architecture is low-noise between 0.1 Hz and 10 Hz.
If you can get around the need for error correction at the A/D converter's output, you can use less-expensive, lower-resolution A/D converters. The measuring front end's offset and noise should both be minimized for the best accuracy without adjustment.
Sensing only discharge current cuts cost
The A/D converter's input range sets the front-end gain for the maximum sense voltage. A/D converters with 5-volt ranges are readily available. Sensing both drain and charging current requires negative and positive supplies and a converter with a bipolar input range. A negative supply can be built with a well-filtered buck-boost regulator, but the additional circuitry adds complexity and cost.
After a loss of mains power and a subsequent restoring of service, the power will normally be up long enough to charge the backup battery. For that reason, measuring charging current is usually unnecessary for a well-characterized SLA battery and well-behaved charging circuit. A unipolar input range and supply are sufficient for sensing current drain in cost-sensitive applications. Measuring the discharge and tracking the number of discharge-charge cycles is usually all you need to accurately estimate the battery condition.
The circuit
Figure 1 shows the current-sensing circuit. The 0.01-ohm sense resistor develops a full-scale 50 mV voltage from a 5-amp system. Resistors R2A/R1A and R2B/R1B configured for amplifier A1 establish a gain of 100, and thus the amp will produce a 5-volt output from the 50-mV input. R1A and R1B also provide input current limiting to avoid damaging the amplifier's on-chip ESD diodes. C1A and C1B limit the 3 dB circuit bandwidth to 10.7 Hz.
(Click on Image to Enlarge)
The large capacitive load from the A/D converter's input may cause instability, so R3 is included to decouple it. Without R3, the amplifier's output impedance and the load capacitance may form a poorly damped resonance, which can cause ringing or oscillation at high frequencies. The required value for R3 will vary with the A/D's input capacitance and should be checked in the actual circuit. Most A/D converters have very low input currents, so the DC error introduced by R3 will be negligible. R3 may be eliminated if the A/D's input capacitance plus the board layout capacitance is less than about 60 pF.
To avoid latchup and possible damage, connect the ground lead first, followed by VDD, and then the inputs to the device. Input voltages should never exceed VDD or go more than 100 mV below ground.
At the start of any backup event, the current-sensing circuit will either be powering up from standby or recovering from overload. Either condition requires time for the circuit to settle before it can measure current and it will require additional settling time due to the 10.7 Hz filter. It's a good idea to wait at least 300 ms before taking the first current measurement.