When working with the generic ESP32 DevKit V1 (38-pin variant), guessing pin functions leads to boot loops, fried modules, and WiFi dropouts. Below is the exact esp32 38 pin pinout reference, followed by the critical hardware constraints and external wiring standards you need to wire sensors safely.

The Complete ESP32 38-Pin Pinout Reference Table

The 38-pin layout features 19 pins per side. Note that physical pin numbering (1-38) is rarely printed on the board; designers rely on the GPIO and function silkscreen. This table maps the physical left/right layout to the internal Espressif ESP32 Datasheet definitions.

Left Pin GPIO / Label Right Pin GPIO / Label Function & Restrictions
13V338GNDPower (3.3V out) / Ground
2EN37IO23Enable (Active High) / Digital I/O
3VP (IO36)36IO22ADC1_CH0, Input Only / Digital I/O, Default I2C SCL
4VN (IO39)35TX (IO1)ADC1_CH3, Input Only / UART0 TX (Debug Serial)
5IO3434RX (IO3)ADC1_CH6, Input Only / UART0 RX (Debug Serial)
6IO3533IO21ADC1_CH7, Input Only / Digital I/O, Default I2C SDA
7IO3232GNDADC1_CH4, Touch9 / Ground
8IO3331IO19ADC1_CH5, Touch8 / VSPI MISO
9IO2530IO18ADC2_CH8, DAC1 / VSPI SCK
10IO2629IO5ADC2_CH9, DAC2 / VSPI SS, Strapping Pin
11IO2728IO17ADC2_CH7, Touch7 / UART2 TX
12IO1427IO16ADC2_CH6, Touch6, HSPI SCK / UART2 RX
13IO1226IO4ADC2_CH5, Touch5, HSPI MISO, Strapping Pin / ADC2_CH0, Touch0
14GND25IO2Ground / ADC2_CH2, Touch2, Strapping Pin, Onboard LED
15IO1324IO15ADC2_CH4, Touch4, HSPI MOSI / ADC2_CH3, Touch3, HSPI SS, Strapping Pin
16IO923IO8HSPI MISO, Flash SPI / Flash SPI (Do Not Use)
17IO1022IO7HSPI SCK, Flash SPI / Flash SPI (Do Not Use)
18IO1121IO6HSPI SS, Flash SPI / Flash SPI (Do Not Use)
195V (VIN)20RST5V Input (USB or external) / Reset (Active Low)

Rows People Get Wrong: Strapping Pins, ADC2, and Flash SPI

The ESP-IDF GPIO API Reference explicitly warns about pins that control boot behavior or share hardware buses. If your project fails to boot or drops WiFi, you likely violated one of these rules:

The Flash SPI Trap (GPIO 6, 7, 8, 9, 10, 11): On the 38-pin DevKit V1, these pins are hardwired to the onboard WROOM-32 SPI flash memory. If you attempt to use them as standard I/O, or if an external sensor pulls them high/low during boot, the ESP32 will fail to read its own firmware and crash into a boot loop. Treat these pins as physically absent.

Strapping Pin Boot Failures

Strapping pins are sampled during reset to determine boot mode. If external circuitry forces them to the wrong state, the ESP32 enters flash download mode or fails to boot.

  • 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), it enters serial bootloader mode.
  • GPIO 2: Must be LOW or floating to boot from internal flash. Do not attach a pull-up resistor here.
  • GPIO 12 (MTDI): Must be LOW. If pulled HIGH, the ESP32 shifts the internal flash voltage regulator to 1.8V (instead of 3.3V), causing immediate brownouts and boot failures on standard WROOM modules.
  • GPIO 15: Must be LOW for normal boot output. If HIGH, it outputs debug logs from the ROM bootloader at 74880 baud, which can confuse attached UART peripherals.

The ADC2 vs. WiFi Conflict

If you are using WiFi or Bluetooth, you cannot use ADC2 (GPIO 0, 2, 4, 12, 13, 14, 15, 25, 26, 27). The WiFi radio driver claims the ADC2 hardware interrupt. If your project requires analog reads while WiFi is active, you must strictly use ADC1 (GPIO 32, 33, 34, 35, 36, 39).

