Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
ESP32 Pinout Reference: GPIO, ADC, PWM & Communication
Meta:Complete ESP32 Pinout Reference covering GPIO, ADC, DAC, PWM, and communication interfaces. Includes safe pin recommendations, strapping pins, and wiring tips.
The ESP32 Pinout Reference is essential knowledge for anyone serious about building reliable embedded projects. After years of designing PCBs with this chip, I’ve learned that understanding which pins to use—and which to avoid—can mean the difference between a project that works flawlessly and one that frustrates endlessly.
This guide provides a complete reference for ESP32 GPIO pins, covering analog-to-digital conversion, PWM generation, and all communication interfaces. Whether you’re transitioning from Arduino boards or diving straight into ESP32 development, this pinout reference will help you make informed design decisions.
Understanding ESP32 GPIO Architecture
The ESP32 microcontroller features 48 GPIO pins total, though typical development boards expose only 25-36 of these. What makes the ESP32 remarkable is its GPIO matrix—a flexible routing system that allows most peripheral functions to be assigned to almost any pin through software configuration.
Unlike traditional microcontrollers where SPI must use specific pins, the ESP32 lets you route SPI, I2C, UART, and PWM signals to your preferred GPIO pins. This flexibility simplifies PCB routing and allows creative solutions when pins conflict.
However, this flexibility comes with important caveats. Some pins have specific boot-time requirements. Others connect to internal flash memory and cannot be used. Understanding these restrictions separates successful ESP32 designs from problematic ones.
ESP32 DevKit V1 Pin Categories
Category
Pin Count
Description
General Purpose GPIO
25
Available for digital I/O
Input-Only GPIO
4
GPIO34-39, cannot output
ADC Channels
18
Analog input measurement
DAC Channels
2
Analog voltage output
Touch Sensors
10
Capacitive touch detection
PWM Channels
16
Pulse width modulation
Strapping Pins
5
Affect boot behavior
Complete ESP32 Pinout Reference Table
This comprehensive table covers the 30-pin ESP32 DevKit V1, one of the most common development boards. Pin behavior remains consistent across different manufacturers, though physical layouts vary.
Full GPIO Pin Mapping
GPIO
Board Pin
ADC
Touch
Default Function
Safe to Use
GPIO0
D0
ADC2_CH1
T1
Boot mode select
⚠️ Caution
GPIO1
TX0
–
–
UART0 TX
⚠️ Serial
GPIO2
D2
ADC2_CH2
T2
Boot mode, LED
⚠️ Caution
GPIO3
RX0
–
–
UART0 RX
⚠️ Serial
GPIO4
D4
ADC2_CH0
T0
General I/O
✅ Safe
GPIO5
D5
–
–
VSPI CS0
⚠️ Strapping
GPIO12
D12
ADC2_CH5
T5
HSPI MISO
⚠️ Strapping
GPIO13
D13
ADC2_CH4
T4
HSPI MOSI
✅ Safe
GPIO14
D14
ADC2_CH6
T6
HSPI CLK
✅ Safe
GPIO15
D15
ADC2_CH3
T3
HSPI CS0
⚠️ Strapping
GPIO16
D16
–
–
UART2 RX
✅ Safe
GPIO17
D17
–
–
UART2 TX
✅ Safe
GPIO18
D18
–
–
VSPI CLK
✅ Safe
GPIO19
D19
–
–
VSPI MISO
✅ Safe
GPIO21
D21
–
–
I2C SDA
✅ Safe
GPIO22
D22
–
–
I2C SCL
✅ Safe
GPIO23
D23
–
–
VSPI MOSI
✅ Safe
GPIO25
D25
ADC2_CH8
–
DAC1
✅ Safe
GPIO26
D26
ADC2_CH9
–
DAC2
✅ Safe
GPIO27
D27
ADC2_CH7
T7
General I/O
✅ Safe
GPIO32
D32
ADC1_CH4
T9
General I/O
✅ Safe
GPIO33
D33
ADC1_CH5
T8
General I/O
✅ Safe
GPIO34
D34
ADC1_CH6
–
Input only
✅ Input
GPIO35
D35
ADC1_CH7
–
Input only
✅ Input
GPIO36
VP
ADC1_CH0
–
Input only
✅ Input
GPIO39
VN
ADC1_CH3
–
Input only
✅ Input
Pins to Avoid
GPIO
Reason
Notes
GPIO6-11
SPI Flash
Connected to internal flash memory
GPIO0
Boot mode
Must be HIGH for normal boot
GPIO2
Boot mode
Should be LOW or floating at boot
GPIO12
Flash voltage
HIGH at boot causes boot failure
GPIO15
Debug output
Outputs debug data at boot
ESP32 ADC Pinout Reference
The ESP32 features two 12-bit SAR (Successive Approximation Register) ADCs with 18 channels total. This provides excellent analog measurement capability, but several important limitations affect real-world usage.
ADC Channel Distribution
ADC Unit
Channels
GPIO Pins
WiFi Compatible
ADC1
8
32, 33, 34, 35, 36, 37, 38, 39
✅ Yes
ADC2
10
0, 2, 4, 12, 13, 14, 15, 25, 26, 27
❌ No
ADC1 Pin Details (WiFi Safe)
Channel
GPIO
Available on DevKit
Notes
ADC1_CH0
GPIO36
Yes
Input only, VP pin
ADC1_CH3
GPIO39
Yes
Input only, VN pin
ADC1_CH4
GPIO32
Yes
General purpose
ADC1_CH5
GPIO33
Yes
General purpose
ADC1_CH6
GPIO34
Yes
Input only
ADC1_CH7
GPIO35
Yes
Input only
Critical ADC Limitations
The most important restriction: ADC2 cannot be used while WiFi is active. The WiFi driver exclusively claims ADC2 hardware, making those pins unavailable for analog readings during wireless operation.
For any project using WiFi, plan your analog sensors exclusively on ADC1 pins (GPIO32-39). This single design decision eliminates countless hours of debugging mysterious ADC failures.
The ESP32 ADC also exhibits non-linearity at voltage extremes. Readings below 100mV and above 3.2V become unreliable. For precision measurements, consider external ADCs or implement calibration routines using the ESP32’s eFuse calibration data.
ADC Resolution and Attenuation
Attenuation
Voltage Range
Use Case
0 dB
0 – 1.1V
Precision low-voltage
2.5 dB
0 – 1.5V
Extended range
6 dB
0 – 2.2V
Medium range
11 dB
0 – 3.3V
Full range (default)
ESP32 DAC Pinout Reference
The ESP32 includes two 8-bit Digital-to-Analog Converter channels for generating true analog voltage outputs. While limited in resolution, these DAC channels prove useful for many applications.
DAC Channel Assignment
Channel
GPIO
Voltage Range
Resolution
DAC1
GPIO25
0 – 3.3V
8-bit (256 levels)
DAC2
GPIO26
0 – 3.3V
8-bit (256 levels)
DAC applications include generating reference voltages, simple audio output, analog control signals, and creating waveforms for testing purposes. The 8-bit resolution limits audio quality, but works acceptably for basic tones and alerts.
For high-fidelity audio applications, use an external I2S DAC. The ESP32’s I2S interface supports professional audio DACs with 24-bit resolution and sample rates exceeding 192kHz.
ESP32 PWM Pinout Reference
The ESP32’s LED Control (LEDC) peripheral provides 16 independent PWM channels with impressive flexibility. Unlike some microcontrollers that dedicate specific pins to PWM, the ESP32 can generate PWM on any output-capable GPIO.
PWM Channel Specifications
Feature
Specification
Total Channels
16
Independent Frequencies
8 (shared pairs)
Resolution
1-16 bits configurable
Maximum Frequency
40 MHz (at 1-bit)
Typical Frequency
5 kHz (at 13-bit)
PWM-Capable GPIO Pins
All GPIO pins capable of output can generate PWM signals. This excludes only the input-only pins (GPIO34-39). In practice, avoid using strapping pins and serial pins for PWM unless absolutely necessary.
The ESP32’s GPIO matrix enables remarkable flexibility in assigning communication peripherals to GPIO pins. While default pins exist for convenience, you can reassign most interfaces to alternative pins through software configuration.
I2C Interface Pins
The ESP32 supports two I2C bus interfaces, both configurable to any output-capable GPIO pins.
Interface
Default SDA
Default SCL
Max Speed
I2C0
GPIO21
GPIO22
400 kHz
I2C1
Configurable
Configurable
400 kHz
I2C works through software bit-banging on the ESP32, allowing any GPIO pin combination. The default pins (GPIO21 SDA, GPIO22 SCL) remain the most commonly used and best documented.
SPI Interface Pins
The ESP32 provides four SPI controllers, though only two are available for general use (SPI0 and SPI1 connect to internal flash).
Interface
MOSI
MISO
CLK
CS
Max Speed
HSPI
GPIO13
GPIO12
GPIO14
GPIO15
80 MHz
VSPI
GPIO23
GPIO19
GPIO18
GPIO5
80 MHz
For maximum SPI performance (80 MHz), use the default pin assignments. Remapped pins pass through the GPIO matrix, limiting speeds to approximately 40 MHz.
UART Interface Pins
Three UART interfaces provide serial communication capability.
Interface
Default TX
Default RX
Notes
UART0
GPIO1
GPIO3
USB Serial, debugging
UART1
GPIO10
GPIO9
Flash pins, remap required
UART2
GPIO17
GPIO16
General use
UART0 connects to the USB-to-serial converter on most development boards. Reserve this for debugging and programming. UART1 defaults to pins used by the internal flash, requiring remapping before use. UART2 provides the cleanest option for connecting external serial devices.
The ESP32 integrates 10 capacitive touch sensors, enabling button-free user interfaces. These sensors detect proximity and touch through changes in pin capacitance.
Touch Sensor Pin Assignment
Touch
GPIO
ADC
Notes
T0
GPIO4
ADC2_CH0
Safe to use
T1
GPIO0
ADC2_CH1
Strapping pin
T2
GPIO2
ADC2_CH2
Strapping pin
T3
GPIO15
ADC2_CH3
Strapping pin
T4
GPIO13
ADC2_CH4
Safe to use
T5
GPIO12
ADC2_CH5
Strapping pin
T6
GPIO14
ADC2_CH6
Safe to use
T7
GPIO27
ADC2_CH7
Safe to use
T8
GPIO33
ADC1_CH5
Safe to use
T9
GPIO32
ADC1_CH4
Safe to use
Touch sensors T8 and T9 on GPIO32 and GPIO33 offer the best combination—they work with WiFi active (ADC1 pins) and have no boot-time restrictions.
ESP32 Strapping Pins Reference
Five GPIO pins determine ESP32 boot behavior. Incorrect states on these pins during power-up cause boot failures or unexpected operation modes.
Strapping Pin Requirements
GPIO
Required State
Effect if Wrong
GPIO0
HIGH
Enters download mode
GPIO2
LOW/Floating
Boot may fail
GPIO5
HIGH
SDIO timing issues
GPIO12
LOW
Boot failure (3.3V flash)
GPIO15
HIGH
Suppresses boot messages
Most development boards include circuitry ensuring correct strapping pin states. Problems arise when external circuits pull these pins to incorrect levels during power-up.
If you must use strapping pins, ensure your external circuits don’t override the required boot states. Adding series resistors (1K-10K) between the ESP32 and external devices often resolves conflicts.
Useful Resources and Downloads
Resource
Description
URL
ESP32 Datasheet
Official Espressif documentation
espressif.com/documentation
ESP32 Technical Reference
Detailed peripheral information
espressif.com
Arduino-ESP32 Core
GitHub repository
github.com/espressif/arduino-esp32
ESP-IDF Documentation
Official development framework
docs.espressif.com
Random Nerd Tutorials
ESP32 project tutorials
randomnerdtutorials.com
Last Minute Engineers
Detailed pinout guides
lastminuteengineers.com
Frequently Asked Questions
Which ESP32 GPIO pins are safe to use for any purpose?
GPIO4, GPIO13, GPIO14, GPIO16, GPIO17, GPIO18, GPIO19, GPIO21, GPIO22, GPIO23, GPIO25, GPIO26, GPIO27, GPIO32, and GPIO33 are generally safe for any application. These pins have no special boot requirements and don’t conflict with internal peripherals. GPIO34-39 are safe but limited to input-only operation.
Can I use ADC2 pins while WiFi is enabled?
No. The WiFi driver exclusively controls ADC2 hardware during wireless operation. Any attempt to read ADC2 channels while WiFi is active returns unreliable results. Design your analog inputs around ADC1 pins (GPIO32-39) for projects requiring WiFi connectivity.
Why won’t my ESP32 boot when I connect a device to GPIO12?
GPIO12 is a strapping pin that determines flash voltage at boot. If GPIO12 reads HIGH during power-up, the ESP32 attempts to use 1.8V flash voltage, causing boot failure on boards with 3.3V flash. Ensure GPIO12 stays LOW during reset, or use a different pin for your device.
How many PWM outputs can the ESP32 generate simultaneously?
The ESP32 can generate 16 independent PWM outputs using the LEDC peripheral. However, only 8 different frequencies are available—channels share timers in pairs. For most applications requiring LED dimming, motor control, or servo signals, 16 channels with 8 frequencies provides ample flexibility.
What’s the maximum I2C or SPI speed on remapped pins?
SPI through the GPIO matrix (non-default pins) limits to approximately 40 MHz versus 80 MHz on default pins. I2C performance remains similar regardless of pin assignment since it uses software implementation. For maximum SPI throughput, stick with HSPI or VSPI default pins.
Conclusion
This ESP32 Pinout Reference covers the essential information needed for successful hardware design. The ESP32’s flexibility creates tremendous opportunities, but also demands careful pin selection to avoid boot conflicts and peripheral limitations.
Remember these key principles: use ADC1 pins for analog inputs with WiFi, respect strapping pin requirements, and leverage the GPIO matrix for routing flexibility. Document your pin assignments thoroughly—future you will appreciate the clarity.
The ESP32 remains one of the most capable and cost-effective microcontrollers available. Master its pinout, and you’ll build projects that work reliably from prototype through production.
Suggested Meta Descriptions:
Option 1 (155 characters): Complete ESP32 Pinout Reference covering GPIO, ADC, DAC, PWM, and communication interfaces. Includes safe pin recommendations, strapping pins, and wiring tips.
Option 2 (152 characters): Master the ESP32 pinout with this detailed GPIO reference guide. Covers ADC channels, PWM configuration, I2C, SPI, UART pins, and boot mode requirements.
Option 3 (158 characters): ESP32 Pinout Reference for developers and engineers. Comprehensive guide to GPIO pins, analog inputs, PWM outputs, communication interfaces, and safe pin usage.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.