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.

Figure 5-1. Simple Voltage Divider Circuit
Note: If measuring a supply that exceeds the absolute maximum ratings, a fail-safe shunt regulator (such as a Zener diode) and/or a fusible resistor (R1) can provide some protection. The protection networks must be evaluated for each application and tested before use in production.

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.

Figure 5-2. Voltage Divider with On and Off
Note: This circuit can only be used with power supplies at or less than the supply of the microcontroller.

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.

Figure 5-3. Voltage Divider with an OPAMP Buffer