multi-stage V divider as input to atmega16u2

Thread Starter


Joined Apr 11, 2016
Hello eveyone, i wanna monitor the voltage on a capacitor while it's discharging, but the atmega16u2 has no ADC. It has a 6-channel comparator. The + input will be the chip's internal 1.1v reference and the - input will come from 5 external pins that are connected to a 5 stage divider. Here's the illustration.
View attachment AACpost.pdf
so while the cap is discharging, the software will select one input pin at a time and check a specific bit in the ACS register ( to see the output. That way it will know right when the cap voltage is passing below any of the 5 different levels as determined by the resistor values.
My problem is that this method of checking the capacitor voltage is a PITA because i got a really tiny PCB. i wish i could find a better way so i don't have to mess with those 0402-size ( resistors.

stage voltage divider, atmega16u2, comparator, voltage sense