ESP32 PCB Layout and Routing
Overview
This tutorial builds a complete ESP32 development board PCB step by step. You will place the ESP32-WROOM-32 module, add power circuitry, wire up a USB-to-UART bridge for programming, and let the autorouter connect everything.
Good PCB layout for an ESP32 follows three placement rules:
- The module antenna must hang over the board edge with no copper beneath it.
- The 3.3 V supply path (USB connector → regulator → module) should be short.
- Programming controls (EN reset, IO0 boot) live next to the module with their pull-up resistors and pushbuttons nearby.
Components
| Ref | Part | Description | Footprint |
|---|---|---|---|
| U1 | ESP32-WROOM-32 | Wi-Fi + BT module | stamp receiver 18 mm |
| U2 | AMS1117-3.3 | 3.3 V LDO regulator | SOT-223 |
| U3 | CH340C | USB-to-UART bridge | SOP-16 |
| J1 | USB-C receptacle | 5 V power + programming | SMD USB-C |
| SW1 | Pushbutton | EN (reset) | THT tactile |
| SW2 | Pushbutton | IO0 (boot mode) | THT tactile |
| R1 | 10 kΩ | EN pull-up | 0402 |
| R2 | 10 kΩ | IO0 pull-up | 0402 |
| R3, R4 | 10 kΩ | Auto-reset (EN + IO0 RC) | 0402 |
| C1 | 10 µF | VBUS bulk decoupling | 0805 |
| C2 | 10 µF | 3V3 bulk decoupling | 0805 |
| C3, C6 | 100 nF | Module / CH340C bypass | 0402 |
Step 1: Place the ESP32 Module
The ESP32-WROOM-32 is a stamp-style module. In tscircuit it is modelled as a
<chip> with the stampreceiver footprint family. The footprint string encodes
the pad count and spacing:
stampreceiver_left14_right14_bottom10_top0_w18mm_p1.27mm
Place the module near the top edge of the board so the antenna side (the rounded end of the WROOM module) points outward away from the rest of the circuitry.
The pcbY={8} shifts the module toward the top of the 40 mm board, leaving
room below for power and programming components.
Step 2: Add USB Power and 3.3 V Regulation
The ESP32 runs on 3.3 V but USB supplies 5 V. We need:
- A USB-C connector for power input
- An AMS1117-3.3 LDO regulator (SOT-223 package) to step 5 V down to 3.3 V
- Decoupling capacitors on both sides of the regulator
Place the USB connector at the left board edge and the regulator between it and the module to keep the high-current 5 V path short.
The regulator at pcbX={-10} sits between the USB connector (pcbX={-22}) and
the module (pcbX={0}), creating a straight left-to-right power flow that is
easy to review.
Step 3: Add the USB-to-UART Bridge
To program the ESP32 over USB you need a serial bridge chip. The CH340G (SOP-16) converts USB signals to the UART RX/TX lines the ESP32 bootloader uses.
The bridge also drives the DTR and RTS hardware flow-control lines.
Those connect to the ESP32's EN and IO0 pins through 100 nF capacitors to
implement the automatic reset-into-bootloader sequence that the Arduino IDE and
esptool rely on.
The auto-reset capacitors on C4 and C5 implement the standard ESP32 reset circuit: when a host asserts DTR and then RTS (or vice versa), the resulting pulse drives EN low followed by IO0 low, putting the chip into download mode without you pressing any buttons.
Step 4: EN Reset and BOOT Buttons
Even with automatic reset, physical buttons are important for manual recovery. Place the EN (reset) button and the IO0 (boot mode) button near the right edge of the board with their 10 kΩ pull-up resistors right beside them.
Pressing SW1 (EN) resets the ESP32. Pressing SW2 (IO0) while holding SW1 puts it into download mode so you can flash firmware manually without needing the auto-reset circuit.
Step 5: Autorouting
Once component placement is done, tscircuit can route all the traces automatically.
Add autorouter="auto-cloud" to the <board> element to use the cloud autorouter,
or autorouter="sequential-trace" for the local solver:
<board width="55mm" height="40mm" autorouter="auto-cloud">
...
</board>
The autorouter reads every connections prop and every <netlabel> you added,
so there is nothing extra to configure. After routing you can switch to the PCB
tab in the preview to inspect trace widths and clearances.
Placement tips that help the autorouter
- Short nets first: the regulator-to-module 3V3 path and the UART TX/RX crossover are the nets most affected by placement order.
- Avoid crossing power nets: keep VBUS traces on the left side of the board and 3V3 traces in the middle so they do not create unnecessary crossings that require vias.
- Put bypass caps as close as possible: C3 (module bypass) and C6 (CH340 bypass) should be within 2–3 mm of their respective IC's power pin to minimize the inductance the router must deal with.
Cost Estimate
| Component | Unit Cost | Qty | Total |
|---|---|---|---|
| ESP32-WROOM-32 | $2.20 | 1 | $2.20 |
| AMS1117-3.3 (SOT-223) | $0.10 | 1 | $0.10 |
| CH340C (SOP-16) | $0.25 | 1 | $0.25 |
| USB-C receptacle | $0.15 | 1 | $0.15 |
| Tactile pushbuttons | $0.05 | 2 | $0.10 |
| 10 kΩ resistors (0402) | $0.01 | 4 | $0.04 |
| 10 µF capacitors (0805) | $0.05 | 2 | $0.10 |
| 100 nF capacitors (0402) | $0.02 | 2 | $0.04 |
| PCB (2-layer, 5 pcs) | $0.50 | 1 | $0.50 |
| Total | ~$3.48 |
Prices based on LCSC/JLCPCB quantities of 10.
Pre-fabrication checklist
Before exporting Gerbers:
- The antenna end of the ESP32 module hangs over the board edge, or at least no copper, vias, or components appear within 3 mm of the antenna window.
- C1 is within 5 mm of the USB connector VBUS pin.
- C3 is within 3 mm of U1 pin 2 (3V3).
- C6 is within 3 mm of U3 pin 16 (VCC).
- All GND pins on U1 (pins 1, 15, 37, 38) connect to the same GND net.
- The UART crossover is correct: U3 TXD → U1 RXD0, U3 RXD ← U1 TXD0.
- Both pushbuttons are reachable from the board edge.