ESP32 PCB design: antenna keep-out, power and boot pins that actually work
Put the module at the board edge, with its PCB antenna hanging past the edge. Keep every copper layer away from the antenna. Feed it from a 3.3 V rail that can supply at least 500 mA. Those three choices fix most ESP32 boards with poor range or random resets. The rest is getting the boot and USB pins right for your exact chip.
Module or chip-down
Use a module for your first ESP32 board, and probably for your fifth too. A module such as the ESP32-S3-WROOM-1 or ESP32-C6-WROOM-1 already contains the crystal, the flash memory and a tuned antenna. It also has the RF matching network (parts that tune the signal path to the antenna). You get a radio that is known to work. Your only job is to not spoil it with your layout.
There's also paperwork. The module may already hold the radio certifications for the market you sell into. If it does, your product's certification job gets a lot smaller. A chip-down design (the bare chip soldered onto your own board) starts that work from zero.
Chip-down makes sense in a few cases: you're building thousands of units, you need a shape no module fits, or you want the antenna in a specific place. You pay for it with RF tuning, a controlled-impedance stack-up (layers built so traces have a set impedance) and test equipment. Modules with a "U" suffix (for example ESP32-S3-WROOM-1U) swap the PCB antenna for an antenna connector. That is the easy answer when the board has to live inside a metal box.
Where the module goes, and what stays away from the antenna
Espressif's hardware design guidelines are clear about the preferred layout. The antenna end of the module sits outside the base board. The antenna feed point (where the signal enters the antenna) is closest to the board edge. If there is board material under the antenna, the guidelines recommend cutting it away.
Sometimes the antenna can't overhang. Then the ESP32-S3 and ESP32-C6 guidelines recommend at least 15 mm of clearance in all directions around the antenna area. That space must have no copper, routing or components. That is a lot of board, so overhanging (or a cut-out) is the usual answer.
Older modules had different numbers: the ESP-WROOM-02 guide asked for 5 mm. Take the keep-out (the area that must stay empty) from the datasheet drawing for the module you're actually placing.
The mistakes that show up again and again:
- A keep-out drawn on the top layer only. The ground pour (a filled copper area) on the bottom or an inner layer still floods under the antenna. In KiCad, make the rule area apply to all copper layers. Set it to forbid pours, tracks, vias and pads.
- The module placed in the middle of the board because the routing was easier there.
- A mounting screw, coin cell, buzzer or USB connector shell sitting right next to the antenna.
- Ground stitching vias scattered into the keep-out by an automatic via-fence tool.
Ground plane and stitching vias
The antenna needs a solid ground under the rest of the module to work against. Pour ground under the module body on every layer. Connect the module's exposed ground pad; Espressif notes it also carries heat away. Then add plenty of stitching vias (small plated holes that tie the top and bottom pours together).
The ESP32-C6 guide asks for enough ground copper and dense ground vias on the base board near the antenna.
On a two-layer board, keep the bottom layer as close to an unbroken ground plane as you can, under and around the module. A single signal trace cutting across it can split the return path (the route the current takes back to its source). If the board is getting crowded, use a four-layer build with a solid ground on layer 2. It is cheap now and makes this much easier; see our 4-layer stack-up guide.
Power: size the rail for transmit bursts
Wi-Fi transmit draws several hundred milliamps in short bursts. The exact figures are in the RF current consumption table of your chip's datasheet. Espressif's ESP32-S3 guidelines recommend a 3.3 V supply with a maximum output current of at least 500 mA. They also ask for an ESD protection diode (it guards against static discharge) and at least 10 µF at the power entrance.
A regulator that is too small, or a supply trace that is too thin, gives a classic symptom. The board boots, then resets the moment Wi-Fi connects. The rail sags and the brownout detector (a circuit that resets the chip when the voltage drops too low) fires.
Check the regulator's rated current and its dropout (the smallest gap it needs between input and output voltage) at your input voltage. Also check the trace width from the regulator to the module.
Put the decoupling capacitors (small capacitors that steady the supply) near the power pins. Place a ground via right at each capacitor's ground pad, as Espressif's layout guide suggests. With a module, follow the reference schematic in the module datasheet. Some decoupling is already inside the can (the module's metal shield).
The EN pin needs a delay
EN on a module (CHIP_PU on the bare chip) must rise after the supply has settled. Espressif's ESP32-S3 checklist suggests an RC delay of R = 10 kΩ and C = 1 µF, adjusted to your supply's rise time. It also says the pin must never float (be left unconnected).
Your supply may rise slowly or bounce, for example with battery charging, solar or frequent power cycling. In that case Espressif recommends a supply supervisor (a chip that holds reset until the voltage is good) instead of relying on the RC alone.
Boot, strapping and USB pins differ by family
Strapping pins are read once at reset to choose the boot mode and a few hardware options. If you connect the wrong pull-up resistor or peripheral to one, the board won't boot, or it boots into the wrong mode. This table is a starting point. Check every pin against the boot-mode and datasheet pages for your chip.
| Family | Enter download mode | Other straps to watch | Native USB (D- / D+) |
|---|---|---|---|
| ESP32 (original) | GPIO0 low at reset | GPIO12 (MTDI) picks flash voltage, high = 1.8 V; also GPIO2, GPIO5, GPIO15 | None; needs a USB-UART bridge |
| ESP32-S3 | GPIO0 low, GPIO46 low or floating | GPIO45 selects VDD_SPI voltage; GPIO3 only if the JTAG-select eFuse is set | GPIO19 / GPIO20 |
| ESP32-C3 | GPIO9 low with GPIO8 high | GPIO2 | GPIO18 / GPIO19 |
| ESP32-C6 | GPIO9 low with GPIO8 high | GPIO15 (JTAG source), MTMS (GPIO4), MTDI (GPIO5) | GPIO12 / GPIO13 |
Espressif's esptool docs flag two combinations as invalid. One is GPIO0 low with GPIO46 high on the S3. The other is GPIO8 and GPIO9 both low on the C3 and C6.
The GPIO12 trap on the original ESP32 is well known for a reason. A pull-up there selects 1.8 V flash, so a module with 3.3 V flash then fails to read it.
For native USB, route D+ and D- as a short, matched pair. Don't share those pins with anything else; Espressif's JTAG docs warn that other hardware on them can disturb the connection. Keep a BOOT button even on USB-only boards.
If your firmware reconfigures the USB pins, the device disappears from the host. The only way back is manual download mode. On the C3, hold GPIO9 low and reset.
Chip-down: copy the reference design exactly
If you do put the bare chip on your board, treat that chip's hardware design guidelines as the specification, not a suggestion. These are the parts people get wrong:
- Crystal: the ESP32-S3 firmware supports only a 40 MHz crystal, within ±10 ppm. Keep it close to the chip, over solid ground, with ground vias around the clock trace.
- RF trace: design it for 50 Ω against the adjacent reference plane (the solid copper layer next to it). Use your fab's real stack-up. Our trace impedance calculator gives a starting width.
- Matching network: lay out the CLC pi network (capacitor, inductor, capacitor) from the reference design with all pads populated. Expect to retune the values on your board with a network analyzer.
- Grounding: the original ESP32 guide asks for at least nine vias from the chip's ground pad to the plane. It also asks for dense via stitching along both sides of the RF trace.
- Flash supply: the S3 guide adds 0.1 µF and 1 µF decoupling right at VDD_SPI.
Then budget for certification testing. That bill is usually what sends people back to modules.
Enclosures, and how to know it works
The housing is part of the antenna. Plastic shifts the tuning a little. Metal, a battery pack or a display right over the antenna can ruin it. Espressif's guidelines tell you to allow for interference from the housing. They also say to test throughput and range on the final product, not the bare board.
Here is a quick, honest test. Put a known-good dev kit and your board in the same spot, and connect both to the same access point. Log RSSI (received signal strength) from esp_wifi_sta_get_ap_info() on each.
If your board reads far weaker than the dev kit (say 10 dB or more), look at the layout before blaming the router. Repeat with the board in its enclosure, then walk away until each drops the link. If range alone isn't convincing, ESP-IDF's iperf example gives you throughput numbers.
Before you order, open the Gerbers in a 3D Gerber viewer such as Gerber3D. Check every copper layer under the antenna. A stray inner-layer pour is easy to miss in the PCB editor. It is obvious once the layers are pulled apart.
If you're building a LoRa node next, the same rules apply to custom Meshtastic boards.
Questions
How much clearance does an ESP32 PCB antenna need?
Espressif's preferred layout puts the module's antenna past the board edge. If it has to sit over the board, the ESP32-S3 and ESP32-C6 guidelines recommend at least 15 mm of clearance in all directions with no copper, traces or components on any layer. Always check the keep-out drawing in your exact module's datasheet.
Can I put a ground plane under the ESP32 antenna?
No. Copper under the antenna area on any layer, including inner layers, detunes it and cuts range. Keep ground under the module body and stitch it with vias, but leave the antenna area bare or cut the board away.
What RC values should I use on the ESP32 EN pin?
Espressif's ESP32-S3 checklist suggests R = 10 kΩ and C = 1 µF on CHIP_PU (the EN pin on modules), adjusted for your supply's rise time. Never leave it floating, and use a supervisor chip if the supply rises slowly, as with battery charging or solar.
Why does my ESP32 board reset when Wi-Fi connects?
Usually the 3.3 V rail sags during the transmit bursts and trips the brownout detector. Espressif recommends a supply that can deliver at least 500 mA for the ESP32-S3, plus at least 10 µF at the power entrance.
Does an ESP32-S3 board need a USB-to-serial chip?
Not for flashing or a serial console. The ESP32-S3, ESP32-C3 and ESP32-C6 have a built-in USB Serial/JTAG controller on fixed pins. The original ESP32 has no USB and needs a bridge chip.
Sources
- ESP32-S3 Hardware Design Guidelines: PCB Layout Design (Espressif)
- ESP32-S3 Hardware Design Guidelines: Schematic Checklist (Espressif)
- ESP32-C6 Hardware Design Guidelines: PCB Layout Design (Espressif)
- esptool: Boot Mode Selection, ESP32-S3 (Espressif)
- esptool: Boot Mode Selection, ESP32-C6 (Espressif)
- ESP-IDF: Configure ESP32-C3 Built-in JTAG Interface (Espressif)
- ESP-IDF: Configure ESP32-C6 Built-in JTAG Interface (Espressif)
- ESP8266 Hardware Design Guidelines (Espressif)