With just one leftover op amp or comparator, you can add a battery-condition indicator to your portable circuit design. To indicate the life in an aging battery visually, the circuit in Figure 1 varies the duty cycle and flash rate of an LED when the battery voltage drops below established limits.
|Figure 1.||Depending on the 9 V battery's state of charge, the LED is either continuously on, off, or blinking at one of three
rates & duty-cycles.
The circuit actually indicates five conditions of the battery. A steady glow assures the user that the battery is strong and healthy. A 2-Hz brief flicker off indicates that the battery is starting to show age. A more insistent, 50%, 5-Hz flashing is a warning to have a spare battery on hand. A brief flicker on at 2 Hz is the battery's last gasp. And, when the LED is continuously off, it's time to replace the battery.
The component values in the figure switch the LED from steadily on to flash mode when the 9 V battery drops to about 6.5 V and the LED is continuously off below 5.5 V. You can tweak the resistor values for different voltage thresholds as desired.
The circuit holds the op amp's minus-input voltage between the upper and lower limit that R4, R5, and R6 establish. For a precise dead-battery threshold, make R4 adjustable to offset the variations in regulator tolerance.
The circuit oscillates only when the battery-sense voltage at the op amp's plus input is within those limits. Above and below these limits, the circuit functions as a comparator and holds the LED continuously on or off. Within the limits, the capacitor sawtooth will have the amplitude established by the hysteresis of R1, R2, and R3. The hysteresis must be smaller than the capacitor-sawtooth limits, and their difference defines the voltage range over which the circuit oscillates. Calculations are tedious, so you'll find it easier just to breadboard the circuit and tickle the values until the circuit percolates at the thresholds you want. An LM358 can drive a high-efficiency LED, but higher current requirements or open-collector comparators need a buffer transistor.