Building a capacitance meter is a great exercise. If you’re feeling quite safe in your digital-circuit-only life, this will push just far enough out of the comfort zone for you to see there’s nothing to fear in adding analog circuits to your designs. Here, [Raj] compares a voltage divider and RC timer to calculate the value of a capacitor. The project is aimed at teaching the concepts, and will be easy to follow for anyone who has at least a bit of experience working with a programmable microcontroller.
The meter is based on an established equation that uses are starting and ending voltage, as well as the time it took to transition between the two, to calculate capacitance. The capacitor will be charged from 0 volts to 0.5 volts. Using the built-in analog comparator is the easiest way to do this. [Raj] breadboarded a voltage divider to establish a 0.5V reference on one of the comparator’s pins. The other input comes from a circuit that places a resistor in line with the capacitor being tested. When that reading rises above the 0.5 volt reference the comparator match will be tripped, stopping a timer that had been running during the charge cycle. From there it’s just a matter of using the timer value in the calculation.