Nano: Analog read, values incorrect

According to the data sheet

"The ADC is optimized for analog signals with an output impedance of 10k or less. If such a source is used, the sampling time will be negligible. If a source with higher impedance is used, the sampling time will depend on how long time the source needs to charge the S/H capacitor, which can vary widely. The user is recommended to only use low impedance sources with slowly varying signals, since this minimizes the required charge transfer to the S/H capacitor." (2: 26.6.1)

As youre using the 4.096 reference you need a divider that will give 4V out (ish) for 16V in (absolute maximum of 12V lead-acid battery on charge + a bit of headroom)

and an impedance of around 10k.

39k:12k, 47k:16k or 56k:18k would be fine.

I'd design for a current of 1-2mA through the voltage reference diode.

aarg! You are correct. (my way of thinking improves significantly but only after a cup of coffee or rest or both).

jospanner:
I have an LM4040 set up...

No sure why you go this way for a simple voltage measurement.
The internal voltage reference of the Nano (~1.1volt) should be good enough for that.
You can switch to that with a simple line of code in setup().
analogReference(INTERNAL);
No hardware involved.
Leo..

Hi Leo; I agree - but the spec for the 1.1V "reference" is 1V - 1.2V. In real life its generally much more accurate & stable - but still nowhere near the 0.25% the ADC gives.

(I'm amazed to see the ESP32 gives the SAME spec
Analog to Digital Converter — ESP-IDF Programming Guide v3.0-dev-1474-gf8bda32 documentation)

Also I'd prefer to divide by 4 & use a 4V reference than to divide by 16 for the 1V reference.