The 30-pin ESP32 DevKit V1 (typically housing the ESP32-WROOM-32 module) is the most common footprint for hobbyist IoT builds. Unlike the wider 38-pin variant, the 30-pin board omits duplicate ground and voltage pins to maintain a narrow, breadboard-friendly profile. However, this density means every pin counts, and misinterpreting the esp32 30 pin pinout can lead to boot failures, fried silicon, or WiFi dropouts.
Below is the exact bench reference you need to wire sensors, manage power, and avoid the silicon-level traps Espressif baked into the chip architecture.
The Complete ESP32 30 Pin Pinout Table
This table maps the physical silkscreen labels on a standard 30-pin NodeMCU-32S / DevKit V1 board. Read the left column from top to bottom (pins 1-15), and the right column from top to bottom (pins 16-30).
| Left Side (1-15) | Primary Function | Right Side (16-30) | Primary Function |
|---|---|---|---|
| 3V3 | 3.3V Power Output (Max 500mA) | VIN | 5V Input (USB or external 5V) |
| GND | Ground | GND | Ground |
| GPIO 15 | ADC2, Touch3, Strapping Pin | GPIO 13 | ADC2, Touch4, UART0 CTS |
| GPIO 2 | ADC2, Touch2, Strapping Pin, LED | GPIO 12 | ADC2, Touch5, Strapping Pin |
| GPIO 4 | ADC2, Touch0, SDIO | GPIO 14 | ADC2, Touch6, SDIO |
| GPIO 16 | UART2 RX (No ADC/Touch) | GPIO 27 | ADC2, Touch7, SDIO |
| GPIO 17 | UART2 TX (No ADC/Touch) | GPIO 26 | DAC2, ADC2, SDIO |
| GPIO 5 | SPI SS, PWM, Strapping Pin | GPIO 25 | DAC1, ADC2, SDIO |
| GPIO 18 | SPI SCK (VSPI) | GPIO 33 | ADC1, Touch8, XTAL |
| GPIO 19 | SPI MISO (VSPI) | GPIO 32 | ADC1, Touch9, XTAL |
| GPIO 21 | I2C SDA (Default) | GPIO 35 | ADC1, Input Only |
| GPIO 3 | UART0 RX (Flash/Serial) | GPIO 34 | ADC1, Input Only |
| GPIO 1 | UART0 TX (Flash/Serial) | GPIO 39 | ADC1, Input Only |
| GPIO 22 | I2C SCL (Default) | GPIO 36 | ADC1, Input Only |
| GPIO 23 | SPI MOSI (VSPI) | EN | Enable (Pull low to reset) |
Rows People Get Wrong: Strapping Pins and ADC Conflicts
Reading the table is easy; knowing which pins will silently break your project is the hard part. Here are the specific rows where hobbyists consistently make mistakes.
The Strapping Pin Trap (GPIO 0, 2, 5, 12, 15)
During boot, the ESP32 reads the voltage state of specific pins to determine its operating mode. If you wire a sensor or relay that pulls these pins low or high during power-on, the chip will enter the wrong boot mode or brownout.
- GPIO 12 (MTDI): The most dangerous strapping pin. If pulled HIGH on boot, it tells the internal regulator to output 1.8V to the flash memory instead of 3.3V. The ESP32-WROOM-32 requires 3.3V; applying 1.8V causes an immediate boot loop or permanent flash corruption.
- GPIO 0: Must be HIGH for normal boot. If pulled LOW (e.g., by a button wired directly to ground without a pull-up resistor), the ESP32 enters UART download mode and your code will not run.
- GPIO 2: Must be LOW or floating to boot. If pulled HIGH, the boot fails. (This is why the onboard LED is safe—it doesn't pull the pin high externally).
The ADC2 vs. WiFi Conflict
If your project uses WiFi or Bluetooth, you cannot use ADC2 pins (GPIO 4, 0, 2, 15, 12, 13, 14, 27). The ESP32's radio subsystem takes exclusive control of the ADC2 hardware. If you try to read an analog sensor on GPIO 34 while WiFi is active, it works fine (ADC1). If you try to read GPIO 13 (ADC2), the `analogRead()` function will return erratic zeros or fail silently. Always route analog sensors to ADC1 pins (32, 33, 34, 35, 36, 39) for wireless IoT nodes.
Input-Only Pins (34, 35, 36, 39)
These pins lack internal pull-up or pull-down resistors and cannot drive outputs. If you wire a digital sensor here, you must provide an external 10kΩ pull-up or pull-down resistor, otherwise the pin will float and trigger phantom interrupts.
External Sensor & Power Wiring Color Codes (IEC vs NEC)
When your ESP32 project leaves the breadboard and interfaces with external power supplies, relays, or industrial sensors, you must follow regional wire color codes for the external harness. Mixing up a 12V solenoid feed with a 3.3V logic line because you used the wrong wire color will instantly fry the GPIO matrix.
Below is the reference for DC and low-voltage AC wiring standards. For deeper microcontroller-to-sensor mapping, consult comprehensive guides like Random Nerd Tutorials' ESP32 GPIO Reference.
| Function | IEC 60446 (EU / Global) | NEC (US / Canada) | Old UK (Pre-2004) |
|---|---|---|---|
| AC Line (Hot) | Brown | Black | Red |
| AC Neutral | Blue | White (or Grey) | Black |
| Earth / Ground (PE) | Green/Yellow Stripe | Green or Bare Copper | Green |
| DC Positive (+) | Brown | Red | Red |
| DC Negative (-) | Blue | Black | Black |
| DC Switched/Signal | Black | Yellow or Blue | Yellow |
Never trust wire color alone, especially on retrofitted industrial equipment or cheap imported sensor harnesses. If markings are faded, missing, or the equipment predates regional standard harmonization, always verify with a multimeter. Measure voltage relative to a known chassis ground before connecting any external harness to your ESP32's VIN or optocoupler inputs.
ESP32 30-Pin Pinout FAQ
Can I use all 30 pins as standard GPIO outputs?
No. Out of the 30 physical pins, 2 are dedicated to power (3V3, VIN), 2 are ground, 1 is Enable (EN), and 1 is a strapping pin (GPIO 5) that is best left alone for general IO. Furthermore, GPIO 34, 35, 36, and 39 are hardware-locked as input-only. They cannot drive LEDs, relays, or logic signals. This leaves you with roughly 21 safe, bidirectional GPIO pins for general output use.
Why does my ESP32 30-pin board fail to boot when GPIO 12 is pulled high?
GPIO 12 (MTDI) is a strapping pin that dictates the flash memory operating voltage. The ESP32-WROOM-32 module uses a 3.3V SPI flash chip. If GPIO 12 is pulled HIGH during the boot sequence, the internal voltage regulator switches the flash VDD to 1.8V. The flash chip fails to initialize, and the ESP32 throws a continuous boot loop error in the serial monitor. Keep GPIO 12 floating or pulled LOW via a 10kΩ resistor if you must use it for a sensor.
How do I safely wire a 5V sensor to the 3.3V ESP32 30-pin GPIOs?
The ESP32 GPIOs are strictly 3.3V tolerant. Feeding 5V into GPIO 21 will degrade the silicon and eventually short the pin to VCC. To interface a 5V sensor (like an HC-SR04 ultrasonic module), use a logic level converter (like a BSS138 MOSFET breakout) or a simple voltage divider. For a voltage divider, connect the 5V sensor output to a 2.2kΩ resistor, then to the ESP32 GPIO, and place a 3.3kΩ resistor from that GPIO to GND. This drops the 5V signal down to a safe ~3.0V.
What is the maximum current draw per GPIO pin on the 30-pin DevKit?
The absolute maximum current per GPIO pin is 40mA, but Espressif strongly recommends keeping continuous draws under 20mA. The total current draw across all GPIO pins combined should not exceed 120mA. If you are driving a 5V relay coil or a high-power LED strip, never power it directly from the GPIO. Use the GPIO to trigger a logic-level MOSFET (like an IRLZ44N) or an optocoupler, and pull the heavy current directly from the VIN or an external power supply.






