The resolution of the ADC is 2^10=1024 steps... lets say you want a accuracy reading of 0.25 V from the battery... then the maximum reading voltage to the voltage divider will be 1024*0.25=256 V (that means when the battery will be 256 V then the voltage at the ADC port will be 5 V)
V_sense / V_battery = 5 / 256
... on the other side:
V_sense / V_battery = R2 / (R1+R2) = 10k / (R1 + 10k)
5 / 256 = 10k / (R1 + 10k)
- - - - - - - - - - - - - - - - - - - -
R1 = 502k
... bigger the R1 resistance = lower the current drain = lower the accuracy
The impedance shouldn't be bigger than 10k ohms to the ADC port (check the datasheet for your pic)
Bookmarks