Step 1: Some Boring Theory
When an uncharged capacitor is connected to a DC power supply through a
resistor, the voltage across it increases exponential way until it reaches the voltage of the power source.
The voltage in in fuction of time and time in function of Vc is described by the formulas:
Actually the last will give us negative values of the time but will use the absolute value of it. For easy calculation ln(1 - Vc/Vs) shouls be equal -1 and this condition is met when the Vc = 0.6324Vs
Step 2: Measurement
In my setup the the unknown capacitor is in the range of uF. R = 200.8Ohm
(measured with the multimeter). One of the oscilloscope channels is connected to the measured capacitor. The square wave source generates 100Hz signal. The frequency of the signal has to be low enough to see the whole voltage swing.
Python script generating the 100Hz square wave:
from UniversalZeroPlus import UZP uzp0 = UZP(SPIspeed = 16000000) ports0 = [uzp0.PWM19] freq = 100 uzp0.SafeMode(1) uzp0.PWMInit(ports0) uzp0.PWMFrequencyDuty(ports0, frequency = freq, duty = 50) uzp0.PWMStart(ports0)
As you see this method is quite precise and quick. The whole measurement
does not take more than 2-3 minutes (including the hardware setup).