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
3V3N/APower Output3.3V regulated output (max ~500mA on good clones)
ENGPIO 3 (RX0)Enable / Chip ResetActive HIGH. Pull LOW to hard reset the chip.
VPGPIO 36ADC1_CH0 / InputINPUT ONLY. No internal pull-up. Used for Hall sensor.
VNGPIO 39ADC1_CH3 / InputINPUT ONLY. No internal pull-up. Used for Hall sensor.
IO34GPIO 34ADC1_CH6 / InputINPUT ONLY. No internal pull-up.
IO35GPIO 35ADC1_CH7 / InputINPUT ONLY. No internal pull-up.
IO32GPIO 32ADC1_CH4 / DAC1Safe for general I/O, PWM, and touch.
IO33GPIO 33ADC1_CH5 / DAC2Safe for general I/O, PWM, and touch.
IO25GPIO 25ADC2_CH8 / DAC1Safe for general I/O. (DAC capable)
IO26GPIO 26ADC2_CH9 / DAC2Safe for general I/O. (DAC capable)
IO27GPIO 27ADC2_CH7 / TouchSafe for general I/O, I2C, SPI.
IO14GPIO 14ADC2_CH6 / TouchSafe for general I/O. Emits PWM noise at boot.
IO12GPIO 12ADC2_CH5 / TouchSTRAPPING PIN. Must be LOW at boot for 3.3V flash.
GNDN/AGroundCommon ground reference.
IO13GPIO 13ADC2_CH4 / TouchSafe for general I/O. Emits PWM noise at boot.
IO9GPIO 9Internal FlashDO NOT USE. Connected to internal SPI flash.
IO10GPIO 10Internal FlashDO NOT USE. Connected to internal SPI flash.
IO11GPIO 11Internal FlashDO NOT USE. Connected to internal SPI flash.
VIN / 5VN/APower Input5V from USB or external regulated 5V source.
TX0GPIO 1UART0 TXDebug output. HIGH at boot.
RX0GPIO 3UART0 RXDebug input.
IO22GPIO 22General I/OStandard default for I2C SCL.
IO19GPIO 19VSPI MISOSafe for general I/O and SPI.
IO23GPIO 23VSPI MOSISafe for general I/O and SPI.
IO18GPIO 18VSPI SCKSafe for general I/O and SPI.
IO5GPIO 5VSPI CS0Safe for general I/O. Emits PWM noise at boot.
TX2GPIO 17UART2 TXSafe for general I/O. (Free on WROOM-32D).
RX2GPIO 16UART2 RXSafe for general I/O. (Free on WROOM-32D).
IO4GPIO 4ADC2_CH0 / TouchSafe for general I/O. Controls onboard LED on some clones.
IO2GPIO 2ADC2_CH2 / TouchSTRAPPING PIN. Must be LOW/Floating to boot. Onboard LED.
IO15GPIO 15ADC2_CH3 / TouchSTRAPPING PIN. Emits PWM noise at boot.
IO8GPIO 8Internal FlashDO NOT USE. Connected to internal SPI flash.
IO7GPIO 7Internal FlashDO NOT USE. Connected to internal SPI flash.
IO6GPIO 6Internal FlashDO NOT USE. Connected to internal SPI flash.
CLK / IO0GPIO 0ADC2_CH1 / TouchSTRAPPING 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.

CRITICAL WARNING: Internal Flash Pins (GPIO 6, 7, 8, 9, 10, 11)
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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.