The ESP32’s pinout is one of its greatest strengths, and one of the most common sources of confusion. With heavy multiplexing, strict boot-mode dependencies, and sensitive analog behavior, correct pin selection is important for stable operation. This article organizes every major pin group clearly so you can avoid conflicts, prevent boot failures, and design reliable ESP32-based hardware.

Understanding the ESP32 Pinout
The ESP32 is a powerful and flexible microcontroller widely used in IoT, automation, and smart devices. Its advanced capabilities come from a highly multiplexed pinout system in which many functions share the same physical pins. These include digital I/O, ADC channels, capacitive touch sensors, communication buses, RTC-domain pins, and internal connections for SPI flash and boot configuration. Because many functions share pins, improper wiring can cause failed boots, noisy ADC readings, or disabled peripherals.
ESP32 DevKit Pin Layout

ESP32 development boards typically come in 30-pin and 38-pin versions, both exposing the same core functions, but with minor differences in available GPIOs.
Pin Groups on ESP32 Dev Boards
| Group | Description |
|---|---|
| Power Pins | VIN (5 V), 3.3 V output, GND |
| Control Pins | EN (reset), IO0 (boot mode) |
| GPIO Pins | Digital I/O with multiplexing |
| Analog Pins | ADC1 and ADC2 channels |
| Communication Pins | SPI, I2C, UART, I2S |
| Input-Only Pins | GPIO34–GPIO39 |
| Flash-Reserved Pins | GPIO6–GPIO11 |
Common Header Arrangement
Left Header
• EN, GPIO36–39, GPIO34–35
• GPIO32–33, 25–27
• VIN, GND, 3.3V
Right Header
• GPIO0–23
• Boot-strapping pins (0, 2, 5, 12, 15)
Understanding the physical layout makes it easier to avoid mistakes and plan wiring efficiently.
ESP32 GPIO Overview

ESP32 GPIOs are flexible thanks to the internal I/O Matrix, which allows peripherals like UART, SPI, I2C, and PWM to be mapped almost anywhere. GPIOs support digital input/output with built-in pull-up/down resistors, edge-triggered interrupts, and reliable switching at high speeds. Typical continuous drive current is 12–16 mA (peaks up to ~20–40 mA), so external drivers are required for motors or relays.
Input-Only Pins
These pins cannot drive output and are ideal for sensors and analog inputs:
| Pin | Type | Recommended Use |
|---|---|---|
| GPIO34 | Input only | ADC1 / sensors |
| GPIO35 | Input only | ADC1 |
| GPIO36 (VP) | Input only | ADC1 / Hall sensor |
| GPIO39 (VN) | Input only | ADC1 |
Safe ESP32 Pins to Use and Pins to Avoid

Not all ESP32 pins behave equally. Some are safe, while others influence boot mode or are tied to internal flash memory.
Safe Pins (Recommended for All Users)
| GPIOs | Notes |
|---|---|
| 4, 13–19, 21–27, 32, 33 | No boot impact, ideal for most peripherals |
Caution Pins (Affect Boot Mode)
| GPIO | Boot Function | Avoid During Boot |
|---|---|---|
| GPIO0 | Flash/Boot mode | Keep HIGH (input) during normal boot |
| GPIO2 | Boot voltage | Must be HIGH |
| GPIO5 | Optional boot mode | Avoid pulling low |
| GPIO12 | Flash voltage mode | Must stay LOW |
| GPIO15 | SPI mode | Must stay LOW |
These pins are safe to use in normal operation, but external components must not pull them to invalid logic levels during reset. Their detailed boot roles are explained in Section 9.
Restricted Pins (Do Not Use)
| GPIO | Reason |
|---|---|
| GPIO6–11 | Connected to SPI flash memory |
Using these may freeze or crash the ESP32.
ESP32 ADC Pins

The ESP32 integrates two SAR ADC units with different operational behavior:
• ADC1 — Always available and recommended for all sensor inputs
• ADC2 — Shared with the Wi-Fi subsystem and becomes unavailable whenever Wi-Fi is active
This is one of the key limitations of the ESP32, making ADC1 the reliable choice for measurements in wireless applications.
| ADC Unit | Channels | GPIOs | Notes |
|---|---|---|---|
| ADC1 | CH0–CH7 | GPIO32–39 | Best choice for sensors |
| ADC2 | CH0–CH9 | 0, 2, 4, 12–15, 25–27 | Unusable during Wi-Fi |
Voltage Range & Accuracy
The ADCs support a default 0–1.1 V input range, extendable to about 3.3 V with attenuation. Both ADC units are non-linear and benefit from calibration. Analog performance can be affected by internal RF activity, so routing sensor lines away from the antenna and adding simple RC filters can greatly improve stability. For Wi-Fi-enabled projects, always place analog sensors on ADC1 to ensure continuous and noise-free operation.
ESP32 DAC, PWM, and Touch Pins
The ESP32 includes onboard analog-style outputs and touch sensors that simplify waveform generation, dimming, motor control, and user interfaces.
DAC Overview

