I've designed a circuit for a battery indicator for my 18V Li-ion battery pack, based off this example here: https://www.electroschematics.com/8347/24v-battery-level-indicator/
I have it laid out on a breadboard, and it works as expected for outputs 1-3, but 4 seems to always be low, unless Vin (18V) goes very low, as below:
LED 1: Red - always on
LED 2: Green - on >3V ***This should be ~13.5V, which is my problem
LED 3: Green - on >14.8V
LED 4: Green - on >16.1V
LED 5: Green - on >17.5V
If I move the wires for 4IN- and 4IN+ to 3IN- and 3IN+ LED3 works properly, switching LED3 on >13.5V but off under that, but LED4 is still always on. So I don't think its the wiring, it just seems like comparator 4 doesn't work?
I've also put a new LM339N in, but it makes no difference.
Any obvious errors or thoughts?
Edit/additional info Vin should hopefully never be below 12.5V, otherwise my battery pack is toast! I'm happy with how it currently works, with the current thresholds and LED brightness, except that of comparator 4. The power for this circuit is through a switched input, so it's not always on and current draw isn't really a concern, but I will look into improving it anyway. This will be used on a device outdoors, so I need the LEDs to be pretty bright.