---
title: "Project: a patch antenna and its link"
heading: Designing a microstrip patch from first principles, feeding it, computing its directivity, and closing a link
eyebrow: S5 · Lesson 51 · Patch antenna project
xp: 80
---

::: hook
This project carries one antenna from specification to link budget, the way an RF engineer would before committing a board to fabrication. You'll size a rectangular microstrip patch with the transmission-line model, compute the conductance of its two radiating slots by integrating their fields (including the mutual coupling through a Bessel function), place an inset feed to match 50 Ω, compute the patch's directivity from a double integral over the sphere, and finally predict the power a link between two patches delivers. Each step is checked against Balanis's worked design at 10 GHz, so you'll know your numbers are right before trusting them on your own.
:::

::: predict
## A patch's radiating edge presents about 228 Ω. Where along its length does a feed see 50 Ω?

- [ ] At the edge
- [ ] Exactly at the center
- [x] About a third of the way to the center
- [ ] At a quarter of the length

::: reveal
The input resistance falls as $\cos^2(\pi y_0/L)$ from the edge toward the center, where the voltage is zero. Solving $228\cos^2(\pi y_0/L) = 50$ gives $\pi y_0/L$ = 1.084 rad, so $y_0$ = 0.345L: 3.12 mm into a 9.05 mm patch. An inset feed cuts a notch that far into the patch so a 50 Ω line reaches the matching point.
:::
:::

::: nameit
## Step 1: dimensions

Lesson 39's transmission-line model gives W, $\varepsilon_\text{eff}$, ΔL and L from f, $\varepsilon_r$ and h.

## Step 2: slot conductances and the feed

Each radiating edge is a slot of width W. Its conductance, and the mutual conductance between the two slots (a distance L apart), are (Balanis)

$$G_1 = \frac{I_1}{120\pi^2}, \quad I_1 = \int_0^\pi\left[\frac{\sin\left(\frac{kW}{2}\cos\theta\right)}{\cos\theta}\right]^2\sin^3\theta\,d\theta$$

$$G_{12} = \frac{1}{120\pi^2}\int_0^\pi\left[\frac{\sin\left(\frac{kW}{2}\cos\theta\right)}{\cos\theta}\right]^2J_0(kL\sin\theta)\sin^3\theta\,d\theta$$

with $J_0(x) = \frac{1}{\pi}\int_0^\pi\cos(x\sin t)\,dt$. The edge resistance is $R_\text{in} = \frac{1}{2(G_1 + G_{12})}$, and the inset depth for $Z_0$ is $y_0 = \frac{L}{\pi}\arccos\sqrt{Z_0/R_\text{in}}$.

## Step 3: directivity and the link

Treating the patch as two slots a distance $L_e = L + 2\Delta L$ apart,

$$D_2 = \frac{(kW)^2\pi}{I_2}, \quad I_2 = \int_0^\pi\!\!\int_0^\pi\left[\frac{\sin\left(\frac{kW}{2}\cos\theta\right)}{\cos\theta}\right]^2\sin^3\theta\cos^2\left(\frac{kL_e}{2}\sin\theta\sin\phi\right)d\theta\,d\phi$$

A useful check: with the slot spacing set to L, the double integral reduces exactly to $D_0\frac{2}{1 + G_{12}/G_1}$, where $D_0 = \frac{(kW)^2}{120\pi^2G_1}$ is one slot's directivity. Finally, Friis gives the received power between two such patches.
:::

::: example
## Work Balanis's 10 GHz design (εr = 2.2, h = 1.588 mm) through all three steps.

::: solution
1. **Dimensions (step 1).**
   $$\begin{aligned} W &= 11.85\ \text{mm} \\ \varepsilon_\text{eff} &= 1.972 \\ \Delta L &= 0.811\ \text{mm} \\ L &= 9.053\ \text{mm} \end{aligned}$$
2. **Feed (step 2).** $G_1$ = 1.572 mS and $G_{12}$ = 0.617 mS, so
   $$R_\text{in} = 228.4\ \Omega$$
   and the 50 Ω inset is 3.12 mm deep.
3. **One slot's directivity (step 3).** One slot has $D_0$ = 3.31 (5.20 dBi).
4. **Both slots' directivity.** The two slots, $L_e$ = 10.68 mm apart, give $D_2$ = 5.44, which is 7.35 dBi.

**Answer:** L = 9.053 mm and W = 11.85 mm, $R_\text{in}$ = 228.4 Ω with a 3.12 mm inset, and a directivity of 5.44 (7.35 dBi).
:::
:::

::: example
## Two patches with this 7.35 dBi gain face each other 100 m apart at 2.4 GHz, with 10 dBm transmitted. What arrives?

::: solution
1. **Path loss.** At 100 m and 2.4 GHz:
   $$\begin{aligned} L &= 20\log_{10}\frac{4\pi \times 100}{0.1249} \\ &= 80.05\ \text{dB} \end{aligned}$$
