# Absolute Capacitance Measurement by Direct Digital Fitting of Proportional Coefficient
## 2 Measurement Principle and Simulation  
### Principles of Conventional Charge-Discharge Technology and Noise Effects  
The traditional charge-discharge method includes the constant current source method and the constant voltage source method. In the constant current source method, the circuit charges the capacitor by a constant current, which allows the voltage of the capacitor at the moment of starting and stopping to be collected, and the capacitance of the capacitor to be solved when the charging time and current are known. The circuit diagram is shown in Figure 1a. In this charging process, the growth of the charge \(Q\) is shown in Equation (1), the constant current is \(I\), the initial voltage of the capacitor \(C\) is \(U_{b}\), the ending voltage is \(U_{e}\), the starting moment of the charging process is \(t_{1}\), the ending moment is \(t_{2}\), and the discharging process is the same. \[Q=I(t_{2}-t_{1})=C(U_{e}-U_{b}) \tag{1}\]  
Figure 1: Schematic diagram of capacitance measurement by conventional charge–discharge method. (**a**) Constant current source excitation. (**b**) Constant voltage source excitation. \[C=\frac{I(t_{2}-t_{1})}{(U_{e}-U_{b})} \tag{2}\]  
In the constant voltage source method, a reference resistor is used in series with the capacitor, and the circuit inputs a constant voltage to charge the capacitor, which is also required to capture the voltage of the capacitor at the moment of starting and stopping. The circuit diagram is shown in Figure 1b. At this time, the capacitor charge changes as shown in Equation (3), the constant voltage is \(E_{0}\), \(R\) is the reference resistor resistance, \(U_{C}(t)\) is the capacitor voltage during the charging process. \[Q=C(U_{e}-U_{b})=\int_{t_{1}}^{t_{2}}\frac{E_{0}-U_{C}(t)}{R}dt \tag{3}\]  
\[U_{C}(t)=U_{b}+(E_{0}-U_{b})\left(1-e^{-\frac{(t-t_{1})}{RC}}\right) \tag{4}\]  
In the typical case, i.e., with a square wave signal input, where \(U_{b}\) is 0 and \(t_{1}\) is 0, and when the ending voltage \(U_{e}\) is used instead of \(U_{C}(t)\), the equation can be simplified as follows. \[U_{e}=E_{0}\left(1-e^{-\frac{t_{2}}{RC}}\right) \tag{5}\]  
The formula is derived to give:  
\[t=RCln\frac{E_{0}}{E_{0}-U_{e}} \tag{6}\]  
In particular, when the voltage across the capacitor rises to half the full voltage value, i.e., \(\frac{1}{2}E_{0}=U_{e}\),  
\[t=RCln2 \tag{7}\]  
When noise effects are present, the resulting capacitance value is as in Equation (8). \(\varepsilon_{1}\) is the noise effect. \[C=\frac{t\pm\varepsilon_{1}}{Rln2} \tag{8}\]  
By measuring the time of capacitor charging and discharging, the capacitance is calculated in half the time of voltage rise or fall. In this method, the starting voltage of the capacitor must be 0 or full voltage, and there is a complete charging and discharging process. When the capacitance is large, the charging of the capacitor may not be completed, and then the capacitance cannot be measured and calculated using the traditional time constant method. After simulation design, the voltage source circuit of Figure 1b is used as a simulation model. In the simulation circuit, the input signal voltage is set to 5 V, the frequency is 500 Hz, the reference resistance is 100 k\(\Omega\), and the capacitance to be measured is 1 nF. After the parameters are set, a noise source is introduced to interfere with the signal. The noise ratio of the noise source is set to 100, the resistance is set to 1 M\(\Omega\), and the bandwidth is set to 1 MHz. Under these conditions of simulated noise interference, Figure 2a shows the overall output signal, and Figure 2b shows the local signal at 2.5 V voltage at the position of the green circle in Figure 2a. In Figure 2b, it can be clearly seen that there is an error of about 6 \(\upmu\)s in the rise time when the signal rises in half position with the interference of noise, which in turn affects the measurement of capacitance.