External Wiring Color Codes: IEC vs NEC vs Legacy Standards

When wiring external sensors (I2C, SPI, power) to the ESP32, standardizing your jumper wire colors prevents catastrophic 5V-to-3.3V shorts. Regional electrical standards dictate DC low-voltage color codes. Choose the standard that matches your region or lab environment.

Function IEC 60446 (EU / Global / CE) US NEC (North America) Old UK (Pre-2004 Legacy)
DC Positive (V+ / 3.3V / 5V) Brown Red Red
DC Negative (GND / V-) Blue Black Black
Earth / Shield Ground Green/Yellow Stripe Green or Bare Copper Green
Signal / Data (I2C, SPI) Black, White, or Grey Yellow, Orange, or Blue Yellow or White
Bench Recommendation: For ESP32 breadboarding, adopt a modified IEC approach that separates voltage domains: Use Red for 5V (VIN), Orange for 3.3V, Black for GND, Yellow for SDA/SCL (I2C), and Blue for SPI/MOSI. This prevents accidentally feeding 5V into a 3.3V-only GPIO like GPIO 34, which will permanently destroy the input pad.

Faded Silkscreen? How to Safely Probe Unmarked 38-Pin Boards

Cheap clone boards from overseas marketplaces frequently suffer from faded, misaligned, or entirely missing silkscreen pin labels. Guessing the pinout by counting from the USB port is dangerous because some manufacturers mirror the layout or shift the 5V/GND pins.

Follow this safe interpretation protocol to map an unmarked 38-pin board:

  1. Identify Ground: Set your multimeter to continuity mode. Probe the metal shield of the micro-USB/USB-C port. One probe stays on the shield; sweep the other across the header pins. The pins that beep are your GND pins (usually 4 to 6 of them on a 38-pin board).
  2. Identify 5V (VIN): Power the board via USB. Set the multimeter to DC Voltage. Black probe on a known GND. Red probe sweeps the remaining power pins. The pin reading 4.8V–5.2V is VIN.
  3. Identify 3.3V: Locate the AMS1117-3.3 voltage regulator (the small SOT-223 IC near the USB port). Pin 3 of this regulator is the 3.3V output. Probe the header pins to find which one shares continuity with Pin 3.
  4. Map the GPIOs: For the remaining pins, upload a simple "pin sweep" sketch that sets each GPIO HIGH for 500ms in sequence while you monitor with a logic analyzer or an LED+resistor probe. Cross-reference the physical pin that lights up with the software GPIO number.

Decision Tree: Selecting the Right GPIO for Your Sensor

Stop guessing which pin to use. Use this decision path to terminate on the exact, safest GPIO for your specific peripheral requirement.

If your application requires... Then select these GPIOs Why? (The Hardware Reason)
I2C Bus (Sensors, OLEDs) SDA: 21, SCL: 22 Default hardware I2C pins; no internal pull-up conflicts.
SPI Bus (SD Cards, TFTs) SCK: 18, MISO: 19, MOSI: 23, SS: 5 Default VSPI bus; avoids the fatal Flash SPI pins (6-11).
Analog Input (with WiFi ON) 32, 33, 34, 35, 36, 39 ADC1 bus only. ADC2 is disabled by the WiFi radio driver.
PWM / LED Control 4, 16, 17, 18, 19, 25, 26, 27 High-drive capable, no boot-strapping conflicts.
Capacitive Touch 2, 4, 12, 13, 14, 15, 27, 32, 33 Routed to the internal touch sensor controller.
The Universal "Safe Zone" Default: If you are designing a custom PCB or wiring a complex sensor array and need a block of general-purpose, boot-safe, WiFi-compatible digital I/O pins, route your signals to GPIO 4, 5, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, and 33. These 14 pins have zero strapping pin conflicts, support both input and output, and remain fully functional while the WiFi radio is transmitting.