ESP32 Pinout Guide (GPIO · ADC · DAC · Touch): Complete Hardware Reference for Stable Circuit Design

ESP32 Pinout Guide (GPIO · ADC · DAC · Touch): Complete Hardware Reference for Stable Circuit Design

Oct 30th,2025

ESP32 pinout diagram showing GPIO, DAC, and touch pins with power connections on a breadboard

ESP32 Pinout Guide: GPIO, ADC, DAC, and Touch Explained

The ESP32 pinout is essential to understand when designing stable, reliable, and efficient hardware for IoT projects.Understanding the ESP32 pinout is essential for stable, reliable, and efficient hardware design. Each pin can serve multiple functions — digital I/O, analog input, touch sensing, or even internal system roles — and a wrong assignment can lead to unpredictable behavior or system crashes. This guide explains how to interpret the ESP32 pin layout and make smart design choices for your next IoT project— you can also explore similar tutorials in the SunFounder Arduino Projects.

Understanding the ESP32 Pin Layout

The ESP32 family includes several variants — the classic ESP32, ESP32-S3, and ESP32-C6 — all built around the same concept but with small differences in available GPIOs and peripheral capabilities. Most developers work with modules like the ESP32-WROOM-32 or ESP32-DevKitC V4, which break out 30–38 pins for easy access.

ESP32 DevKitC pinout diagram labeling all GPIO, ADC, DAC, SPI, I2C, UART, and power pins with color-coded functions

https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/hw-reference/esp32/get-started-devkitc.html

Although the physical layout varies between boards, the functional categories remain consistent:
•GPIO (General-Purpose Input/Output): Digital pins that can act as inputs, outputs, or multiplexed peripherals.ADC (Analog-to-Digital Converter): Pins that read analog voltages.
•DAC (Digital-to-Analog Converter): Pins that output analog voltages.
•Touch: Pins capable of capacitive sensing.
•Special/Boot/Reserved: Pins used internally or during boot.
•Power: 3.3 V, 5 V (from USB), and ground.
While the chip itself exposes over 30 I/O pins, not all are available or recommended for general use. Knowing which pins to use — and which to avoid — is critical — see the ESP32 Pinout Reference for a complete overview.

Special Function Pins & Pin Multiplexing

One of the defining features of the ESP32 is its IO Mux (Input/Output Multiplexer). This allows almost any peripheral function to be mapped to almost any GPIO pin, providing flexibility in design. However, it also means some pins carry multiple responsibilities and can interfere with each other — see ESP32 Pin Multiplexing Explained for practical examples.
Boot-strapping / Strapping Pins
The ESP32 boot pins determine the device’s startup mode and must be configured correctly to avoid boot issues.Pulling them to the wrong voltage can prevent the device from booting properly.
•GPIO 0: Must be low for flashing mode.
•GPIO 2: Must be low at boot.
•GPIO 12 (MTDI): Cannot be high on boot; affects flash voltage.
•GPIO 15 (MTDO): Must be low on boot.
These pins can be used in your circuit, but always ensure their state is compatible with the boot sequence.
Flash / SPI Pins
Pins GPIO 6–11 are connected internally to the SPI flash memory. They should never be used for external devices, as doing so will crash the system.
RTC-GPIO / Deep-Sleep Wake-up
Certain pins (such as GPIO 33–39) belong to the RTC domain, which remains powered during deep sleep and supports ESP32 deep sleep wake up functionality.These pins can be used to wake the ESP32 from deep sleep through external triggers or touch sensors.
Why Pin Assignment Matters
Even though the GPIO Matrix offers freedom, poor pin planning can lead to conflicts, noisy signals, or reduced performance. To learn more about best practices and real-world examples, see the SunFounder ESP32 Tutorial: A Comprehensive Guide to ESP32 Boards, Features, and Getting Started. Always check the Espressif datasheet and confirm your design using the gpio_matrix_out or gpio_matrix_in configuration if you work at the register level.

General-Purpose Input/Output (GPIO)

Most ESP32 GPIO pins can be configured as digital inputs or outputs, but they’re not all equal.
Input/Output and Special Cases
•GPIO 34–39
: Input-only pins (no output capability).
•GPIO 6–11: Reserved for SPI flash.
•GPIO 0, 2, 12, 15: Strapping pins; use with care.
The remaining pins (e.g., 13, 14, 16, 17, 18, 19, 21–23, 25–27, 32, 33) are generally safe for most purposes.
Best Practices
•Use 3.3 V logic levels only. ESP32 pins are not 5 V tolerant.
•Limit GPIO current to about 12 mA per pin to avoid damaging the chip.
•For stable readings, enable internal pull-ups or pull-downs, or add external resistors.
•Use PWM (LEDC) for motor control or LED dimming — up to 16 channels with configurable frequency and resolution.For full configuration details, see the ESP-IDF LEDC (PWM) API Reference.
•Any GPIO can serve as an interrupt source, allowing fast event response.

Analog-to-Digital Converter (ADC)