Two 8-bit DAC channels output true analog voltages:
| DAC | GPIO |
|---|---|
| DAC1 | GPIO25 |
| DAC2 | GPIO26 |
Common uses include simple audio, analog waveforms, LED fading, and bias voltages. Output range is typically 0–3.3 V.
PWM (LEDC)

The LEDC module provides high-resolution, flexible PWM:
• 16 channels
• Up to 40 MHz timer base
• Up to 20-bit resolution
• Fully remappable GPIOs
Used for LED dimming, motor control, servo signals, audio tones, and general modulation. Any GPIO can host a PWM output via the GPIO Matrix.
Touch Sensor Pins

The ESP32’s 10 capacitive touch pads detect finger proximity and are useful for touch buttons, sliders, and wake-up triggers.
| Touch Pad | GPIO |
|---|---|
| T0–T9 | GPIO4, 0, 2, 15, 13, 12, 14, 27, 33, 32 |
These sensors include noise filtering and work well for low-power wake events.
ESP32 Communication Pins
The ESP32 includes a rich set of communication peripherals, each capable of being routed to multiple pins through the flexible GPIO Matrix. This allows interfaces such as I2C, SPI, and UART to be assigned almost anywhere, enabling highly customizable board layouts and peripheral combinations.
I2C (Default and Custom Pins)

The ESP32 includes two I2C controllers, with full flexibility over pin selection. Although most development boards use the default pins, both SDA and SCL can be reassigned to nearly any GPIO.
| Signal | Default GPIO | Notes |
|---|---|---|
| SDA | GPIO21 | Fully remappable |
| SCL | GPIO22 | Fully remappable |
Any two digital GPIOs can act as SDA and SCL. Supports both standard-mode (100 kHz), fast-mode (400 kHz), and fast-mode plus (1 MHz depending on board). Supports internal pull-ups on some boards, but external 4.7 kΩ resistors are recommended for stable communication. This flexibility makes the ESP32 ideal for systems requiring multiple sensors or unconventional pin routing.
The ESP32 includes multiple SPI buses, with HSPI and VSPI available for user devices. Both support remapping through the GPIO matrix, but most boards and libraries use the following default VSPI configuration, which avoids conflicts with internal flash connections:
Default VSPI Mapping
• SCK → GPIO18
• MISO → GPIO19
• MOSI → GPIO23
• CS → GPIO5
VSPI is typically preferred for displays, SD cards, and high-speed peripherals. While pins are remappable, using the defaults ensures maximum compatibility and reduces timing issues without repeating restrictions already covered in earlier sections.
UART (Serial)

The ESP32 includes three UART controllers, with flexible routing that allows any UART pins to move to nearly any GPIO.
| UART | TX Pin | RX Pin | Primary Purpose |
|---|---|---|---|
| UART0 | GPIO1 | GPIO3 | Flashing, boot messages, serial logging |
| UART1 | GPIO10 | GPIO9 | Available for user applications |
| UART2 | GPIO17 | GPIO16 | Available for user applications |
ESP32 Deep-Sleep & RTC Pins
The ESP32 includes an Ultra-Low-Power (ULP) subsystem and a dedicated Real-Time Clock (RTC) domain that remain powered even when the main CPU and peripherals are turned off. This architecture enables extremely low power consumption, often in the microampere range, making the ESP32 suitable for long-term battery-operated applications.
Deep sleep allows the chip to shut down the main cores, most internal clocks, and the Wi-Fi/Bluetooth radios, while still monitoring selected pins and sensors through the RTC peripherals.

The ESP32 can wake from deep sleep through several independent triggers. Each wake source operates inside the RTC domain, which is designed to stay active with minimal power consumption.
| Wake Type | GPIOs / Notes |
|---|---|
| External RTC GPIO | GPIO32, GPIO33, GPIO25, GPIO26, GPIO27 — support edge or level wake-up |
| Capacitive Touch Pads | T0–T9 — detects finger proximity or touch during deep sleep |
| Timer Wake-Up | RTC timer can wake the device after a programmed interval |
| ULP Co-Processor | (Optional) Custom low-power code can run to check sensors before waking the main CPU |
These pins belong to the RTC domain and remain active even when CPU and regular GPIOs are powered down. They support wake-up via rising/falling edges or simple level detection. Commonly used for wake-on-motion, magnetic switches, and low-power triggers.
ESP32 Boot, Strapping, and EN Pin Functions

