multi-stage V divider as input to atmega16u2

Thread Starter

mikewax

Joined Apr 11, 2016
178
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 (http://www.avrbeginners.net/architecture/ana_comp/ana_comp.html) 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 (http://www.resistorguide.com/resistor-sizes-and-packages/) resistors.

stage voltage divider, atmega16u2, comparator, voltage sense
 
Top