r/rfelectronics • u/mmoxomm • 23h ago
I asked AI to design a high-gain Yagi-Uda antenna for 2.4 GHz
This is the entire prompt I gave it, copied as I sent it:
Design a high-gain PCB Yagi antenna within a 10 cm x 15 cm area using the automaticphysics antenna-agent. Use JLCPCB's FR-4 TG135 material. Prefer a 2-layer board over a 4-layer board, and prioritize a 1.6 mm board thickness over other options. Maximize the antenna gain while maintaining sufficient bandwidth for 2.4 GHz Wi-Fi. The input impedance should be 50 Ohm. Ideally, the antenna should achieve higher gain than the TI DN034. Use the TI antenna as the baseline. If cutting holes in the PCB could improve antenna efficiency, use only circular holes to maintain mechanical rigidity. Generate a KiCad footprint for the antenna. Have fun!
TI's DN034 measures about 7.2 dBi on the same 100 x 150 mm area, using layers from a 4-layer stack. So the challenge was to beat it on a cheap 2-layer board.
What it did
It read the TI app note, kept TI's basic concept, and moved it onto 2 layers. Then it wrote a parametric KiCad generator, hooked it up to antenna-agent, an FDTD solver plugin for KiCad, and ran an evolution-strategy optimizer with 8 solves going in parallel, which kept my CPU fans screaming for about 5 hours. I said "Have fun!" and apparently it did. My CPU did not.
The highlights
- First guess: 8.7 dBi. Not bad, but it found that 26% of the power was just heating the FR-4.
- "What if we remove the FR-4?" It drilled 182 round holes in the board and got +0.4 dB. FR-4 makes a fine PCB and a poor antenna substrate.
- The backfire cliff. At one point a quarter of the candidates collapsed to about 4 dBi. Before believing it, the AI checked two mesh artifacts and ruled both out. The real cause: when a director gets slightly too long, it starts acting as a reflector, and the beam flips around and points back over the feed. Peak gain sits right next to that cliff. The fix was to also score every candidate at a "guard" frequency above the band, so the optimizer couldn't go right up to the edge.
- "What if two?" It put two Yagis side by side, fed in phase, with a shared ground plane as the reflector: +0.7 dB.
Final numbers (simulated, so take them with a grain of salt)
| Comparison | AI design (2-layer) | TI DN034 (4-layer, measured) |
|---|---|---|
| Gain 2.40 / 2.45 / 2.48 GHz | 9.7 / 9.7 / 9.5 dBi | 7.2 / 7.2 / 7.1 dBi |
| -10 dB bandwidth | 2.22-2.67 GHz | 2.13-2.62 GHz |
| Worst in-band S11 | -14.3 dB | VSWR <= 1.4 |
| Front/back | 10-13.5 dB | 14-16 dB |
That works out to about +2.2 to 2.5 dB over TI on paper. It also checked relative permittivity between 4.2 and 4.8, and the worst corner still gives 9.0 dBi realized gain with no backfire.