The Ultimate ESP32 VROOM Pinout Quick Reference
The ESP32-WROOM-32 (widely referred to as the ESP32 VROOM) remains one of the most powerful and cost-effective microcontrollers for IoT, robotics, and home automation. However, its massive peripheral set and multiplexed GPIOs often lead to wiring conflicts, boot failures, and ADC inaccuracies. This FAQ and quick reference guide is engineered for makers, electrical engineers, and PCB designers who need immediate, accurate data without wading through 600-page technical reference manuals.
Before diving into the pin mappings, it is critical to distinguish between the raw ESP32-WROOM-32 module (which features 38 castellated pads) and the ubiquitous ESP32 DevKit V1 / NodeMCU-32S development boards. The raw module exposes pins like GPIO 6-11 (which are internally routed to the SPI flash), while DevKits usually break out only 30 or 38 usable pins. This guide focuses on the logical GPIO mappings applicable to the silicon itself, which dictates how your code and custom PCBs must behave.
Core GPIO Mapping & Functionality Table
Below is the definitive quick-reference table for the ESP32 VROOM's usable GPIOs. Keep in mind that the ESP32 features a highly flexible GPIO matrix, meaning most digital peripherals (I2C, SPI, UART) can be mapped to almost any pin via software. However, hardware defaults and native constraints still apply.
| GPIO | Primary / Default Function | Input/Output | Critical Notes & Constraints |
|---|---|---|---|
| GPIO 0 | Boot Strapping / PWM | I/O | Must be HIGH at boot. Internal pull-up. |
| GPIO 1 | UART0 TX | Output | Debug console. HIGH at boot. |
| GPIO 2 | Boot Strapping / PWM | I/O | Must be LOW or floating at boot. Connected to onboard LED on many DevKits. |
| GPIO 3 | UART0 RX | Input | Debug console. HIGH at boot. |
| GPIO 4 | Touch0 / ADC2_CH0 | I/O | Safe to use. No boot constraints. |
| GPIO 5 | VSPI SS / PWM | I/O | Strapping pin for SDIO timing. Outputs PWM at boot. |
| GPIO 6-11 | SPI Flash | N/A | DO NOT USE. Connected to internal Winbond SPI flash. |
| GPIO 12 | Touch5 / ADC2_CH5 | I/O | Strapping pin for flash voltage (MTDI). Must be LOW for 3.3V flash. |
| GPIO 13-15 | Touch / ADC2 / UART | I/O | GPIO 15 is a strapping pin (MTDO). Emits debug noise at boot. |
| GPIO 16-17 | UART2 / PSRAM | I/O | Used for external PSRAM on WROVER models. Safe on standard WROOM-32. |
| GPIO 18-23 | VSPI Bus | I/O | Standard hardware SPI pins (MOSI, MISO, SCK, SS). |
| GPIO 25-27 | DAC / ADC2 | I/O | GPIO 25 & 26 are the only true Digital-to-Analog (DAC) outputs. |
| GPIO 32-33 | XTAL / ADC1 / Touch | I/O | Safe to use. Often used for I2C on custom boards. |
| GPIO 34-39 | ADC1 / Sensor Inputs | Input Only | No internal pull-up/pull-down resistors. Require external circuitry. |
The Strapping Pins Trap: Why Your ESP32 Fails to Boot
The most frequent hardware-level failure in custom ESP32 VROOM designs involves the boot strapping pins. During the reset sequence, the ESP32's bootloader samples the voltage levels on specific GPIOs to determine the boot mode (e.g., Flash boot vs. UART download mode) and the SPI flash voltage.
According to the official Espressif Hardware Design Guidelines, floating strapping pins in high-EMI environments can cause erratic boot behavior, brownouts, or permanent bootloops.
Strapping Pin Logic Requirements
- GPIO 0: Determines boot mode. Must be HIGH (via 10kΩ pull-up) for normal SPI Flash execution. Pull LOW only when flashing firmware via UART.
- GPIO 2: Must be LOW or floating to enter Flash boot. Do not attach external pull-ups or LEDs that source current to this pin on boot.
- GPIO 12 (MTDI): Dictates the internal voltage regulator for the SPI flash. If your module uses a 3.3V flash chip (which 99% of WROOM-32 modules do), GPIO 12 must be LOW at boot. If pulled HIGH, the regulator outputs 1.8V, instantly browning out the flash chip and causing a bootloop.
- GPIO 15 (MTDO): Controls boot debug log output. Must be HIGH for normal operation. Pulling it LOW silences the bootloader UART output.
ADC & Touch Sensor Mapping: Avoiding Wi-Fi Conflicts
The ESP32 VROOM features two distinct Analog-to-Digital converters: ADC1 and ADC2. Understanding the difference is non-negotiable for IoT sensor nodes.
The ADC2 Wi-Fi Limitation
ADC2 (mapped to GPIOs 0, 2, 4, 12-15, 25-27) shares hardware resources with the Wi-Fi radio. When the Wi-Fi driver is initialized (WiFi.begin()), ADC2 becomes completely disabled. Any attempt to read an ADC2 pin while connected to Wi-Fi will return garbage data or zero. For battery-powered IoT sensors requiring simultaneous analog readings and wireless transmission, you must route your sensors to ADC1 (GPIO 32-39).
ADC Attenuation & Voltage Ranges
The ESP32's 12-bit ADC is notoriously non-linear at the extremes. To measure different voltage scales, you must configure the attenuation in your Arduino sketch or ESP-IDF code. Based on the ESP32-WROOM-32 Datasheet, here are the safe measurable ranges:
| Attenuation | Code Constant | Measurable Voltage Range | Best Use Case |
|---|---|---|---|
| 0 dB | ADC_0db | 100 mV – 950 mV | Low-voltage precision sensors |
| 2.5 dB | ADC_2_5db | 100 mV – 1250 mV | Standard 1.2V logic monitoring |
| 6 dB | ADC_6db | 150 mV – 1750 mV | 1.5V battery cell monitoring |
| 11 dB | ADC_11db | 150 mV – 2450 mV | 3.3V system rail (Requires voltage divider for true 3.3V) |
Frequently Asked Questions (FAQ)
1. Is the ESP32 VROOM 5V tolerant?
Absolutely not. The ESP32 operates at 3.3V logic. Feeding 5V into any GPIO (including RX/TX and ADC pins) will permanently degrade or destroy the silicon. When interfacing with 5V components like the HC-SR04 ultrasonic sensor or standard 5V I2C LCDs, you must use a bidirectional logic level shifter or a simple resistor voltage divider (e.g., 1kΩ and 2kΩ) on the signal lines.
2. What are the default I2C pins for the Arduino IDE?
While the ESP32 GPIO matrix allows you to assign I2C to almost any pin, the Arduino Wire library defaults to GPIO 21 (SDA) and GPIO 22 (SCL). If you are designing a custom PCB, routing your I2C bus to these specific pins will save you from having to manually redefine the Wire library in your setup code.
3. Which pins can wake the ESP32 from Deep Sleep?
Not all GPIOs are connected to the RTC (Real-Time Clock) domain. To use the esp_sleep_enable_ext0_wakeup() or ext1 functions, you are restricted to RTC-capable GPIOs. These include GPIO 0, 2, 4, 12-15, 25-27, and 32-39. Standard digital pins like GPIO 16-23 cannot wake the chip from deep sleep.
4. Why do GPIO 34-39 require external pull-up/pull-down resistors?
GPIO 34 through 39 are hardware-configured as input-only pins. They lack the internal software-configurable pull-up and pull-down resistors found on the rest of the GPIO matrix. If you are wiring a mechanical switch or a PIR motion sensor to these pins, you must solder a physical 10kΩ resistor to VCC or GND to prevent the pin from floating and generating phantom interrupts.
Hardware Design Best Practices for Custom PCBs
Moving from a breadboard to a custom PCB? Follow these schematic rules to ensure reliable manufacturing and flashing, as recommended by experts at Random Nerd Tutorials and Espressif's reference designs:
- The EN (Enable) Pin: Must be pulled HIGH with a 10kΩ resistor to 3.3V. Additionally, place a 1μF to 10μF ceramic capacitor between EN and GND. This delays the boot sequence just enough for the power rail to stabilize, preventing brownout resets.
- Auto-Reset Circuit: To enable seamless firmware uploading without pressing the physical 'BOOT' and 'EN' buttons, implement the standard dual-NPN transistor (or dual N-channel MOSFET) DTR/RTS auto-reset circuit on GPIO 0 and EN.
- Antenna Keep-Out Zone: If using the raw WROOM-32 module, the PCB area directly beneath and in front of the antenna trace must be completely cleared of copper pours, traces, and components to prevent RF detuning and Wi-Fi range degradation.
- Decoupling Capacitors: Place a 10μF bulk capacitor and a 100nF high-frequency decoupling capacitor as physically close to the 3V3 and GND pins of the module as possible. The ESP32 can draw spikes of up to 500mA during Wi-Fi transmission bursts; inadequate local capacitance will trigger the internal brownout detector.






