Skip to content
Simurq Labs

Learn

How do you lay out a PCB for an ESP32 module?

By Semih Özbir, Electrical and Electronics Engineer

Published · Last reviewed

In this guide · 10

Put the module in a board corner, its antenna hanging past the edge and its feed point at the adjacent edge. Keep copper, tracks and parts out of the antenna area and 15 mm around it, supply 3.3 V with at least 500 mA, and route USB and UART lines far from the antenna.

Where does the ESP32 module go on the board?

In a corner, with the antenna off the board. The ESP32-C3-WROOM-02 carries the chip, its crystal, its flash and a PCB antenna across its last 6 mm. Espressif's ESP32-C3 layout guide wants that antenna outside the base board, its feed point close to the board's edge, where the board disturbs it least.

The guide's placement figures mark two of five positions as strongly recommended: two corners, each with the side where the antenna is fed along the adjacent edge. On the WROOM-02 that is the side of pins 10 to 18. A module in the middle of an edge is not among them. The guide for the original ESP32 gives its modules the same rules, sentence for sentence.

If the antenna cannot hang over the edge, keep its feed point at the edge and cut the board away on both sides of the antenna and under it: Espressif's keep-out figure clears at least 15 mm beside the module and beyond the antenna. A module mid-board, in a slot cut on all four sides, is ruled out. Why a board with its antenna in the middle still passes ERC and DRC is told in Can AI design a PCB?.

Keep the antenna area clear on every layer

Espressif's FAQ asks that the antenna area and the 15 mm around it stay clean: "no copper, routing, components on it". No copper means none on the bottom or an inner layer either. The module's datasheet marks the keep-out zone on its pin layout, and its recommended land pattern, Figure 11-1, marks the antenna area.

Top view, to scale, of a board with an ESP32-C3-WROOM-02 in its top-right corner: the 6 mm antenna past the board edge, a keep-out at least 15 mm beside the module and beyond the antenna with no copper on any layer, ground vias near it, USB and UART at the far end.

An ESP32-C3-WROOM-02 in a board corner and its antenna keep-out, drawn to scale from Espressif's datasheet and hardware design guidelines.

KiCad's footprint for the module draws that area as a keep-out on every copper layer: no tracks, vias, pads, copper fill or footprints. Its edges sit 5 mm past the module, not 15. With the antenna over the board edge, both lie off the board. Over a board you do not cut away, draw the keep-out out to the full 15 mm yourself.

Inside the housing, the guide recommends at least 15 mm of clearance around the antenna in every direction, and the FAQ asks for no metal shell over the module.

Ground under the module

The module grounds through pins 9 and 19, and pin 19 is the large pad under its body. The datasheet calls soldering that pad to the base board's ground optional, but says it can improve thermal performance. Mind the paste: too much lifts the module and can weaken the joints of its other pins.

Figure 11-1 draws vias in the land for that pad. The ESP32-C3 guide asks to tie the pad to a large ground area through wide traces or a copper plane, and for enough ground copper and dense ground vias on the base board near the antenna. Near it, not under it: the keep-out still holds.

Routing the 3.3 V supply

The module runs from 3.0 to 3.6 V, and the datasheet asks the supply for at least 0.5 A (Table 6-2); transmit peaks reach 345 mA (Table 6-4). Size the regulator and the trace to pin 1, the 3.3 V pin, for that 500 mA.

The datasheet's typical application circuit, Figure 9-1, puts two capacitors on the supply but gives them no position on the base board. Inside, the module already decouples its own chip, as Figure 8-1 shows. The guides' power rules for the chip, such as main power traces no narrower than 25 mil, are for a board that carries the chip itself, like the module's own. The circuit around the module, from the enable pin's delay to the boot pins, belongs to its schematic: ESP32 schematic goes through it.

Keep USB, UART and fast signals away from the antenna

The guide's RF section wants the USB port, any USB-to-serial chip and the UART lines, with their vias, test points and header pins, as far from the antenna as possible. Crystals and fast clocks belong away from it too, and UART lines want ground copper and ground vias beside them. It gives no distance. With the module in one corner, put the USB connector and the serial chip at the far end.

When a module with an antenna connector fits better

The ESP32-C3-WROOM-02U has the same pin layout, with a connector in place of the PCB antenna, compatible with U.FL, MHF I and AMC connectors. Its datasheet marks no antenna keep-out for it. It suits a metal enclosure, which the FAQ rules out for the PCB antenna, or a board with no free corner.

The antenna is then yours to pick. The datasheet recommends a 2.4 GHz, 50 Ω antenna with no more gain than those the module was certified with, 2.33 dBi, or 1.57 dBi for the FCC. Another type or gain may need more testing, such as EMC.

ESP32 custom PCB: a module or the bare chip?

The module brings its RF design with it: the chip, a 40 MHz crystal, flash, a matching network tuned to the module's own board, and RF certification, which its datasheet lists. A board on the bare chip takes all of that on, as RF PCB design shows. Espressif's guides recommend four layers, at least nine ground vias under the chip's pad, and at least 2.0 mm between the crystal and the ESP32-C3's clock pin, 2.7 mm on the ESP32. They ask for a 50 Ω trace to the antenna, a CLC matching network to tune the chip, and a PCB antenna checked by simulation and by testing.

The module's certificates cover the module Espressif built and tested. If even a different antenna on the WROOM-02U may need more testing, a board with its own RF design needs certifying on its own.

ESP32 PCB layout in EasyEDA, KiCad or any editor

The rules are Espressif's, so they hold in any editor, EasyEDA included. In KiCad, the library footprint brings the keep-out, with the 5 mm margin above. In EasyEDA Pro, a prohibited region can bar components, tracks and copper from an area: draw one over the antenna and its 15 mm if the antenna stays on the board. Either way, the editor enforces only the area you drew, so check it against Espressif's figure. KiCad fabrication files covers what goes to the fab afterwards.

How PCB Agent's ESP32-C3 module keeps these rules

In PCB Agent's module library, the ESP32-C3-WROOM-02 carries two edge rules, each citing the ESP32-C3 guide's section on positioning a module on a base board and its placement and keep-out figures. One runs the board edge along the antenna's base, within 0.15 mm. The other runs the adjacent edge just past the copper of pins 10 to 18, at 0.25 mm, the larger of two fabs' copper-to-edge clearances. That is a corner, with the footprint's keep-out off the board. If no spot keeps both, placement stops and names the rule.

Three things have no rule. Espressif gives the supply capacitors no distance from the module, and the USB and UART lines none from the antenna. And PCB Agent's boards route ground as tracks, with no copper pour yet, so the ground copper Espressif asks for near the antenna is missing.

Limits

This covers boards built on an ESP32 module, with the ESP32-C3-WROOM-02 as the example. A design on the bare chip needs RF matching, an antenna and certification of its own, which this does not cover. A layout that keeps every rule here is not a tested antenna: Espressif asks that the finished product be tested for throughput and range, which only the built board can show, and the roadmap says where PCB Agent's own boards stand. How an AI PCB design agent works shows what each step checks.

Sources

Have a board in mind?

PCB Agent is not open to the public yet. Leave your email, and we'll write when early access starts.