The ESP32 uses several strapping pins that determine key system configurations during reset or power-up. These pins are sampled only at boot and then return to normal GPIO function. Ensuring they are not driven to invalid levels during reset is useful for consistent startup behavior.
Strapping Pin Table
| Pin | Boot Role | Required State at Boot |
|---|---|---|
| GPIO0 | Selects bootloader / flash mode | LOW = enter flash mode; HIGH = normal startup |
| GPIO2 | Defines internal boot voltage level | Must remain HIGH |
| GPIO5 | SPI boot configuration | Must remain HIGH |
| GPIO12 | Selects flash voltage (3.3 V / 1.8 V) | Must remain LOW for 3.3 V flash |
| GPIO15 | Sets SPI communication mode during boot | Must remain LOW |
This section provides the authoritative reference for strapping behavior. Earlier sections summarize only the practical effects; use this table when assigning pins on custom PCBs or integrating buttons and sensors.
EN Pin (Enable / Reset)
The EN (Enable) pin acts as the master reset input for the ESP32.
EN Pin Behavior:
• Pulling EN LOW resets the chip immediately.
• Releasing it back to HIGH powers up the internal circuits and restarts the boot sequence.
• On development boards (e.g., ESP32-DevKitC, NodeMCU-ESP32), EN is tied to the USB-to-serial interface to allow auto-reset during flashing.
ESP32 Power Pins

The ESP32 is sensitive to power quality because its Wi-Fi and Bluetooth radios draw short, high-amplitude current pulses. Stable power delivery ensures reliable booting, reduced brownout resets, and consistent wireless performance.
Power Pin Summary
| Pin | Voltage | Use |
|---|---|---|
| VIN | 5 V input | Feeds the onboard regulator (typically AMS1117 or ME6211) to generate 3.3 V |
| 3V3 | 3.3 V output | Regulated output from the onboard LDO; used to power external low-current logic and sensors |
| GND | — | Electrical reference and return path for all subsystems |
Recommended ESP32 Pins & Wiring Examples
Choosing the right pins on the ESP32 is needed for stable operation, clean signal routing, and avoiding conflicts with boot-strapping or internal flash connections. The following recommendations highlight the most reliable, conflict-free pins for common functions.
Pin Choices
| Function | Best Pins | Notes |
|---|---|---|
| I2C | 21 (SDA), 22 (SCL) | Default hardware-tested pair; works in most boards. |
| SPI | 18 (SCK), 19 (MISO), 23 (MOSI), 5 (CS) | These pins map cleanly to VSPI and avoid flash-connected pins. |
| UART | 16 (RX), 17 (TX) | Dedicated UART2 pins, safe for boot and debugging. |
| PWM (LEDC) | 4, 16–19, 21–27, 32–33 | High-flexibility range; PWM can be routed to almost any GPIO. |
| ADC | 32–39 (ADC1) | ADC1 channels remain usable even when Wi-Fi is active. |
Conclusion
Mastering the ESP32 pinout removes guesswork and prevents many of the problems that appear in actual builds, from noisy ADC readings to endless boot loops. By understanding safe pins, strapping behavior, power integrity, and deep-sleep routing, you can design circuits that remain stable, predictable, and wireless-ready. Use the pin maps and guidelines above as your foundation for trouble-free ESP32 projects.
Frequently Asked Questions [FAQ]
How do I configure PlatformIO for the Freenove ESP32-S3 Breakout Board?
Use the standard ESP32-S3 dev module settings. In your platformio.ini, add:
[env:esp32s3]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
This matches the Freenove pinout, allowing normal compiling and uploading via USB.
How many peripherals can the ESP32 run at the same time?
Because of the GPIO Matrix, the ESP32 can run multiple I²C, SPI, UART, PWM, and ADC functions simultaneously, as long as you avoid restricted pins and stay within CPU and timing limits. The main bottlenecks are ADC2 during Wi-Fi and power supply quality, not the pin count.
Why does my ESP32 reboot when connecting sensors or modules?
Unexpected resets usually come from voltage dips caused by Wi-Fi bursts, motors, or poorly regulated supplies. Using a 1 A or higher 5 V source, adding 10–100 µF bulk capacitors, and isolating noisy loads prevents brownouts.
Can I use the ESP32’s 3.3 V pin to power external modules?
Yes, but only for low-current devices (typically under 300–500 mA, depending on the onboard LDO). High-draw peripherals like motors, servos, and large LED strips must use a separate power supply to avoid resets and overheating.
How do I choose the best ESP32 pins when using multiple peripherals?
Prioritize non-strapping pins, avoid GPIO6–11, place analog sensors on ADC1, and use default VSPI/I²C/UART pins when possible. This reduces conflicts and ensures that all peripherals can operate together without remapping issues.