charging is about 14-15 volts, so you would want to allow for a higher voltage than just the battery.
if you set the maximum for 20v to be safe,
and you have a 5v input,
then R1=4/5 and R2-1/5
4k and 1 k ?
12v will be near the middle of the range so you should be able to see that maximum value when charging.
you would want to add a zenier to limit the voltage in the event the charging circuit failed.
