In addition to Steve's excellent reply.
I suspect that using a micro with a built-in ADC, as originally suggested by BobK and amplified by Steve, could be very worthwhile.
You haven't described your circuit fully, but I take it that the microcontroller is interested in the battery voltage, and...