How to compute actual crystal load capacitance in Python using UliEngineering

You can easily compute the actual load capacitance of a crystal given your external capacitors and parasitic capacitances using the UliEngineering Python library:

actual_load_capacitance.py
from UliEngineering.Electronics.Crystal import *
from UliEngineering.EngineerIO import *

# Compute actual load capacitance with 5pF external capacitors
cl = actual_load_capacitance("5pF")
print(f"Actual load capacitance (5pF external): {format_value(cl, 'F')}")

# Compute with custom pin and stray capacitance
cl = actual_load_capacitance("10pF", cpin="4pF", cstray="3pF")
print(f"Actual load capacitance (10pF, cpin=4pF, cstray=3pF): {format_value(cl, 'F')}")

Example output

actual_load_capacitance_output.txt
Actual load capacitance (5pF external): 7.50 pF
Actual load capacitance (10pF, cpin=4pF, cstray=3pF): 15.0 pF

This post computes the actual load capacitance seen by the crystal given your external capacitors and parasitic capacitances. If you need to compute the required external capacitors to achieve a target load capacitance, see this related post.

The actual load capacitance is computed using the formula: $C_L = \frac{C_{ext}^2}{2 \cdot C_{ext} + C_{pin}} + C_{stray}$, which accounts for the series combination of the two external capacitors plus the stray capacitance.


Check out similar posts by category: Electronics, Python