The ESP32-WROOM-32D (frequently stamped simply as 'ESP32D' on the metal RF shield) is a revised variant of Espressif's flagship 38-pin module. While the 'D' designation primarily indicates an updated internal SPI flash chip supply chain (often swapping GigaDevice for XMC), the physical GPIO mapping remains identical to the standard WROOM-32. Below is the definitive hardware reference for mapping physical DevKit V1 headers to internal silicon pins, avoiding fatal boot-loop traps, and wiring external sensors safely.
The Complete ESP32D (WROOM-32D) Pinout Table
This table maps the standard 38-pin DevKit V1 physical headers to the internal ESP32D GPIO numbers. Reference the official Espressif ESP32-WROOM-32D Datasheet for absolute electrical characteristics.
| DevKit Pin Label | GPIO Number | Primary Function | Constraints & Notes |
|---|---|---|---|
| 3V3 | N/A | Power Output | 3.3V regulated output (max ~500mA on good clones) |
| EN | GPIO 3 (RX0) | Enable / Chip Reset | Active HIGH. Pull LOW to hard reset the chip. |
| VP | GPIO 36 | ADC1_CH0 / Input | INPUT ONLY. No internal pull-up. Used for Hall sensor. |
| VN | GPIO 39 | ADC1_CH3 / Input | INPUT ONLY. No internal pull-up. Used for Hall sensor. |
| IO34 | GPIO 34 | ADC1_CH6 / Input | INPUT ONLY. No internal pull-up. |
| IO35 | GPIO 35 | ADC1_CH7 / Input | INPUT ONLY. No internal pull-up. |
| IO32 | GPIO 32 | ADC1_CH4 / DAC1 | Safe for general I/O, PWM, and touch. |
| IO33 | GPIO 33 | ADC1_CH5 / DAC2 | Safe for general I/O, PWM, and touch. |
| IO25 | GPIO 25 | ADC2_CH8 / DAC1 | Safe for general I/O. (DAC capable) |
| IO26 | GPIO 26 | ADC2_CH9 / DAC2 | Safe for general I/O. (DAC capable) |
| IO27 | GPIO 27 | ADC2_CH7 / Touch | Safe for general I/O, I2C, SPI. |
| IO14 | GPIO 14 | ADC2_CH6 / Touch | Safe for general I/O. Emits PWM noise at boot. |
| IO12 | GPIO 12 | ADC2_CH5 / Touch | STRAPPING PIN. Must be LOW at boot for 3.3V flash. |
| GND | N/A | Ground | Common ground reference. |
| IO13 | GPIO 13 | ADC2_CH4 / Touch | Safe for general I/O. Emits PWM noise at boot. |
| IO9 | GPIO 9 | Internal Flash | DO NOT USE. Connected to internal SPI flash. |
| IO10 | GPIO 10 | Internal Flash | DO NOT USE. Connected to internal SPI flash. |
| IO11 | GPIO 11 | Internal Flash | DO NOT USE. Connected to internal SPI flash. |
| VIN / 5V | N/A | Power Input | 5V from USB or external regulated 5V source. |
| TX0 | GPIO 1 | UART0 TX | Debug output. HIGH at boot. |
| RX0 | GPIO 3 | UART0 RX | Debug input. |
| IO22 | GPIO 22 | General I/O | Standard default for I2C SCL. |
| IO19 | GPIO 19 | VSPI MISO | Safe for general I/O and SPI. |
| IO23 | GPIO 23 | VSPI MOSI | Safe for general I/O and SPI. |
| IO18 | GPIO 18 | VSPI SCK | Safe for general I/O and SPI. |
| IO5 | GPIO 5 | VSPI CS0 | Safe for general I/O. Emits PWM noise at boot. |
| TX2 | GPIO 17 | UART2 TX | Safe for general I/O. (Free on WROOM-32D). |
| RX2 | GPIO 16 | UART2 RX | Safe for general I/O. (Free on WROOM-32D). |
| IO4 | GPIO 4 | ADC2_CH0 / Touch | Safe for general I/O. Controls onboard LED on some clones. |
| IO2 | GPIO 2 | ADC2_CH2 / Touch | STRAPPING PIN. Must be LOW/Floating to boot. Onboard LED. |
| IO15 | GPIO 15 | ADC2_CH3 / Touch | STRAPPING PIN. Emits PWM noise at boot. |
| IO8 | GPIO 8 | Internal Flash | DO NOT USE. Connected to internal SPI flash. |
| IO7 | GPIO 7 | Internal Flash | DO NOT USE. Connected to internal SPI flash. |
| IO6 | GPIO 6 | Internal Flash | DO NOT USE. Connected to internal SPI flash. |
| CLK / IO0 | GPIO 0 | ADC2_CH1 / Touch | STRAPPING PIN. Must be HIGH for normal execution boot. |
Rows Makers Get Wrong: Strapping Pins & Input-Only GPIOs
The most common cause of 'Guru Meditation Error' panics and boot loops on the ESP32D is misusing constrained pins. Consult the Random Nerd Tutorials ESP32 GPIO Guide for visual maps if you are wiring a custom PCB.
These pins are hardwired to the internal SPI flash memory inside the WROOM-32D metal can. If you attempt to use them for external sensors, relays, or even configure them as inputs with pull-ups in your code, the ESP32 will fail to read its own firmware and crash immediately. Treat these GPIO numbers as physically non-existent.
The Strapping Pin Trap
During power-on or reset, the ESP32D samples specific pins to determine its boot mode. If your external circuit forces these pins to the wrong logic level, the chip will enter download mode or fail to boot.
- GPIO 0: Must be HIGH (or floating) for normal firmware execution. If held LOW at boot, the chip enters serial bootloader mode (used for flashing).
- GPIO 2: Must be LOW or floating to boot. This pin is tied to the onboard blue LED on most DevKits. Do not attach an external pull-up resistor here.
- GPIO 12: Determines the flash VDD voltage. Must be LOW at boot to select 3.3V. If pulled HIGH, the ESP32D attempts to power the flash at 1.8V, resulting in a brownout and boot failure.
- GPIO 15: Controls boot debug messages. Usually safe to leave floating, but pulling it LOW silences the bootloader UART output.
Input-Only GPIOs (34, 35, 36, 39)
These pins lack internal pull-up/pull-down resistors and cannot drive outputs. If you wire a mechanical pushbutton to GPIO 34 without an external 10kΩ pull-up resistor to 3.3V, the pin will float. Electromagnetic interference from nearby AC wiring or even your hand approaching the board will trigger phantom interrupts.
Sensor & Mains Wiring Color Codes: US vs. IEC Standards
When integrating the ESP32D into larger systems—such as I2C sensor networks or AC mains relay control—adhering to regional wiring color standards prevents catastrophic cross-wiring. The ESP32D operates at 3.3V logic; mixing up signal and power wires will instantly destroy the silicon.
| Application | US Standard (NEC-style / Maker Norm) | IEC Standard (EU / UK / AU) |
|---|---|---|
| DC Sensor Power (VCC) | Red | Brown |
| DC Sensor Ground (GND) | Black | Blue |
| DC Signal / Data | White, Yellow, or Green | Black or White |
| AC Mains Live/Hot (Relay Input) | Black (or Red for 240V split) | Brown |
| AC Mains Neutral (Relay Input) | White | Blue |
| AC Mains Earth Ground | Green or Bare Copper | Green with Yellow Stripe |
Note: Always use an optocoupler or a properly isolated relay module when switching AC mains loads with the ESP32D. Never connect mains voltage directly to the microcontroller ground plane.
Safe Interpretation When Board Markings Are Faded
Cheap DevKit V1 clones sourced from bulk marketplaces often feature poor-quality silkscreen that rubs off after a few weeks on the workbench. If your pin labels are gone, do not guess. Use a digital multimeter (DMM) to safely map the board:
- Locate Ground (GND): Set your DMM to continuity mode (beep). Place the black probe on the metal shield of the micro-USB port. Probe the header pins with the red probe. Any pin that beeps is GND.
- Locate 5V (VIN): Power the board via USB. Set the DMM to DC Voltage. Place the black probe on a known GND pin. Probe the remaining pins. The pin reading ~4.8V to 5.1V is your 5V/VIN line.
- Locate 3.3V: Find the AMS1117-3.3 voltage regulator (the small SMD chip with three legs near the USB port). The output pin of this regulator connects directly to the 3V3 header. It will read exactly 3.28V–3.32V relative to GND.
- Identify I2C Defaults: If you need the default hardware I2C pins and the silkscreen is gone, GPIO 21 (SDA) and GPIO 22 (SCL) are physically located on the same side as the 3V3 and GND pins on standard 38-pin layouts, usually near the center-bottom of the left bank.
ESP32D Pinout FAQ
Can I use GPIO 16 and 17 for standard I/O on the ESP32D?
Yes. On the ESP32-WROVER modules, GPIO 16 and 17 are reserved for external PSRAM and cannot be used. However, the ESP32-WROOM-32D does not include PSRAM. Therefore, GPIO 16 (RX2) and GPIO 17 (TX2) are completely free for general-purpose I/O, PWM, or secondary UART communication.
Why does my ESP32D boot loop when a relay is connected to GPIO 12?
GPIO 12 is a strapping pin that dictates the internal flash voltage. If your relay module has an internal pull-up resistor, or if the relay defaults to a HIGH state during the microsecond the ESP32D powers on, the chip reads GPIO 12 as HIGH. It then incorrectly configures the flash VDD to 1.8V instead of 3.3V, causing an immediate brownout. Move the relay to a safe pin like GPIO 27 or GPIO 26.
Is the ESP32D 5V tolerant on its GPIO pins?
No. The ESP32D silicon is strictly 3.3V. Feeding a 5V signal into any GPIO pin (including RX0/TX0) will degrade the internal ESD protection diodes and eventually destroy the pin or the entire chip. If you must interface with a 5V sensor (like an older HC-SR04 ultrasonic sensor), use a bidirectional logic level shifter (like the BSS138-based Adafruit 4-channel shifter) or a simple voltage divider using a 1kΩ and 2kΩ resistor to drop the 5V signal down to ~3.3V.






