In the circuit below, a quad voltage comparator (LM339) is used as a simple bar graph meter to indicate the charge condition of a 12 volt, lead acid battery. A 5 volt reference voltage is connected to each of the (+) inputs of the four comparators and the (-) inputs are connected to successive points along a voltage divider. The LEDs will illuminate when the voltage at the negative (-) input exceeds the reference voltage. Calibration can be done by adjusting the 2K potentiometer so that all four LEDs illuminate when the battery voltage is 12.7 volts, indicating full charge with no load on the battery. At 11.7 volts, the LEDs should be off indicating a dead battery. Each LED represents an approximate 25% change in charge condition or 300 millivolts, so that 3 LEDs indicate 75%, 2 LEDs indicate 50%, etc. The actual voltages will depend on temperature conditions and battery type, wet cell, gel cell etc.
circuit from http://www.bowdenshobbycircuits.info/