Electronic – estimate remaining battery life by measuring its voltage with the same MCU that it powers


I'd like to estimate the remaining battery life of a battery that powers a microcontroller. Could I accomplish this by simply leading the battery into the MCU's built-in ADC?

My idea is that I could plot the voltage over time to figure out how much battery life remains. But would the change in voltage be noticeable? And would it be a problem that the same battery powers the MCU (and ADC)?

Best Answer

You can do this (assuming voltage is a predictable function of remaining life, but that's another issue) as long as there is a fixed voltage reference available in the system somewhere. Some micros have a fixed voltage reference built in, which can usually be read by the internal A/D or applied as the A/D scale. If not, you have to supply some external reference. Note that due to power consumption you may want the micro to switch on this reference only for a short time around battery readings, which don't need be very often relative to the time it takes to do a reading.