2. **Received power.**
   $$\begin{aligned} P_r &= (10 + 2 \times 7.35 - 80.05)\ \text{dBm} \\ &= -55.4\ \text{dBm} \end{aligned}$$
3. **Margin.** That's plenty for a low-rate radio with −95 dBm sensitivity, leaving about 40 dB of margin for walls, misalignment and fading.

**Answer:** −55.4 dBm arrives.
:::
:::

::: check
kind: python

## Step 1. Write `patch_design(f, er, h)`: the patch's dimensions.

```python starter
import numpy as np
C = 299792458.0

def patch_design(f, er, h):
    # Return {'W': ..., 'eeff': ..., 'dL': ..., 'L': ...} in meters (eeff dimensionless),
    # by the transmission-line model.
    return {'W': 0.0, 'eeff': 1.0, 'dL': 0.0, 'L': 0.0}

print(patch_design(10e9, 2.2, 1.588e-3))
```

```python solution
import numpy as np
C = 299792458.0

def patch_design(f, er, h):
    W = C / (2 * f) * np.sqrt(2 / (er + 1))
    ee = (er + 1) / 2 + (er - 1) / 2 / np.sqrt(1 + 12 * h / W)
    dL = 0.412 * h * (ee + 0.3) * (W / h + 0.264) / ((ee - 0.258) * (W / h + 0.8))
    L = C / (2 * f * np.sqrt(ee)) - 2 * dL
    return {'W': W, 'eeff': ee, 'dL': dL, 'L': L}

print(patch_design(10e9, 2.2, 1.588e-3))
```

```python tests
d = patch_design(10e9, 2.2, 1.588e-3)
want = {'W': 11.8503e-3, 'eeff': 1.97153, 'dL': 0.81105e-3, 'L': 9.05343e-3}
for k, v in want.items():
    assert abs(d[k] / v - 1) < 1e-4, f"Balanis's 10 GHz design: {k} should be {v}; got {d[k]}."
d = patch_design(2.4e9, 4.4, 1.6e-3)
assert abs(d['W'] / 38.00997e-3 - 1) < 1e-4 and abs(d['L'] / 29.42159e-3 - 1) < 1e-4, f"FR-4 at 2.4 GHz: W = 38.01 mm, L = 29.42 mm; got {d['W']*1e3:.3f} and {d['L']*1e3:.3f} mm."
```

::: right
Right. Four lines of the transmission-line model reproduce Balanis's design to five figures.
:::
:::

::: check
kind: python

## Step 2. Write `j0`, `conductances` and `inset_depth`: the slot conductances, the edge resistance and the 50 Ω feed point.

```python starter
import numpy as np
C = 299792458.0

def patch_design(f, er, h):
    W = C / (2 * f) * np.sqrt(2 / (er + 1))
    ee = (er + 1) / 2 + (er - 1) / 2 / np.sqrt(1 + 12 * h / W)
    dL = 0.412 * h * (ee + 0.3) * (W / h + 0.264) / ((ee - 0.258) * (W / h + 0.8))
    L = C / (2 * f * np.sqrt(ee)) - 2 * dL
    return {'W': W, 'eeff': ee, 'dL': dL, 'L': L}

def j0(x):
    # Bessel J0 by its integral: (1/pi) * integral over t from 0 to pi of cos(x sin t).
    return np.ones_like(np.atleast_1d(x), dtype=float)

def conductances(W, L, f, n=4001):
    # G1 = I1/(120 pi^2), I1 = integral over theta of [sin(kW/2 cos th)/cos th]^2 sin^3 th;
    # G12 = the same integral weighted by J0(k L sin th), over 120 pi^2.
    return 0.0, 0.0

def inset_depth(L, G1, G12, Z0=50.0):
    # Edge resistance 1/(2(G1 + G12)); depth where R cos^2(pi y0 / L) = Z0.
    return 0.0

d = patch_design(10e9, 2.2, 1.588e-3)
print(conductances(d['W'], d['L'], 10e9))
```

