ESR meter with Arduino

When you use a resistor to charge-up a capacitor, the current goes down as the capacitor is charging up, exponentially. This is less of a problem initially; but as the capacitor is charged up, the error (from a linear charging up process produced by a ccs) gets bigger (small resistor or small capacitor, or long charge-up time / cycle).

One way to solve this is to taylor-expand the integral of current over time. You only need to expand to its 2nd order derivative to maintain fairly good accuracy.