Connect Battery positive terminal directly to MCU ADC input Pin

battery-operatedmicrocontroller

enter image description hereMCU is powered directly from 3 V battery and I am using ADC input of MCU to monitor the battery voltage to detect low battery situation. I have got good inputs on this site(I need to monitor the battery voltage very rarely and this is a battery powered board and designed for long life) to use a NFET, PFET and a resistive divider circuit to connect the signal MCU. Why shouldn’t I directly connect the battery voltage to ADC Pin? Perhaps with a series resistor.

EDIT:
MCU has internal 1.45 V standard reference for ADC. The 1.45 V can be one of possible ADC input and also can be used as Reference voltage for ADC.
From the safety aspects, can I connect battery directly to MCU ADC input Pin?

Best Answer

The main things you need to figure out are the ADC input voltage range and the ADC reference voltage. Some microcontrollers use the microcontroller power supply voltage as the ADC reference voltage. In this case, the ADC output will be something like 1024*Vin/Vcc for a 10 bit ADC. The ADC input range on these is generally anything within the voltage rails. Anything outside the rails would have to be divided down. It rather defeats the usefulness of the ADC if it is supplied with the battery voltage as all ADC measurements will then be in relation to the unknown battery voltage. Measuring the battery voltage this way is completely futile as you will always get the same result out of the ADC, independent of battery voltage (ADCcode = 1024*Vbat/Vbat = 1024). Other microcontrollers will have a separate reference for the ADC that is independent of the supply voltage. In this case, the input range is more limited, generally GND to Vref, which could be as low as 1V. In this case, you would have to divide down the power supply voltage for measurement.

Now, I don't know what controller you are using, so I am going to provide some possible solutions for either case.

For a microcontroller like the Atmel AVR series that uses the power supply as a voltage reference, what I would suggest doing is measuring a fixed reference voltage with the ADC input and then compute what the power supply voltage is from that. No need to divide anything down in this case. You can get quite accurate shunt references around 1 to 1.2 volts in SOT-23, and you can use a PMOS to turn it off when not in use. Compute the battery voltage 'backwards' with Vbat = Vref * 1024/ADCcode.

For a microcontroller like the Atmel AVR XMEGA series that uses an internal reference, you will have to divide down the power supply voltage to something within the input range, which is 0 to 1 V with the internal reference. You can use a PMOS transistor to disconnect the divider when not in use, or you can use very large (~1M) resistors and a smoothing capacitor on the ADC input pin. The smoothing capacitor is generally a good idea for power supply measurements anyway as it will reduce high frequency noise as well as allowing the ADC sample and hold cap to charge up quickly. Compute the battery voltage the normal way with Vbat = ADCcode /1024 * Vref.