diff --git a/docs/tutorials/esp32-pcb-layout-and-routing.mdx b/docs/tutorials/esp32-pcb-layout-and-routing.mdx new file mode 100644 index 00000000..cfc0bea7 --- /dev/null +++ b/docs/tutorials/esp32-pcb-layout-and-routing.mdx @@ -0,0 +1,226 @@ +--- +title: ESP32 PCB Layout and Routing +description: Place and route an ESP32 module board with USB power, boot/reset controls, antenna keepout, and stable power traces. +--- + +import CircuitPreview from "@site/src/components/CircuitPreview" + +## Overview + +This tutorial shows a practical ESP32 board layout flow in tscircuit. The example +uses an ESP32-WROOM style module, a USB-C power/input connector, a 3.3 V +regulator, boot and reset buttons, and local decoupling capacitors. + +The most important layout choices are: + +- Put the ESP32 module at the board edge so the antenna points away from copper, + mounting holes, and large components. +- Keep the USB connector, regulator, and bulk capacitor close together so the + 5 V input path is short. +- Put decoupling capacitors close to the ESP32 3.3 V pins. +- Route power nets wider than signal nets, then let the autorouter handle the + remaining UART, boot, enable, and indicator traces. + +## Board Outline And Major Placement + +Start with a board size that leaves a clear antenna edge. The ESP32 module sits +near the top of the board, the USB connector sits on the left edge, and the +regulator stays between USB 5 V and the ESP32 3.3 V rail. + + ( + + + + + + + + + + + + + + + + + + + +) +`} +/> + +## Power Nets + +Name the power rails first and give them wider trace widths. The USB connector +feeds the regulator, the regulator creates `V3_3`, and every decoupling capacitor +returns to `GND`. + + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +) +`} +/> + +## Boot, Reset, And UART Signals + +ESP32 boards normally need pull-ups on `EN` and `IO0`, plus buttons that pull +those nets to ground. Keep those buttons near the module edge so they are easy +to press and the traces stay short. + + ( + + + + + + + + + + + + + + + + + + + + + + + + + + + +) +`} +/> + +## Routing Checklist + +Before sending the board out, check these layout constraints: + +| Area | What to check | +| --- | --- | +| Antenna | Keep the ESP32 antenna beyond the board edge or over a copper-free keepout. | +| 3.3 V rail | Use a wider trace from regulator output to ESP32 3.3 V and decoupling capacitors. | +| Ground | Give each decoupling capacitor a short route back to ground. | +| USB | Keep `D+` and `D-` close together and avoid routing them under noisy power parts. | +| Boot/reset | Confirm `IO0` and `EN` have pull-ups and momentary pull-down buttons. | +| UART | Cross the external header's `TXD0` to ESP32 `RXD0`, and `RXD0` to ESP32 `TXD0`. | + +## Practical Iteration Flow + +During placement, set `routingDisabled` on the board for fast previews. Once the +module, regulator, connector, buttons, and capacitors are in stable positions, +remove `routingDisabled`, keep the power net widths, and let the autorouter +complete the signal routes. + +If the router struggles, move decoupling capacitors closer to the ESP32, increase +board width near the USB connector, or separate the UART header from the power +input path. Small placement changes usually solve more routing problems than +adding manual trace paths early.