Hello,
I've been learning more about voltage dividers, and I see a few different ones online. The idea is that I want big resistors so battery won't be depleted quickly, but big resistors prevent accurate analog voltage readings. So all of these 4 circuits have a capacitor in there to buffer that battery voltage, but which ones work, and why, and why might you want to add R3 into the circuit?
I'm still kind of learning about how it works, so trying to understand the why is important for me.
Ok...let's assume that I actually wired up a common ground. I was trying to focus on just the voltage divider circuit. There's also no power going to the microcontroller, etc...
The solution (and resistor values) depends on the battery/voltage you want to measure.
Yes, this is obvious. I think I would probably split the difference and go with something in between 100k and 1M, like maybe 470 k to 560 k, but the 1M is still not a bad choice.
Grumpy_Mike:
That is silly, don't do it. All it does is slow down the response time of the circuit to a new voltage.
All those circuits will not do anything. There is no common ground and 1M is way too high.
The capacitor idea is NOT silly IMHO. It allows you to use a large voltage divider to prevent battery drain. 1M is perfectly fine. I am using 2 x 1M to measure a 6..8V battery. Response time is usually not an issue with a battery.
Of course you are right with the missing ground connection.
The capacitor idea is NOT silly IMHO. It allows you to use a large voltage divider to prevent battery drain. 1M is perfectly fine. I am using 2 x 1M to measure a 6..8V battery. Response time is usually not an issue with a battery.
Of course you are right with the missing ground connection.
The capacitor idea is NOT silly IMHO
As already stated, a capacitor is nothing more than an energy storage device. Once it has charged, that energy has been removed from the battery and is no longer available for anything else. 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
1100 mAh/3.936170 uA would last 279459.459 hours.
1.1Ah /3.9361702127659574468085106382979e-6 A =279459.45 hours.
279459.45 hours/24 hours = 11644.14375 days
11644.14375 days /365 days = 31.901763 years.
So how silly it that to use a cap to avoid a current drain that would 31.9 years to drain the battery ?
23.6.1 Analog Input Circuitry
The analog input circuitry for single ended channels is illustrated in Figure 23-8. An analog
source applied to ADCn is subjected to the pin capacitance and input leakage of that pin, regardless
of whether that channel is selected as input for the ADC. When the channel is selected, the
source must drive the S/H capacitor through the series resistance (combined resistance in the
input path).
The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ 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, with 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.
Signal components higher than the Nyquist frequency (fADC/2) should not be present for either
kind of channels, to avoid distortion from unpredictable signal convolution. The user is advised
to remove high frequency components with a low-pass filter before applying the signals as
inputs to the ADC.
Yes, and reduce the reading frequency. Because the load of the ADC will play a significant role on the circuit then. Adding a cap gives it some buffer but reduces the response time.
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.
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.