```python solution
import numpy as np
C = 299792458.0

def patch_design(f, er, h):
    W = C / (2 * f) * np.sqrt(2 / (er + 1))
    ee = (er + 1) / 2 + (er - 1) / 2 / np.sqrt(1 + 12 * h / W)
    dL = 0.412 * h * (ee + 0.3) * (W / h + 0.264) / ((ee - 0.258) * (W / h + 0.8))
    L = C / (2 * f * np.sqrt(ee)) - 2 * dL
    return {'W': W, 'eeff': ee, 'dL': dL, 'L': L}

def j0(x):
    t = np.linspace(0, np.pi, 801)
    return np.trapezoid(np.cos(np.multiply.outer(np.atleast_1d(x), np.sin(t))), t, axis=-1) / np.pi

def conductances(W, L, f, n=4001):
    k = 2 * np.pi * f / C
    th = np.linspace(1e-6, np.pi - 1e-6, n)
    base = (np.sin(k * W / 2 * np.cos(th)) / np.cos(th)) ** 2 * np.sin(th) ** 3
    G1 = np.trapezoid(base, th) / (120 * np.pi ** 2)
    G12 = np.trapezoid(base * j0(k * L * np.sin(th)), th) / (120 * np.pi ** 2)
    return G1, G12

def inset_depth(L, G1, G12, Z0=50.0):
    Rin = 1 / (2 * (G1 + G12))
    return L / np.pi * np.arccos(np.sqrt(Z0 / Rin))

d = patch_design(10e9, 2.2, 1.588e-3)
print(conductances(d['W'], d['L'], 10e9))
```

```python tests
d = patch_design(10e9, 2.2, 1.588e-3)
G1, G12 = conductances(d['W'], d['L'], 10e9)
assert abs(G1 / 1.57243e-3 - 1) < 2e-3, f"G1 should be 1.572 mS (Balanis: 1.57 mS); got {G1*1e3:.4f} mS."
assert abs(G12 / 6.1683e-4 - 1) < 2e-3, f"G12 should be 0.6168 mS (Balanis: 0.61683 mS); got {G12*1e3:.5f} mS."
assert abs(1 / (2 * (G1 + G12)) - 228.4) < 0.5, f"The edge resistance should be 228.4 Ω; got {1/(2*(G1 + G12)):.2f}."
y0 = inset_depth(d['L'], G1, G12)
assert abs(y0 * 1e3 - 3.1236) < 0.01, f"The 50 Ω inset should reach 3.124 mm (Balanis: 3.126 mm); got {y0*1e3:.4f} mm."
assert abs(j0(2.404825557695773)) < 1e-6 and abs(j0(0.0) - 1) < 1e-9, "j0 should be 1 at 0 and vanish at its first zero, 2.4048."
```

::: right
Right. Two integrals give the radiating slots' conductances; their sum sets the 228 Ω edge resistance, and the inset that brings it to 50 Ω lands 3.12 mm in, as in Balanis's design.
:::
:::

::: check
kind: python

## Step 3. Write `directivity_two_slot` and `link_dbm`: the patch's directivity and a link between two of them.

```python starter
import numpy as np
C = 299792458.0

def patch_design(f, er, h):
    W = C / (2 * f) * np.sqrt(2 / (er + 1))
    ee = (er + 1) / 2 + (er - 1) / 2 / np.sqrt(1 + 12 * h / W)
    dL = 0.412 * h * (ee + 0.3) * (W / h + 0.264) / ((ee - 0.258) * (W / h + 0.8))
    L = C / (2 * f * np.sqrt(ee)) - 2 * dL
    return {'W': W, 'eeff': ee, 'dL': dL, 'L': L}

def j0(x):
    t = np.linspace(0, np.pi, 801)
    return np.trapezoid(np.cos(np.multiply.outer(np.atleast_1d(x), np.sin(t))), t, axis=-1) / np.pi

def conductances(W, L, f, n=4001):
    k = 2 * np.pi * f / C
    th = np.linspace(1e-6, np.pi - 1e-6, n)
    base = (np.sin(k * W / 2 * np.cos(th)) / np.cos(th)) ** 2 * np.sin(th) ** 3
    G1 = np.trapezoid(base, th) / (120 * np.pi ** 2)
    G12 = np.trapezoid(base * j0(k * L * np.sin(th)), th) / (120 * np.pi ** 2)
    return G1, G12

def directivity_two_slot(W, Le, f, n=801):
    # D2 = (kW)^2 * pi / I2, I2 = double integral over theta and phi (both 0..pi) of
    # [sin(kW/2 cos th)/cos th]^2 sin^3 th cos^2(k Le/2 sin th sin phi).
    return 1.0

def link_dbm(pt_dbm, g_dbi, f, R):
    # Received power between two identical antennas of gain g_dbi, R meters apart (Friis).
    return pt_dbm

d = patch_design(10e9, 2.2, 1.588e-3)
print(directivity_two_slot(d['W'], d['L'] + 2 * d['dL'], 10e9))
```

