Measuring VCC - why bother?

A project log for Low-cost/power/size temperature logger

A low cost ultra-low-power small-sized high accuracy temperature logger for use in scientific research.

NikosNikos 03/13/2018 at 11:081 Comment

At the time, it was a why-not decision. I didn't need to use the AVR's analog to digital converter (adc). I thought that was a waste, but had read about its ability to measure VCC. All I had to do was connect the battery to AVCC with a decoupling capacitor, which one should do anyway for stability, but also connect a decoupling capacitor to AREF (ADC reference).

This design allows the adc to use VCC or the 1.1V internal bandgap as a reference, but you can also set the 1.1V bandgap as an input channel while using VCC as the reference. This configuration allows one to calculate VCC:

VCC = 1.1V * 1024 / ADC 

Why is this important for a temperature logger? What can it do if the voltage goes low? Can't you just use the brown-out detector?

For scientific research there's a real reason to measure voltage and flag when it goes below a threshold. The MAX30205 sensor has a close-to 0.1°C accuracy, but only for VCC between 2.7V and 3.3V. Below that, measurements become less accurate, so it's important to know if and when the voltage dropped below that threshold.

Given the logger's consumption, this shouldn't happen for at least 6 months, but having verification by the firmware is a bonus!


Jan wrote 05/20/2018 at 13:29 point

Very nice write-ups! You do mention a few things I should consider for my designs especially the accuracy at a given voltage range.

  Are you sure? yes | no