The ESP32 D1 Mini maps 11 accessible I/O pins to specific ESP32-WROOM GPIOs, governed by strict boot-strapping rules and hardware limitations. Below is the direct mapping reference, followed by critical edge cases that brick projects when ignored.
The Complete ESP32 D1 Mini Pinout Reference Table
This table assumes the standard Wemos/LoLin D1 Mini ESP32 form factor utilizing the ESP32-WROOM-32U module (the 'U' denotes the U.FL antenna connector used to save PCB space). Pin names reflect the official Wemos silkscreen, mapped to the native ESP32 GPIO numbers used in ESP-IDF v5.x and the Arduino IDE.
| Silkscreen Pin | Native GPIO | Primary Function | Hardware Constraints & Boot Behavior |
|---|---|---|---|
| 5V | N/A | Power Input/Output | USB VBUS (5V). Can power 5V sensors, but do not backfeed >5.5V. |
| GND | N/A | Ground | Common ground. Connect to all external sensor grounds. |
| 3V3 | N/A | Power Output | Regulated 3.3V from onboard LDO (ME6211C33). Max safe draw: 300mA. |
| TX | GPIO1 | UART0 TX | Outputs debug logs at boot. Do not pull low during reset. |
| RX | GPIO3 | UART0 RX | Must be high during boot. Used for serial flashing. |
| D1 | GPIO5 | General I/O, SPI CS | Safe for general use. Outputs PWM on boot. |
| D2 | GPIO4 | General I/O | Safe for general use. No boot-strapping conflicts. |
| D3 | GPIO0 | General I/O | Boot Trap: Must be HIGH to boot normally. Pulled LOW enters flash mode. |
| D4 | GPIO2 | General I/O | Boot Trap: Must be HIGH or floating to boot. Connected to onboard LED. |
| D5 | GPIO14 | General I/O, SPI CLK | Safe for general use. Outputs PWM on boot. |
| D6 | GPIO12 | General I/O, SPI MISO | Boot Trap: Determines flash voltage. Must be LOW to boot (3.3V flash). |
| D7 | GPIO13 | General I/O, SPI MOSI | Safe for general use. |
| D8 | GPIO15 | General I/O, SPI SS | Boot Trap: Must be LOW to boot. Outputs PWM on boot. |
| A0 | GPIO36 | ADC1_CH0 (Input Only) | Input only. No internal pull-up/pull-down. High impedance. |
Silkscreen Variants, Clone Discrepancies, and Faded Markings
Unlike the original ESP8266 D1 Mini, the ESP32 variant market is heavily fragmented. Depending on your supply chain, the silkscreen on your PCB will follow different naming standards. When building wire harnesses that leave the breadboard and enter an enclosure, you must also apply standard external wiring conventions to avoid catastrophic faults.
Board Silkscreen Standards
| Standard / Variant | Naming Convention | Where to Find |
|---|---|---|
| Wemos / LoLin (Official) | D1-D8, A0, 3V3, 5V | Authorized distributors, official AliExpress stores. |
| Shenzhen Generic Clones | GPIO numbers directly (e.g., IO5, IO4) | Amazon bulk packs, eBay, random AliExpress vendors. |
| ESP-IDF Default Mapping | GPIO0-GPIO39 (No 'D' prefix) | Software documentation, schematic PDFs. |
While the ESP32 doesn't care about wire jacket colors, your bench sanity and safety do. If your D1 Mini project interfaces with AC mains via relays, strictly separate your low-voltage and high-voltage harnesses. For internal DC sensor wiring, use IEC 60446 standards (brown for DC positive, blue for DC ground). If your enclosure includes AC mains wiring, follow NEC Article 200/250 (white/gray for grounded neutral, green/bare for earth ground). Never mix IEC DC colors with NEC AC colors in the same junction box.
Safe Interpretation When Markings are Faded or Missing
Cheap clone boards often use low-quality UV-cured ink that rubs off after a few weeks on a workbench. If your silkscreen is gone, do not guess. Use a digital multimeter in continuity mode. Place one probe on the header hole and the other on the exposed castellated edges of the ESP32-WROOM metal RF shield or the tiny resistors adjacent to the chip. Cross-reference the physical pin location with the official Espressif ESP32 Datasheet to identify the exact GPIO.
The "Rows People Get Wrong" Trap (Boot Failures & Fried Pins)
The ESP32 architecture requires specific strapping pin states during the reset sequence to determine boot mode and flash voltage. Ignoring these hardware realities is the number one cause of "my code won't run" support tickets.
- GPIO12 (D6) - The Flash Voltage Killer: GPIO12 dictates the SPI flash voltage. If you pull GPIO12 HIGH during boot (e.g., by connecting a relay module with a pull-up resistor), the ESP32 attempts to drive the internal 3.3V flash memory at 1.8V, resulting in a boot loop or permanent flash corruption. Always ensure GPIO12 is LOW or floating at reset.
- GPIO34 to GPIO39 (Including A0/GPIO36) - The Input-Only Illusion: Beginners frequently attempt to use
pinMode(A0, OUTPUT)or rely on internal pull-ups for buttons on these pins. These pins are physically disconnected from the output matrix and lack internal pull-up/pull-down resistors. You must add an external 10kΩ pull-up resistor if using them for button inputs. - TX/RX (GPIO1/GPIO3) - Serial Conflicts: If you wire an I2C or SPI device to GPIO1 and GPIO3, it will interfere with the USB-to-UART bridge (usually a CH340 or CP2104). This causes upload failures and garbage data in the serial monitor. Reserve these strictly for debugging.
- The 3.3V LDO Thermal Limit: The D1 Mini uses a tiny SOT-23-5 voltage regulator (often the ME6211C33). While the datasheet claims 500mA, the lack of PCB copper pour for heatsinking means drawing more than 250-300mA from the 3V3 pin will cause thermal shutdown. If you need to power a 500mA WS2812B LED strip, power it directly from the 5V pin with a logic level shifter, not the 3V3 pin.
ESP32 D1 Mini Pinout FAQ
Why does my ESP32 D1 Mini fail to boot when GPIO12 is connected to a sensor?
GPIO12 (mapped to D6) is a critical strapping pin that tells the internal voltage regulator whether the SPI flash operates at 3.3V or 1.8V. If your sensor circuit pulls GPIO12 HIGH during the boot sequence, the ESP32 incorrectly configures the flash voltage, leading to a continuous boot loop or "flash read err, 1000" in the serial monitor. To fix this, add a 10kΩ pull-down resistor from GPIO12 to GND, or rewire the sensor to a non-strapping pin like GPIO4 (D2) or GPIO5 (D1).
How do I identify pins if the silkscreen is faded or missing on my clone board?
Set your multimeter to continuity mode (the diode/beep setting). Probe the empty header holes and trace them to the small 0402 or 0603 resistors clustered near the ESP32 module. For example, GPIO0 (D3) and GPIO2 (D4) almost always have visible 10kΩ pull-up resistors connected directly to the 3.3V rail. For absolute certainty, probe the castellated half-holes on the edge of the metal RF shield and match them to the pin 1 marker on the Espressif GPIO documentation.
Can I use the 5V pin to power 5V sensors directly without a level shifter?
You can use the 5V pin to provide power to a 5V sensor (like an HC-SR04 ultrasonic module or a 5V relay board), provided your USB source can supply the current. However, you absolutely cannot connect the 5V data output of that sensor directly to an ESP32 GPIO pin. The ESP32 is strictly a 3.3V logic device. Feeding 5V into GPIO4 will slowly degrade the silicon and eventually destroy the pin's ESD protection diode, killing the microcontroller. Always use a bidirectional logic level shifter or a simple voltage divider (e.g., 2kΩ and 3.3kΩ resistors) for the data lines.






