Draw a WiFi Antenna
Use <antenna /> with antennaShape for a
generated PCB antenna. Use pcbPath instead when you have copper coordinates
from a validated reference design or RF simulation. Define a one-pad footprint
for its feed, place the feed with pcbX and pcbY, and enter the custom
geometry in feed-local coordinates.
export default () => (
<board width="32mm" height="18mm" minTraceWidth="0.3mm">
<chip
name="U1"
manufacturerPartNumber="ESP32-C3"
footprint="qfn32_w5mm_h5mm_p0.5mm_thermalpad3.7x3.7mm"
pinLabels={{ pin1: "LNA_IN" }}
pcbX={-12}
schX={-8}
/>
<capacitor
name="C11"
capacitance="1.5pF"
footprint="0201"
pcbX={-9}
pcbY={2}
schX={-4}
schY={2}
/>
<inductor
name="L2"
inductance="2.4nH"
footprint="0201"
pcbX={-7}
schX={0}
/>
<capacitor
name="C12"
capacitance="1.5pF"
footprint="0201"
pcbX={-5}
pcbY={2}
schX={4}
schY={2}
/>
<antenna
name="ANT1"
pcbX={-3}
pcbY={-1}
schX={8}
footprint={
<footprint>
<smtpad
shape="rect"
width="1mm"
height="1mm"
portHints={["pin1"]}
/>
</footprint>
}
pcbPath={[
{ x: 1, y: 0 },
{ x: 1, y: 5 },
{ x: 12, y: 5 },
{ x: 12, y: 3.5 },
{ x: 3, y: 3.5 },
{ x: 3, y: 2 },
{ x: 12, y: 2 },
{ x: 12, y: 0.5 },
{ x: 3, y: 0.5 },
{ x: 3, y: -1 },
{ x: 12, y: -1 },
]}
/>
<trace from=".U1 > .LNA_IN" to=".L2 > .pin1" />
<trace from=".C11 > .pin1" to=".L2 > .pin1" />
<trace from=".C11 > .pin2" to="net.GND" />
<trace from=".L2 > .pin2" to=".ANT1 > .feed" />
<trace from=".C12 > .pin1" to=".L2 > .pin2" />
<trace from=".C12 > .pin2" to="net.GND" />
</board>
)
The antenna route begins at the footprint's pin1 pad automatically. Each
coordinate object is measured in millimeters relative to that feed, so changing
pcbX, pcbY, or pcbRotation moves the footprint and copper shape together.
The separate <trace /> elements connect an ESP32-C3-style RF output and CLC
matching network to the antenna's feed alias. This is only the RF fragment;
the rest of the radio support circuit is omitted. Matching values are specific
to the stackup, layout, and antenna, so tune them for the finished board.
Set minTraceWidth on the board or subcircuit to control the antenna copper
width. The path can also use selector strings and via entries supported by
<trace pcbPath>.
This meander is an API example, not a tuned 2.4 GHz antenna. Copy dimensions,
board stackup, feed impedance, and ground-clearance requirements from a
validated antenna design. Use a <keepout /> to
preserve the required copper-free region.