The term "ESP-32D" technically refers to the ESP32-D0WDQ6 silicon die, but in practice, makers use it to describe the ubiquitous 30-pin ESP32 DevKit V1 board housing that chip. If you are holding a rectangular board with two rows of 15 headers, you need the DevKit V1 breakout pinout, not the raw 48-pin QFN silicon map. The direct answer for 99% of projects: use the 30-pin DevKit V1 layout, strictly avoid GPIO 12 and GPIO 2 for outputs, and never use ADC2 pins while WiFi is active.
The Complete ESP32 DevKit V1 (ESP-32D) Pinout Reference
Below is the complete physical header map for the standard 30-pin ESP32 DevKit V1. This table maps the physical pin location on the board to the internal ESP32-D0WD GPIO number and its primary hardware limitations. Reference the official Espressif ESP32 Datasheet for absolute maximum ratings.
| Left Header (Top to Bottom) | GPIO / Function | Right Header (Top to Bottom) | GPIO / Function |
|---|---|---|---|
| 3V3 | 3.3V Power Output | VIN | 5V Input (Regulated to 3.3V) |
| GND | Ground | GND | Ground |
| GPIO 15 | Strapping Pin (Boot log) | GPIO 13 | ADC2_CH4, Touch4 |
| GPIO 2 | Strapping Pin (Boot mode) | GPIO 12 | Strapping Pin (Flash VDD) |
| GPIO 4 | ADC2_CH0, Touch0 | GPIO 14 | ADC2_CH6, Touch6 |
| GPIO 16 | U2RXD (UART2 RX) | GPIO 27 | ADC2_CH7, Touch7 |
| GPIO 17 | U2TXD (UART2 TX) | GPIO 26 | ADC2_CH9, DAC2 |
| GPIO 5 | VSPI CS0, Strapping Pin | GPIO 25 | ADC2_CH8, DAC1 |
| GPIO 18 | VSPI SCK | GPIO 33 | ADC1_CH5, Touch8 |
| GPIO 19 | VSPI MISO | GPIO 32 | ADC1_CH4, Touch9 |
| GPIO 21 | I2C SDA (Default) | GPIO 35 | ADC1_CH7 (Input Only) |
| GPIO 3 | U0RXD (UART0 RX) | GPIO 34 | ADC1_CH6 (Input Only) |
| GPIO 1 | U0TXD (UART0 TX) | GPIO 39 | ADC1_CH3 (Input Only) |
| GPIO 22 | I2C SCL (Default) | GPIO 36 | ADC1_CH0 (Input Only) |
| GPIO 23 | VSPI MOSI | EN | Chip Enable (Active High) |
Rows People Get Wrong: Strapping Pins and ADC Conflicts
When debugging ESP32 boot loops or erratic sensor readings, the culprit is almost always a misunderstood pin limitation. The Random Nerd Tutorials ESP32 guide highlights these exact failure modes frequently in community builds.
GPIO 0, 2, 12, and 15 are "strapping pins." The ESP32 reads their voltage state during the first milliseconds of boot to determine flash voltage and boot mode. If you wire a relay or a sensor that pulls GPIO 12 HIGH during boot, the chip will switch its internal flash LDO to 1.8V, fail to read the 3.3V flash memory, and enter a continuous boot loop. Rule: Never use GPIO 12 or GPIO 2 for outputs or devices that pull the line high at startup.
The ADC2 vs. WiFi Conflict: The ESP32's ADC2 controller is shared with the WiFi radio. If your code initializes WiFi (even just to scan for networks), ADC2 pins (GPIO 0, 2, 4, 12, 13, 14, 15, 25, 26, 27) will instantly stop returning analog readings and default to 0 or erratic noise. If you need analog inputs while connected to WiFi, you must exclusively use ADC1 pins (GPIO 32, 33, 34, 35, 36, 39).
Input-Only Pins: GPIO 34, 35, 36, and 39 lack internal pull-up/pull-down resistors and cannot be driven HIGH or LOW. They are strictly for reading voltages. If you try to use them to drive an LED or trigger a MOSFET gate, the circuit will simply do nothing.
External Wiring Standards: IEC vs. DC Electronics Color Codes
A common point of confusion is applying mains wiring standards to low-voltage logic. IEC 60446 dictates Brown for Line, Blue for Neutral, and Green/Yellow for Earth. This standard applies to your 120V/230V AC mains feeding the power supply, not the DC logic wiring on your breadboard. Applying IEC mains colors to 3.3V logic will cause catastrophic confusion on the bench.
For the ESP-32D DevKit headers, follow the de-facto EIA/TIA and major maker ecosystem (Adafruit/SparkFun) DC color standards:
| Protocol / Function | Standard DC Wire Color | Alternate / Legacy Color |
|---|---|---|
| VIN (5V Input) | Red | None (Always Red) |
| 3V3 Output | Orange | Yellow (in some kits) |
| GND | Black | None (Always Black) |
| I2C SDA | Blue | White |
| I2C SCL | Yellow | Green |
| SPI MOSI / MISO / SCK | Green, Purple, Grey | Color-coded by channel |
| UART TX / RX | Green (TX), White (RX) | Matched pairs |
Always use Blue for SDA and Yellow for SCL. When daisy-chaining multiple I2C sensors (like a BME280 and an OLED display), maintaining this strict color code prevents the classic "swapped SDA/SCL" hardware fault that results in an I2C bus lockup requiring a hard power cycle to clear.
Faded Silk Screens: Safely Identifying Unmarked Pins
Cheap ESP32 clones from bulk marketplaces frequently suffer from rubbed-off or misprinted silk screen labels after a few weeks of bench handling. If your GPIO labels are faded, do not guess. You can safely map the power and ground pins using a digital multimeter (DMM) without powering the board.
- Find Ground (GND): Set your DMM to continuity mode (the diode/beep symbol). Place the black probe on the metal shielding of the micro-USB or USB-C port. This shield is tied directly to the DC ground plane. Probe the header pins with the red probe; any pin that beeps (reads < 1 ohm) is a GND pin.
- Find 3V3: Switch your DMM to Diode Test mode. Place the black probe on a confirmed GND pin. Touch the red probe to the remaining unmarked power pins. A pin that shows a forward voltage drop between 0.3V and 0.7V is your 3.3V rail (measuring across the internal ESD protection diodes to ground). The 5V VIN pin will typically read as an open circuit (OL) in this direction due to the reverse-polarity protection diode or LDO topology.
- Find EN (Enable): The EN pin is physically located directly adjacent to the 3V3 and GND pins on the top corner of the board, usually separated by a small capacitor (typically 100nF) routed to ground.
Decision Tree: Which GPIO Should You Actually Use?
Stop guessing which pins are safe. Use this decision matrix to terminate your pin-selection process with a concrete assignment.
| If your application requires... | Then use these exact GPIOs | Why these pins? |
|---|---|---|
| I2C Sensors / Displays | GPIO 21 (SDA), GPIO 22 (SCL) | Hardware defaults; no boot-strapping conflicts; internal pull-ups enabled by default in Wire.h. |
| SPI Storage / SD Cards | GPIO 18 (SCK), 19 (MISO), 23 (MOSI), 5 (CS) | Maps to the default VSPI hardware bus, ensuring maximum clock speeds without software bit-banging overhead. |
| Analog Read (with WiFi active) | GPIO 32, 33, 34, 35, 36, 39 | These are ADC1 pins. They remain fully functional and linear while the WiFi radio is transmitting. |
| PWM Motor Control / LEDs | GPIO 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33 | These support the LEDC hardware PWM peripheral and are free from strapping pin boot-loop risks. |
| Deep Sleep Wake-up | GPIO 32, 33, 34, 35, 36, 39 | Only RTC_GPIO pins can trigger a wake-up from deep sleep via the EXT0/EXT1 interrupt sources. |
Final Pick: The Default Safe Pin Mapping
If you are designing a custom PCB or wiring a permanent prototype and want a zero-headache, universally safe pinout that avoids every known ESP32-D0WD silicon quirk, commit this "Safe 10" mapping to memory:
- I2C Bus: SDA = GPIO 21, SCL = GPIO 22
- SPI Bus: SCK = GPIO 18, MISO = GPIO 19, MOSI = GPIO 23, CS = GPIO 5
- Analog Inputs: GPIO 34, GPIO 35 (Remember: Input only, add external 10k pull-down if floating)
- UART / Serial Debug: TX = GPIO 1, RX = GPIO 3 (Leave free for USB serial monitor)
- General Purpose Output (Relays/LEDs): GPIO 16, GPIO 17, GPIO 26, GPIO 27
By strictly confining your wiring to these pins, you eliminate ADC2 WiFi dropouts, prevent boot-loop strapping pin conflicts, and ensure compatibility across all major Arduino and ESP-IDF framework versions without requiring custom pin-remapping macros in your code.






