DEV Community

Cover image for Your Custom ESP32 Board Probably Fails on the PCB, Not in the Firmware
Dibyaprakash Pradhan
Dibyaprakash Pradhan

Posted on Originally published at pcbeditor.com AI-assisted

Your Custom ESP32 Board Probably Fails on the PCB, Not in the Firmware

The first custom ESP32 board most people make works on the bench and misbehaves everywhere else. The Wi-Fi range is half what the dev board had. The chip resets the moment it tries to connect. Or it never boots at all, and the serial monitor shows nothing. Everyone's first instinct is the firmware. On a custom board it is almost always the PCB.

I build an AI PCB tool, so I spend a lot of time looking at ESP32 boards, generated and hand-drawn, and the same five mistakes show up again and again. Here they are, in the order they tend to bite.

1. Copper under the antenna

An ESP32 module has its antenna printed on its own little board, and that antenna only works if your board leaves it alone. Copper near it, on any layer, detunes it. Every module datasheet has a keep-out drawing for exactly this, and Espressif's layout advice is always the same: put the module on an edge of your board so the antenna sits at or past the edge, with nothing under or around it.

Top view of a routed two-layer ESP32-S3-WROOM-1 board in KiCad, antenna on the top edge with a copper-free keep-out band either side
A routed two-layer ESP32-S3 board in KiCad: the antenna sits on the board edge with no copper beside or under it, and USB and power come in from the opposite edge.

The way this goes wrong is innocent. You pour ground on both layers because a ground pour is good practice, and the pour fills straight under the antenna. The board works next to the router and drops out two rooms away. Draw a keep-out zone over the antenna area on every copper layer before you pour, and the pour can't fill it.

The same goes for what surrounds the board: a metal case, a battery or a big connector next to the antenna does the same damage. If the product has a metal enclosure, plan for a module with an external antenna connector from the start.

2. A 3.3 V rail that sags when the radio talks

An ESP32 draws little current on average and short, sharp peaks when it transmits. Espressif recommends a supply that can deliver at least 500 mA. A regulator that copes with the average sags on the peaks, the brownout detector trips, and the board resets every time it tries Wi-Fi. That looks exactly like a firmware bug.

What fixes it: a regulator rated for 500 mA or more (from USB 5 V, something like an AP2112K-3.3 works), bulk capacitance of around 10 µF plus a 100 nF ceramic right at the module's 3V3 pin, and a short, wide path from regulator to module. A 100 mm, 0.25 mm trace on 1 oz copper is about 0.2 Ω, which is 0.1 V gone at 500 mA, before the module's own capacitor.

If you're running from one Li-ion cell, remember the cell sits between 4.2 V and 3.0 V, so an ordinary LDO stops regulating long before the cell is empty.

3. EN without its delay

The EN pin starts the chip when it goes high. If it rises together with a slowly ramping supply, the chip can start before its power is stable. Espressif's reference design adds an RC delay: 10 kΩ pull-up to 3.3 V and 1 µF to ground. Add a reset button from EN to ground and a BOOT button on the boot strap (GPIO0 on the ESP32 and ESP32-S3, GPIO9 on the C3). Two buttons cost nothing and save the day you need to recover a board with broken firmware.

KiCad schematic of the ESP32-S3 support circuit: EN with 10 kilohm and 1 microfarad, RESET and BOOT buttons, USB-C with two 5.1 kilohm CC resistors, AP2112K-3.3 regulator
The same board's schematic, drawn with KiCad's own symbols and passing its electrical rules check.

4. A strapping pin pulled the wrong way

Strapping pins are ordinary GPIOs that the chip reads at reset to decide how to boot. You can use them after boot, but whatever you connect must not pull them the wrong way during reset.

  • Original ESP32: GPIO0, GPIO2, GPIO5, GPIO12, GPIO15
  • ESP32-S3: GPIO0, GPIO3, GPIO45, GPIO46
  • ESP32-C3: GPIO2, GPIO8, GPIO9

The classic trap is GPIO12 on the original ESP32. It sets the flash voltage at boot. Put a pull-up or a sensor on it that holds it high at reset, and a module with 3.3 V flash simply won't boot. No error, no output, nothing.

5. USB-C with one CC resistor

The ESP32-S3 and C3 have native USB on fixed pins (GPIO19/20 on the S3, GPIO18/19 on the C3), so no USB-to-serial chip is needed. Route D+ and D− as a short pair over solid ground and put an ESD array at the connector.

The USB-C part people get wrong is power. A USB-C sink needs a separate 5.1 kΩ resistor from CC1 to ground and another from CC2 to ground. Leave them off and C-to-C chargers won't turn on VBUS. Share one resistor between both pins and e-marked cables make some chargers refuse power, which is exactly the bug the first Raspberry Pi 4 boards shipped with.

A ten-point check before you order

  1. Antenna at or past the board edge, keep-out on every layer matching the datasheet.
  2. Nothing in the keep-out: no pour, trace, via, part or mounting hole.
  3. Module ground pad stitched to the plane with several vias.
  4. Bulk and 100 nF capacitors at the 3V3 pin; regulator rated 500 mA or more.
  5. EN pull-up, delay capacitor and reset button; BOOT button on the strap.
  6. No strapping pin held the wrong way at reset.
  7. USB D+/D− short and paired, ESD at the connector.
  8. One 5.1 kΩ resistor per CC pin.
  9. Regulator and any switcher away from the antenna.
  10. Design-rule check clean against your fab's limits.

None of these needs special tools. They need you to look at the board with the right list in hand. The full guide, with diagrams of the layout and of the EN, boot and USB-C circuits, is on pcbeditor.com.


Which of these has bitten you? I'd like to hear about the ESP32 board failures that weren't on this list.

Top comments (0)