Following on from this oldish post:
retrolefty: There is a method to make your A/D measurements independent with variation of the Vcc used as the A/D reference. The trick is to read the bandgap voltage (not use it as the reference) and come up with a correction factor to utilize in mapping your analog input readings.
I have attempted to do that with rather variable results. For example:
Barebones board: Battery Vcc volts = 412 Analog pin 0 voltage = 111 Uno: Battery Vcc volts = 480 Analog pin 0 voltage = 134 Ruggeduino: Battery Vcc volts = 491 Analog pin 0 voltage = 60
The "bare bones" board was supplied direct from 5V supply, checked with a meter to be around 4.99V. The other two were supplied from the USB cable. In those cases I measured around 5.03V on the Vcc pin.
The error amount on the bare bones board in particular seems to be a rather high 18%.
I am trying to document ways of reliably knowing if a battery-powered processor "in the field" can self-detect if its battery level is getting a bit low. Since batteries have rather flat discharge curves I was hoping for a better than 18% error rate, and also hoping not to have to have some calibration needed for each individual device.
Page 262 of the datasheet has some confusing data regarding using the internal voltage reference, specifically it says:
REFS0 and REFS1 set: Internal 1.1V Voltage Reference with external capacitor at AREF pin
What external capacitor? Is one required for this to work reliably?
Can anyone who was worked with this cast some light on it please? Thanks very much.