```python solution
import numpy as np
C = 299792458.0

def patch_design(f, er, h):
    W = C / (2 * f) * np.sqrt(2 / (er + 1))
    ee = (er + 1) / 2 + (er - 1) / 2 / np.sqrt(1 + 12 * h / W)
    dL = 0.412 * h * (ee + 0.3) * (W / h + 0.264) / ((ee - 0.258) * (W / h + 0.8))
    L = C / (2 * f * np.sqrt(ee)) - 2 * dL
    return {'W': W, 'eeff': ee, 'dL': dL, 'L': L}

def j0(x):
    t = np.linspace(0, np.pi, 801)
    return np.trapezoid(np.cos(np.multiply.outer(np.atleast_1d(x), np.sin(t))), t, axis=-1) / np.pi

def conductances(W, L, f, n=4001):
    k = 2 * np.pi * f / C
    th = np.linspace(1e-6, np.pi - 1e-6, n)
    base = (np.sin(k * W / 2 * np.cos(th)) / np.cos(th)) ** 2 * np.sin(th) ** 3
    G1 = np.trapezoid(base, th) / (120 * np.pi ** 2)
    G12 = np.trapezoid(base * j0(k * L * np.sin(th)), th) / (120 * np.pi ** 2)
    return G1, G12

def directivity_two_slot(W, Le, f, n=801):
    k = 2 * np.pi * f / C
    th = np.linspace(1e-6, np.pi - 1e-6, n)
    ph = np.linspace(0, np.pi, n)
    T, P = np.meshgrid(th, ph, indexing='ij')
    g = (np.sin(k * W / 2 * np.cos(T)) / np.cos(T)) ** 2 * np.sin(T) ** 3 * np.cos(k * Le / 2 * np.sin(T) * np.sin(P)) ** 2
    I2 = np.trapezoid(np.trapezoid(g, ph, axis=1), th)
    return (k * W) ** 2 * np.pi / I2

def link_dbm(pt_dbm, g_dbi, f, R):
    lam = C / f
    return pt_dbm + 2 * g_dbi - 20 * np.log10(4 * np.pi * R / lam)

d = patch_design(10e9, 2.2, 1.588e-3)
print(directivity_two_slot(d['W'], d['L'] + 2 * d['dL'], 10e9))
```

```python tests
d = patch_design(10e9, 2.2, 1.588e-3)
G1, G12 = conductances(d['W'], d['L'], 10e9)
k = 2 * np.pi * 10e9 / C
D0 = (k * d['W']) ** 2 / (G1 * 120 * np.pi ** 2)
D2L = directivity_two_slot(d['W'], d['L'], 10e9)
assert abs(D2L / (D0 * 2 / (1 + G12 / G1)) - 1) < 2e-3, f"With slot spacing L, the double integral must equal D0·2/(1 + g12) = {D0*2/(1 + G12/G1):.4f}; got {D2L:.4f}."
D2 = directivity_two_slot(d['W'], d['L'] + 2 * d['dL'], 10e9)
assert abs(D2 - 5.4377) < 0.01, f"With Le = L + 2ΔL, the directivity should be 5.438 (7.35 dBi); got {D2:.4f}."
p = link_dbm(10, 7.35, 2.4e9, 100)
assert abs(p - (10 + 14.7 - 80.052)) < 0.01, f"10 dBm between two 7.35 dBi patches 100 m apart at 2.4 GHz should arrive at -55.35 dBm; got {p:.2f}."
```

::: right
Right. The double integral, checked against the conductance formula, gives the patch 7.35 dBi, and Friis turns that into a link budget.
:::
:::

::: explain
## Why does the mutual conductance between a patch's two edges raise its input conductance and lower its directivity?

::: model
The two radiating edges of a patch are fed by the same resonant field and radiate in phase, so their far fields add, and each edge also sits in the near field of the other. The power the pair radiates is not simply twice what one edge alone would radiate: the cross term between their fields adds power when they're close enough to interact, and that extra radiated power shows up as the mutual conductance $G_{12}$, raising the total conductance the feed sees and lowering the edge resistance. Directivity is peak intensity over average intensity; the broadside peak doubles with two in-phase slots, but the total power rises by more than a factor of two when $G_{12}$ is positive, so the directivity gain from the second slot is $2/(1 + g_{12})$ instead of a full factor of 2.
:::
:::

::: practice

::: check
given: G = 1 | 1.6 | 2.5; M = 0.3 | 0.6
answer: 1/(2*(G + M)*1e-3)
unit: Ω
tolerance: 0.5%

## Edge resistance with $G_1$ = {G} mS and $G_{12}$ = {M} mS?

::: misses
- [any] $1/(2(G_1 + G_{12}))$.
:::
:::

::: check
given: D = 3 | 3.3 | 4; g = 0.2 | 0.4
answer: D*2/(1 + g)
tolerance: 0.5%

## Two-slot directivity from $D_0$ = {D} and $g_{12}$ = {g}?

::: misses
- [any] $D_0 \cdot 2/(1 + g_{12})$.
:::
:::

::: check
given: x = 0.5 | 1.5 | 2.4048
answer: J0(x)
tolerance: 0.0005

## What's $J_0(\given{x})$?

::: misses
- [any] $\frac{1}{\pi}\int_0^\pi\cos(x\sin t)\,dt$.
:::
:::
:::
