From 8be51a13d6d93f25ea7351932fa947e192f42b23 Mon Sep 17 00:00:00 2001 From: q404365631 Date: Thu, 28 May 2026 14:21:45 +0800 Subject: [PATCH] feat: add ESP32 module circuit tutorial (schematic only) Add a comprehensive tutorial for building an ESP32-WROOM-32 minimum system circuit with power supply (USB-C + AMS1117-3.3 LDO), decoupling capacitors, reset/boot mode circuits, and status LED. Closes tscircuit/docs-old#47 /claim #47 --- docs/tutorials/esp32-module-circuit.mdx | 979 ++++++++++++++++++++++++ 1 file changed, 979 insertions(+) create mode 100644 docs/tutorials/esp32-module-circuit.mdx diff --git a/docs/tutorials/esp32-module-circuit.mdx b/docs/tutorials/esp32-module-circuit.mdx new file mode 100644 index 00000000..540ed881 --- /dev/null +++ b/docs/tutorials/esp32-module-circuit.mdx @@ -0,0 +1,979 @@ +--- +title: Building an ESP32 Module Circuit +description: >- + Learn how to build an ESP32-WROOM-32 minimal system circuit with power supply, + reset, boot mode selection, and status LED using tscircuit. +--- + +## Overview + +This tutorial will walk you through building an ESP32-WROOM-32 minimal system circuit using tscircuit. We'll cover the power supply with an LDO voltage regulator, decoupling capacitors, reset and boot mode circuits, and a status LED — everything needed to get an ESP32 module up and running. + +The ESP32 is a popular low-cost microcontroller with integrated Wi-Fi and Bluetooth, making it ideal for IoT projects. A minimal system circuit ensures the ESP32 can boot reliably and communicate over serial. + +import CircuitPreview from "@site/src/components/CircuitPreview" +import TscircuitIframe from "@site/src/components/TscircuitIframe" + + { + return ( + + {/* USB-C Connector */} + + + {/* LDO Voltage Regulator - AMS1117-3.3 */} + + + {/* ESP32-WROOM-32 Module */} + + + {/* Input Capacitor for LDO - 10uF */} + + + {/* Output Capacitor for LDO - 10uF */} + + + {/* Decoupling Capacitor near ESP32 - 0.1uF */} + + + {/* Pull-up Resistor for EN - 10k */} + + + {/* Pull-up Resistor for IO0 - 10k */} + + + {/* Reset Button */} + + + {/* Status LED */} + + + {/* LED Current Limiting Resistor - 1k */} + + + {/* Power Traces */} + + + + + {/* Input Cap for LDO */} + + + + {/* Output Cap for LDO */} + + + + {/* ESP32 Power */} + + + + + + {/* Decoupling Cap */} + + + + {/* EN Pull-up */} + + + + {/* Reset Button */} + + + + {/* IO0 Pull-up */} + + + + {/* Status LED */} + + + + + ) +} +`} /> + +## ESP32 Minimum System Requirements + +An ESP32 minimum system needs the following to boot reliably: + +- **Power Supply** — The ESP32 requires a stable 3.3V supply. We use a USB-C connector with an AMS1117-3.3 LDO to step down 5V from USB to 3.3V. +- **Decoupling Capacitors** — 10uF bulk capacitors on the LDO input and output, plus a 0.1uF ceramic capacitor close to the ESP32 for high-frequency noise filtering. +- **Reset Circuit** — The EN (CHIP_PU) pin must be pulled high via a 10k resistor. A push button pulls it low to reset the chip. +- **Boot Mode Selection** — The GPIO0 pin determines the boot mode. Pulled high for normal boot (flash mode), pulled low for download mode. +- **Status LED** — A blue LED on GPIO2 provides visual feedback (GPIO2 also serves as a debug output during boot). + +## Building the Circuit Step by Step + +### Step 1: ESP32-WROOM-32 Module + +The ESP32-WROOM-32 is a module that integrates the ESP32 chip, Flash memory, and antenna into a single package. We define it using the `` component with pin labels matching the module's pinout. + +The ESP32-WROOM-32 has 38 pins total. For our schematic, we include the essential pins: power (3V3, VDD, GND), control (EN, IO0), communication (TX, RX), and several GPIO pins. + + { + return ( + + {/* ESP32-WROOM-32 Module */} + + + ) +} +`} /> + +### Step 2: Power Supply (USB-C + LDO) + +The ESP32 operates at 3.3V, but USB provides 5V. We use an AMS1117-3.3 LDO (Low Dropout Regulator) to step down the voltage. The `SmdUsbC` component provides the USB-C connector, and we add 10uF capacitors on both the input and output of the LDO for stability. + + { + return ( + + {/* USB-C Connector */} + + + {/* LDO Voltage Regulator - AMS1117-3.3 */} + + + {/* Input Capacitor for LDO - 10uF */} + + + {/* Output Capacitor for LDO - 10uF */} + + + {/* Power Traces */} + + + + + {/* Input Cap for LDO */} + + + + {/* Output Cap for LDO */} + + + + ) +} +`} /> + +### Step 3: Connect Power to ESP32 + +Now we connect the 3.3V output from the LDO to the ESP32's power pins. The ESP32-WROOM-32 has two 3.3V pins (3V3 and VDD) and two GND pins. We also add a 0.1uF decoupling capacitor close to the ESP32's power pins to filter high-frequency noise. + + { + return ( + + {/* USB-C Connector */} + + + {/* LDO Voltage Regulator */} + + + {/* ESP32-WROOM-32 Module */} + + + {/* Capacitors */} + + + + + {/* LDO Power Traces */} + + + + + + + + + {/* ESP32 Power */} + + + + + + {/* Decoupling Cap */} + + + + ) +} +`} /> + +### Step 4: Reset and Boot Mode Circuits + +The ESP32 has two critical control pins: + +- **EN (CHIP_PU)** — The enable/reset pin. Must be pulled high (3.3V) for normal operation. Pulling it low resets the chip. We use a 10k pull-up resistor and a push button to ground. +- **IO0** — Determines the boot mode. Pulled high = normal boot from flash, pulled low = serial download mode. We use a 10k pull-up resistor for normal operation. + + { + return ( + + {/* ESP32-WROOM-32 Module */} + + + {/* Pull-up Resistor for EN - 10k */} + + + {/* Pull-up Resistor for IO0 - 10k */} + + + {/* Reset Button */} + + + {/* ESP32 Power */} + + + + + + {/* EN Pull-up */} + + + + {/* Reset Button - pulls EN low when pressed */} + + + + {/* IO0 Pull-up for normal boot */} + + + + ) +} +`} /> + +### Step 5: Status LED + +We add a blue LED on GPIO2 with a 1k current-limiting resistor. GPIO2 is useful for a status LED because it also outputs a debug signal during boot — the LED will pulse briefly when the ESP32 starts up, providing visual confirmation that the board is working. + + { + return ( + + {/* ESP32-WROOM-32 Module */} + + + {/* Status LED */} + + + {/* LED Current Limiting Resistor - 1k */} + + + {/* ESP32 Power */} + + + + + + {/* Status LED - active low on IO2 */} + + + + + ) +} +`} /> + +### Step 6: Complete Circuit + +Now we combine all the sub-circuits into the complete ESP32 minimum system. This includes the USB-C power supply, LDO regulator, ESP32 module, decoupling capacitors, reset circuit, boot mode selection, and status LED. + + { + return ( + + {/* USB-C Connector */} + + + {/* LDO Voltage Regulator - AMS1117-3.3 */} + + + {/* ESP32-WROOM-32 Module */} + + + {/* Input Capacitor for LDO - 10uF */} + + + {/* Output Capacitor for LDO - 10uF */} + + + {/* Decoupling Capacitor near ESP32 - 0.1uF */} + + + {/* Pull-up Resistor for EN - 10k */} + + + {/* Pull-up Resistor for IO0 - 10k */} + + + {/* Reset Button */} + + + {/* Status LED */} + + + {/* LED Current Limiting Resistor - 1k */} + + + {/* Power Traces */} + + + + + {/* Input Cap for LDO */} + + + + {/* Output Cap for LDO */} + + + + {/* ESP32 Power */} + + + + + + {/* Decoupling Cap */} + + + + {/* EN Pull-up */} + + + + {/* Reset Button */} + + + + {/* IO0 Pull-up */} + + + + {/* Status LED */} + + + + + ) +} +`} /> + +## Component Reference + +| Component | Designator | JLCPCB Part # | Description | +|-----------|-----------|---------------|-------------| +| ESP32-WROOM-32 | U1 | C829502 | Wi-Fi + Bluetooth MCU module | +| AMS1117-3.3 | U2 | C6186 | 3.3V LDO voltage regulator | +| 10uF Capacitor | C1, C2 | C15850 | LDO input/output bulk capacitor (0805) | +| 0.1uF Capacitor | C3 | C307514 | ESP32 decoupling capacitor (0402) | +| 10k Resistor | R1, R2 | C25744 | EN and IO0 pull-up resistors (0402) | +| 1k Resistor | R3 | C11702 | LED current-limiting resistor (0402) | +| Blue LED | LED1 | C72041 | Status indicator LED (0603) | +| Push Button | SW1 | — | Reset button | +| USB-C Connector | J1 | — | Power input (via SmdUsbC) | + +## Boot Mode Summary + +The ESP32 boot mode is determined by the state of specific pins at startup: + +| IO0 | IO2 | IO12 | EN | Boot Mode | +|-----|-----|------|-----|-----------| +| H | - | - | ↑ | SPI Flash Boot (normal) | +| L | - | - | ↑ | Download Boot (UART) | +| - | - | H | ↑ | SPI Flash Boot | +| - | - | L | ↑ | SDIO Boot (rarely used) | + +In our circuit, IO0 is pulled high by R2 (10k), so the ESP32 will boot from SPI Flash by default. To enter download mode, you would hold the BOOT button (not shown — connect IO0 to GND) while pressing and releasing the RESET button. + +## Next Steps + +- **Add a USB-to-UART bridge** — Add a CP2102 or CH340 chip to enable programming via USB without an external programmer +- **Add a BOOT button** — Add a second push button on IO0 to easily enter download mode +- **Expand GPIO connections** — Add pin headers to expose all GPIO pins for prototyping +- **Add battery charging** — Integrate a LiPo battery charger like the TP4056 for portable projects +- **Order the PCB** — Follow the [Ordering Prototypes](/building-electronics/ordering-prototypes) guide to manufacture your board