5 Measure Power Supplies and Batteries
Another way to measure power supplies and batteries is to use a voltage divider. The simplest method is to use two resistors to divide the supply to a value within the ADC’s measurement range, as shown in Figure 5-1.
One way to improve the circuit shown in Figure 5-1 is to add a capacitor across R2. If the capacitor is sized correctly, then the signal acquisition time can be reduced significantly. However, this limits the sample rate, as the capacitor requires time to charge/discharge between conversions. This technique is further discussed in Microchip Application Note AN4225, “Maximizing the Signal: Tips and Tricks to Properly Acquiring Analog Signals” (DS00004225A).
A slightly more advanced version of the voltage divider incorporates a small NMOS transistor into the divider to shutdown the division network when not needed. However, the NMOS can be replaced with an open-drain I/O pin instead. This circuit can be used for faster acquisition times by using lower-valued resistor divider networks, which reduce source impedance for the ADC. A small amount of error is added due to the resistance of the NMOS or I/O pin.
To improve acquisition time for high-impedance divider networks, an OPAMP (see Buffering and Scaling Signals with an Operational Amplifier (OPA/OPAMP)) can be used to buffer the output.