This is a battery capacity indicator for 3.7V lithium ion batteries, using a bi-color LED (red-green) common anode.
When the battery is from 100% to 50%, the LED stays green. When the capacity is from 50% to 20%, both LEDs turn on so it shows as yellow. When battery drops below 20% the green LED turns off leaving the red LED turned on.
It uses a schmitt trigger for both LEDs to prevent bouncing on the threshold. I accomplish this with a dual op-amp.
I design this to work with 5V, not only to power everything, but also to have a reference voltage to measure the battery voltage.