diff --git a/codetestingplayground/esp32-wifi-test-board.circuit.tsx b/codetestingplayground/esp32-wifi-test-board.circuit.tsx new file mode 100644 index 00000000..57477fee --- /dev/null +++ b/codetestingplayground/esp32-wifi-test-board.circuit.tsx @@ -0,0 +1,289 @@ +export default () => ( + + {/* USB-C Power Subsystem */} + + + .CC1", pin2: "net.GND" }} + /> + .CC2", pin2: "net.GND" }} + /> + + {/* AMS1117-3.3 Regulator */} + + + + + + + {/* CP2102N USB-to-UART Bridge */} + + + + + {/* Auto-Program Transistors */} + + .B" }} + /> + + + .E" }} + /> + + {/* ESP32-WROOM-32E */} + + + {/* EN Circuit */} + + + + {/* IO0 Circuit */} + + + + {/* Status LED */} + .pin1" }} + /> + .pin2", pin2: "net.GND" }} + /> + +) diff --git a/docs/tutorials/esp32-wifi-test-board-schematic.mdx b/docs/tutorials/esp32-wifi-test-board-schematic.mdx new file mode 100644 index 00000000..b253bac9 --- /dev/null +++ b/docs/tutorials/esp32-wifi-test-board-schematic.mdx @@ -0,0 +1,348 @@ +--- +title: ESP32 WiFi Test Board Schematic Tutorial +description: Learn how to design a complete ESP32-WROOM-32E development board schematic using tscircuit, including USB-C power, AMS1117-3.3 regulator, CP2102N USB-UART bridge, dual NPN auto-programming circuit, and status LEDs. +--- + +# ESP32 WiFi Test Board Schematic Tutorial + +This tutorial walks you through designing a complete, production-ready **ESP32-WROOM-32E development board schematic** using **tscircuit**. + +We will build the schematic using JLCPCB-stockable components, organized into modular circuit blocks: +1. **USB-C Power Subsystem** (`VBUS` 5V input + CC1/CC2 5.1k pull-downs). +2. **LDO Voltage Regulator** (`AMS1117-3.3` stepping 5V `VBUS` down to `3.3V`). +3. **USB-to-UART Serial Bridge** (`CP2102N` for USB programming and serial debug). +4. **Auto-Programming & Auto-Reset Circuit** (Dual NPN transistor cross-coupled circuit handling `DTR`/`RTS` signals). +5. **ESP32-WROOM-32E Core & Peripherals** (`EN` POR delay, `IO0` boot strap & button, `IO2` status LED). + +import TscircuitIframe from "@site/src/components/TscircuitIframe" + + ( + + {/* ======================================================== */} + {/* 1. USB-C POWER INPUT SUBSYSTEM */} + {/* ======================================================== */} + + + {/* CC 5.1k Pull-down resistors for USB Type-C Sink detection */} + .CC1", pin2: "net.GND" }} + /> + .CC2", pin2: "net.GND" }} + /> + + {/* ======================================================== */} + {/* 2. AMS1117-3.3 VOLTAGE REGULATOR (5V -> 3.3V) */} + {/* ======================================================== */} + + + {/* Input Capacitor (10uF) & Output Capacitors (10uF + 0.1uF) */} + + + + + {/* ======================================================== */} + {/* 3. CP2102N USB-TO-UART SERIAL BRIDGE */} + {/* ======================================================== */} + + + + + {/* ======================================================== */} + {/* 4. DUAL NPN TRANSISTOR AUTO-PROGRAM / AUTO-RESET CIRCUIT */} + {/* ======================================================== */} + + .B" }} + /> + + + .E" }} + /> + + {/* ======================================================== */} + {/* 5. ESP32-WROOM-32E MICROCONTROLLER CORE & PERIPHERALS */} + {/* ======================================================== */} + + + {/* EN (Reset) Circuit: 10k Pull-up + 1uF POR Delay Capacitor */} + + + + {/* IO0 (Boot Mode) Circuit: 10k Pull-up + BOOT Push Button */} + + + + {/* IO2 User Status LED */} + .pin1" }} + /> + .pin2", pin2: "net.GND" }} + /> + +) +`} /> + +## Circuit Explanation + +### 1. USB-C Power Input & ESD Consideration +- **`VBUS` (5V)** provides input power from any standard USB host or charger. +- **`CC1` & `CC2`** pins are connected to ground via **`5.1kΩ` resistors** (`R_CC1`, `R_CC2`). This tells USB-C source controllers to configure 5V output power. + +### 2. Low-Dropout (LDO) Power Regulation +- The **`AMS1117-3.3`** linear regulator steps down 5V `VBUS` to a stable `3.3V` rail (`V3_3`) required by the ESP32 and CP2102N. +- Capacitors **`C1` (10µF)**, **`C2` (10µF)**, and **`C3` (0.1µF)** stabilize the input and output lines and filter high-frequency switching noise. + +### 3. CP2102N USB-to-UART Serial Converter +- The **`CP2102N`** converts USB signals (`USB_DP`, `USB_DM`) into UART serial communication (`U0TXD`, `U0RXD`). +- Notice the **crossed UART wiring**: + - `CP2102N TXD` connects to `ESP32 RXD0` (`U0RXD`). + - `CP2102N RXD` connects to `ESP32 TXD0` (`U0TXD`). + +### 4. Auto-Programming / Auto-Reset Transistor Circuit +The ESP32 uses `DTR` and `RTS` modem control lines from the CP2102N to trigger automatic flashing mode without manual button presses: +- When the IDE starts flashing: `DTR` drops low while `RTS` goes high, pulling `EN` low to reset the chip. +- Next, `RTS` drops low while `DTR` goes high, pulling `IO0` low during power-on, forcing the ESP32 into ROM bootloader mode. + +### 5. Microcontroller Core & Peripherals +- **`EN` Pin**: Fitted with an `R_EN` (10kΩ) pull-up and `C_EN` (1µF) capacitor for Power-On Reset (POR) delay. +- **`IO0` Pin**: Fitted with an `R_IO0` (10kΩ) pull-up and `SW_BOOT` push button for optional manual boot mode entry. +- **`IO2` Pin**: Controls an onboard user status LED (`LED1`) with a current-limiting resistor (`R_LED`, 1kΩ).