{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Calculating the Capacitance Between Pins of a Pin Header\n",
"We model the pin headers as two long parallel cylinders of conductor separated by free space. See the cross section below. \n",
"\n",
"![Cross Section of two parallel cylinders)](pin_header_model.png \"Cross Section of the Pin Header\") \n",
"\n",
"To find the capacitance, we need to put $+q$ Coulombs of charge on one pin, and $-q$ on the other; then we calculate the voltage between the two pins. The capacitance is the ratio of charge to voltage, $C = q/v$. To find the voltage between the two pins we first use Guass' law to calculate the electric field, $\\mathbf{E}$ for one long cylinder. The voltage between the two cylinders will be twice the voltage between one and where the other would be, with it removed. This is seen by symmetry. \n",
"\n",
"We calculate the electric field of a single cylinder of radius $a$. Let the charge per unit length, $l$, is $\\lambda$. The charge on a length of cylinder is then $\\lambda l$. By symmetry, the electric field is pointing perpendicular to the cylinder in the radial direction. Guass' law: $$\\int \\mathbf {E} \\cdot d \\mathbf{A} = \\frac{q_{enclosed}}{\\epsilon_0}$$ $$ E 2\\pi \\rho l = \\frac{\\lambda l}{\\epsilon_0}$$\n",
"This gives the electric field as $E = \\lambda /(2 \\pi \\epsilon_0 \\rho)$ in the radial, $\\rho$, direction. \n",
"\n",
"Finding the voltage between the two cylinders comes from integrating the electric field of one cylinder from $d-a$ to $a$ and doubling it to account for the two charged cylinders. $$ V = - \\int \\mathbf {E} \\cdot d \\mathbf{l} = -2\\int_{d-a}^{a} \\frac{\\lambda}{2\\pi \\epsilon_0 \\rho} d\\rho = \\frac{\\lambda}{\\pi \\epsilon_0} ln((d-a)/a) $$\n",
"\n",
"The capacitance per meter, $c$, is $$c = \\lambda/V = \\frac{\\pi \\epsilon_0}{ln[(d-a)/a]}$$ \n",
"Polulu kindly gives us the pin header dimensions, so we can calculate the capacitance between two pins.\n",
"\n",
"![Pin header diagram from Polulu](pin_header_dims.png \"Pin Header Dimensions\")\n",
"\n",
"So in millimeters, the lengths, $l = (3 +2.5 + 6)$, $a = 0.65/2$, $d = 2.54$. Note the units don't matter for $a$ and $d$, because they cancel. Using $C = cl$ for the capacitance, we get."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The capacitance between pins of a pin header is: 0.16667518881411675 pF.\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"l = (3 + 2.5 + 6)/1000 # convert to meters\n",
"a = 0.65/2\n",
"d = 2.54\n",
"epsilon0 = 8.854e-12\n",
"c = (np.pi * epsilon0)/np.log((d-a)/a)\n",
"C = c*l\n",
"print('The capacitance between pins of a pin header is: ', C*1e12, 'pF.')\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}