Up to now, this battery level indicator design was limited to 12 & 24V applications. In past circuits, the use of fixed resistors greatly simplifies setup. However, fixed resistors resulted in application inflexibility that precluded use at lower voltage and different types of batteries. In the updated circuit, all thresholds are set via potentiometers, and an LM317 provides a 1.25V voltage reference. Rather than lighting LEDs progressively, this circuit blanks low order LEDs thus reducing power consumption. While the comparator and op amp operate as low as 2V, the voltage reference requires 3V (as a 1.25V reference). This easily accommodates 4.5V battery applications, but is far too marginal for 3V applications. By following the application information indicated on the schematic, it may be extended to 28V.
The goal was to make it work for 3V battery applications –I thought this would be easy, but Murphy thought otherwise –apparently the limiting factor is the LM317 voltage regulator. As a result, the 3V version must wait for another day when I can evaluate the LP2951 LDO voltage regulator.
Full schematic of the battery level indicator circuit
LEDs come in various colors and efficiencies and make for a colorful display –or for simplicity sake, all may be the same color, or may all be included within one bar graph LED device. Due to differences in forward voltage drop and efficiency, the current limiting resistors will probably need to be adjusted for best performance. The table on the schematic for R18 to R22 suggests a starting resistance –note that these resistors need not be equal. However, if all are the same color, one resistor value should work well.
|LED Color||Charge Level|
|Red:||0 to 25%|
|Orange:||25 – 50%|
|Yellow:||50 – 75%|
|Green:||75 – 100%|
Of course, you may select your own colors as desired.
LM317 voltage reference
Few know that the LM317 makes a very simple 1.25V reference, but the datasheet does not allude to this application. The LM317 requires a headspace of 1.75V. This means that the minimum input voltage must exceed the output voltage by this value. Minimum DC input voltage = 1.25V + 1.75V = 3V.
The LM317 has a minimum load specification of 5mA, but I have never found one that did not function at 3.8mA. R5 (330Ω) provides the minimum load.
Percentage of charge determination
For convenience, I estimated the charge level thresholds of a 4.5V battery. For your particular battery, careful testing and adjustment will be required in order to obtain any degree of accuracy. Without such testing, this indicator is little more than a ‘wiggler.’ A suggested means of accomplishing this is to discharge a fully charged battery via a fixed resistor while graphing the output voltage as a function of time. Then divide the plot up into 4 equal AH (ampere hour) segments during which the output voltage is serviceable. From such a graph, it should be easy to observe specific voltage thresholds –note that there is no requirement for evenly spaced voltage thresholds as I have indicated on the schematic.
After the above voltage steps have been determined, the voltages must then be divided by the division factor of the voltage divider –for a 4.5V (nominal) battery, it is a factor of 4.3. So for the four steps it is as follows:
|Voltage threshold||¸ 4.3|
With the circuit powered via a good battery, adjust the 4 potentiometers to the ¸ 4.3 voltage levels above. While some may think that they can ‘wing’ it, I believe otherwise and if ultimately successful, it will take much more time. Note that if the potentiometers are not set at progressive voltages, operation will be unpredictable –good luck!
U3 is the 1.25 LM317 voltage reference. R5 & R6 form a voltage divider that reduces the battery voltage to a level that is close to the reference voltage and within the common mode voltage range of U1 and U2. U2A is a source follower amplifier that buffers the voltage divider output so that regardless how many diodes are drawing current out of this node, the voltage remains stable. R8 through R11 provide high impedance sources at the comparator inputs so that the diodes can easily take control of the voltages at these nodes. U1 consists of (4) comparators that compare the voltage from the reference potentiometers with the divided battery voltage. U2B is an op amp that is wired as a comparator that controls the lowest order LED.
Diode NAND gates
The 10 diodes make up a total of (4) wired NAND gates that function by reducing the reference voltages to below 0.6V. The 1st has one input, the 2nd has 2 inputs and so on. This blanks the low order LEDs so that only one is on at a time thus reducing battery load. To further reduce power, a push-to-test pushbutton may be used, or it may be cycled via a 555 timer in order to reduce the duty cycle (circuit not provided).
At the voltage thresholds, the LEDs may tend to flicker between two LEDs. To prevent this, a small amount of positive feedback is added via the addition of R14 to R17. Note that this is optional.
I recommend testing with an adjustable lab type power supply –besides being adjustable, it offers current limit that protects against accidental short circuits or polarity reversal. It makes life much easier.
If testing directly with a battery, note that reverse polarity protection is not provided –the experimenter is on his own this time. Suggestion: Initially power the circuit through a 100Ω resistor to limit potential fault current –after determining that the polarity is OK, this resistor may be removed.
Protoboard was a challenge
Observe the ‘rats nest’ in the photo –this is perhaps the worst layout I have ever done –touching just about any resistor or diode shorts something out and causes bizarre behavior…
Stripped down version
For those who want something simpler, U2, all the diodes and most resistors may be eliminated. If experimenting with this circuit, I suggest starting with the strip down version and then progressively develop the full version.
Striped down schematic
For the future
3.3V battery level indicator using the LP2951 voltage regulator
Undocumented words and idioms (for our ESL friends)
wiggler –noun –cheap, but functional mechanical indicator –the name is derived from cheap, inexpensive meter movements of one or two generations ago –examples: S meter (signal strength meter), dedicated battery level meter, VU meter (volume unit meter) etc. all of which have no specific calibration…
wing it –verb –idiomatic phrase –give it your best attempt or guess, without preparation or planning. Note that such carelessness often wastes time and /or ends in failure
rats nest –noun –idiomatic phrase –messy, looks like something a rat assembled…