Analog Comparator falling edge setup

I've now looked at the ESR meter article. The circuit does look rather complicated. It was designed in the late 1990s and is suited to the technology of the time. Essentially, it feeds pulses of a known current to the capacitor under test, discharging the capacitor more or less fully between pulses. It is assumed that the capacitor does not charge significantly, because the pulse is short and the capacitor under test is assumed to have high capacitance. It measures the pulse amplitude by amplifying it and comparing it with a ramping voltage.

I am concerned that the atmega328p datasheet provides (as far as I can tell) no data on the speed of the analog comparator, so there is no telling whether it is fast enough for this application.

An alternative would be to use the ADC to read the pulse amplitude directly. The ADC sample and hold takes nominally 1.5 ADC clock cycles. The default Arduino ADC clock is 125kHz, so this is 12us, plus an 8us uncertainty about when the sample is taken. If you increase the ADC clock frequency to 250KHz, you halve this time to 10uS total at the expense of slightly reduced accuracy. So if you write the start conversion command to the ADC and then immediately start the pulse, then if the pulse is at least 10us long you should be able to read its amplitude through the ADC.

Another option is to use a faster external A to D converter, or an external sample and hold circuit. Either way, you don't need the ramp[ generator circuit.

If you do decide to use the comparator (or an external comparator), then consider using a DtoA converter to generate the ramp instead of several transistors and resistors and a capacitor.