septillion:
Adding a cap gives it some buffer but reduces the response time.
Grumpy_Mike:
Yes but adding a cap is silly. It does nothing for you. Yes there is a capicitor on the sample and hold to the A/D converter and with such a high input impedance it is going to take time to charge. So the proper way to do this is to read the analogue input twice and if necessary put a delay between the two. An external capacitor is only going to slow down the response, add to the inaccuracy with leakage current and is a thorougher waste of a capacitor.
I'm reading battery voltage, so it's not changing very often, and I'm not reading very often. Response time should not even be an issue. The capacitor has all the time it needs to charge up. I'm not sure leakage current really adds to the inaccuracy, or that much waste. A few uA for small capacitors?
raschemmel:
As already stated, a capacitor is nothing more than an energy storage device. ...You still have to "pay" for that energy . It is not free. The amount of energy removed from the battery by the cap is more than the 160 nA that the analog input draws so the cap accomplishes nothing. If you use two 470 k resistors for the voltage divider, the total resistance across the battery is 940 k. If you had a 3.7v battery, the drain would 3.9 uA. That is 1/254th of 1 mA so an 1100 mAh battery would last ...
@raschemmel regarding "the amount of energy removed from the battery by the cap". Aren't leakage current in the order of uA for such small capacitances? Also, 470k resistor is too high to give accurate analog voltage readings.