Quick question. I have a CR2032 cell for backing up a 23LCV1024 memory chip when the rest of the circuit is unpowered. I'm occasionally monitoring backup cell status using an analogue input on the Nano through a divider as shown in the picture (divider because external 2.50 V reference is in use and backup cell is 3 V). I'm not worried about the few uA drain on the backup cell through the divider. But should I be worried about the 1.5 V (even though it's high impedance) on the Nano's analogue pin when the Nano is unpowered? Should I consider using an analogue switch/reed relay?
That's why the 100 nF capacitor. S/H capacitor is 14 pF, so over 7000 times smaller. I can live with a 1/7000 sampling error. It's just for estimating battery state anyway.
You'll have to elucidate me, as with a typically very slowly changing value such as a battery level I don't see how your 100nF would induce a sampling error at all.
Btw, I would probably have changed it into something like 10nF as even 100nF is quite excessive, but as I mentioned, the nature of the signal doesn't really require anything halfway fast at all.
The small error comes from C1 discharging into Csh (the sample and hold capacitor in the ATmega) during sampling. If C1 is large compared to Csh then only a small fraction of its charge will have gone to Csh until voltages on both caps are equal. From dV=dQ/C that means the final voltage on both caps (and the voltage that is being measured) will have dropped only a small amount from Vbat. In this case about 1 part in 7000.
The larger C1 compared to Csh the smaller the error. A larger C1 will take longer to charge from Vbat through the divider (RC = 10 ms here) but that might only be an issue at startup since I'm only reading the battery status, say, once every minute afterwards. I'll put in a small delay before the first reading is taken.
1 part in 7000 is not even resolvable with the Arduino's 10-bit ADC. If you put in a 10 nF cap, it would be 1 part in 700 which would be a measurable error. Although it really doesn't matter in this application...
Ok, I see your point, but 200k isn't even that high of an impedance in relation to a 14pF SH capacitor (the source impedance of the signal of course being very low impedance to begin with), so I don't think you'll even get to a 1/7000 error.
Edit: the above was silly, sorry. I see your point and agree that the error will be insignificant.
The 200k is irrelevant during the sampling cycle (RC is 10 ms vs 100 or so microseconds for a sampling cycle) since the SH cap gets charged from C1 directly. That's the whole point of C1. The error comes from the charge in C1 being redistributed to Csh and the resulting voltage drop.
Btw, my suggestion of changing to 10nF would be mostly because of the anticipated lower leakage of a smaller cap, but also this would be kind of a moot point.
Ah ok. Like you (and I) said it doesn't really matter for this application. All I'm after is a battery ok/low/dead indication. If I get a slightly lower voltage reading due to a horrendously leaky capacitor, that's just a more conservative response so it's wrong in the "right" direction.
And anyway, I've set the "bat low" and "bat dead" voltages somewhat arbitrarily at 2.4 and 2.1 V by looking at some CR2032 discharge curves on Google and deciding how much time might be required before someone (co-workers) could be arsed to change the battery after seeing a warning... Based on previous experience, that might be forever so I'm really not sure why I even bother...
It's really not a critical application and if battery backup is lost (because everyone ignored the battery dead warning), it's really not a massive issue. Maybe it'll teach them not to ignore battery warnings (yeah, right)... I think this discussion might have gone off-tangent a bit...