I'm trying to build a circuit which will be used to monitor the voltage of Li-ion battery. The voltage comparator I'm using is LM393.
Since the whole circuit will be powered by, it the battery will be drained and would not stayed at the constant voltage. The battery stays at 4.2 V when it is fully charged. I want to put the reference voltage at 3.7 V and the actual voltage of the battery at V(in).
I tried to put a voltage divider at the reference voltage but cannot find the resistor values which will satisfy this case.
How do I build the circuit so that the ever changing voltage of the battery gives a stable constant value at the reference node?