The ESP32 ADC offers 12-bit resolution and can read analog signals between 0 V and 3.3 V.

ESP32-based energy monitoring setup with current sensors and power adapter connected to a development board

ADC Units
•ADC1
: GPIO 32–39 (fully usable even when Wi-Fi is active).
•ADC2: GPIO 0, 2, 4, 12–15, 25–27 (disabled when Wi-Fi is in use).
This distinction is crucial: if your device uses Wi-Fi, connect analog sensors to ADC1 pins only.
Resolution and Attenuation
By default, the ADC provides 12-bit resolution (values from 0–4095). Attenuation settings allow measurement ranges of approximately 0–1.1 V, 0–2.5 V, or 0–3.3 V.For advanced configuration and calibration, see the ESP-IDF ADC Driver – Analog-to-Digital Converter.
Design Tips
•Keep analog traces short and away from digital lines to reduce noise.
•Add a 0.1 µF capacitor near the sensor output for filtering.
•For low-impedance sensors, use voltage dividers or buffers to protect the ADC input.
•Avoid reading ADC2 channels during active Wi-Fi to prevent erratic values.

Digital-to-Analog Converter (DAC)

The ESP32 includes two 8-bit DAC channels:
The ESP32 DAC includes two 8-bit channels, providing analog voltage output between 0 V and 3.3 V.
•DAC1 (GPIO 25)
•DAC2 (GPIO 26)

These pins output a voltage between 0 V and 3.3 V, useful for audio generation, analog control signals, or reference voltages.
Usage Notes
•The output is not perfectly linear and has limited resolution (8 bits).
•For smoother audio, apply a low-pass RC filter.
•Keep traces short and separated from high-frequency digital lines.
Although basic, the DAC makes the ESP32 ideal for small sound projects or signal synthesis tasks.

ESP32 development board with OLED display showing Spotify song information for a music streaming project

Capacitive Touch Sensors

ESP32 touch sensor panel with four touch buttons labeled Light-1 to Light-4 for controlling lights

The ESP32 touch sensor system is one of the most unique features, allowing touch detection without extra components.Up to ten GPIOs (T0–T9) can detect touch events without extra components.

Touch ChannelGPIO
T0GPIO 4
T1GPIO 0
T2GPIO 2
T3GPIO 15
T4GPIO 13
T5GPIO 12
T6GPIO 14
T7GPIO 27
T8GPIO 33
T9GPIO 32

These pins measure small changes in capacitance caused by a finger or conductive object. The ESP32 can even wake from deep sleep when a touch pad is pressed, making it perfect for battery-powered applications.
Design Recommendations
•Use large copper pads with rounded edges.
•Cover the pad with a thin non-conductive surface (e.g., plastic or glass).
•Isolate touch pads from noisy power or digital lines to avoid false triggers.

Power and Ground Considerations

The ESP32 operates entirely at 3.3 V. On DevKit boards, the USB-to-serial interface provides 5 V, which is then regulated down to 3.3 V for the chip.
Power Supply Tips
•Use a stable LDO regulator capable of supplying at least 500 mA.
•Place decoupling capacitors (0.1 µF + 10 µF) near the power pins.
•Maintain a solid ground plane and separate analog and digital sections if possible.
•For analog sensors, use dedicated filtering or separate voltage regulators to reduce noise.
•During deep sleep, ensure peripherals are powered down to minimize current draw.

Best Practices for Pin Selection & Hardware Design

Proper ESP32 pin mapping and usage strategy are the foundation of a successful ESP32 hardware design.A successful ESP32 hardware design begins with a pin usage strategy. Before you commit to a PCB layout:
1.Avoid Reserved Pins: Never use GPIO 6–11 (flash), and be careful with GPIO 0, 2, 12, and 15 (boot).
2.Plan Communication Interfaces: Group SPI, I²C, or UART lines together for clarity.
3.Check ADC Usage: Place analog sensors on ADC1 channels if Wi-Fi will be used.
4.Consider Deep-Sleep Behavior: Use RTC-GPIO or touch pins for wake-up events.
5.Test Boot Conditions: A wrong pull-up resistor or external device on a strapping pin can cause boot failure.
6.Document Everything: Maintain a pin map showing each pin's function, mode, and voltage reference.

Conclusion

The ESP32 pinout is essential to understand for building stable, reliable, and efficient hardware designs.While the ESP32 offers great flexibility with GPIO multiplexing, ADC measurement capabilities, DAC output, and built-in touch sensors, each pin also comes with specific electrical and functional considerations. Choosing the right pins, avoiding those reserved for flash and boot configuration, and following good layout and power-supply practices will prevent common issues such as boot failures, unstable analog readings, and unexpected resets. With thoughtful planning and a clear pin assignment strategy, the ESP32 becomes a powerful and versatile platform for IoT, automation, sensing, and creative electronics projects. Always refer to the official datasheet and maintain your own pin map as your design evolves — it will save time and ensure your project scales smoothly.

Back to News How to Set Up NordVPN on Raspberry Pi (Complete Step-by-Step Guide)