Inexpensive methods to measure battery energy can result in low precision measurements, and techniques to increase precision often add complexity and cost. One alternative uses a software algorithm that provides reliable battery-capacity measurement.