Language: EN

esp32-detalles-hardware-pinout

ESP32 Pinout and Hardware Details

If we want to work with a CPU, the first thing we should do is to know and familiarize ourselves with details of its hardware.

The ESP32 is a much more powerful machine than a conventional Arduino or an ESP8266. It offers many more GPIO, many more functionalities, and has many more components.

In return, it is also considerably more complex. Especially because of the large number of configuration options and connection possibilities.

So let’s see a summary of the main features of the ESP32. We start by remembering the technical characteristics table of the ESP32.

FeatureESP32 Series
Launch year2016
CoreXtensa® dual-/single core 32-bit LX6
Wi-Fi protocols802.11 b/g/n, 2.4 GHz
Bluetooth®Bluetooth v4.2 and BLE
Typical frequency240 MHz (160 MHz for ESP32-S0WD)
SRAM520 KB
ROM448 KB
External flashUp to 16 MB device
External RAMUp to 8 MB device
GPIO34
ADC2x 12-bit
DAC2x 8-bit
Timers4x 64-bit, 3x watchdog
Temperature sensor✖️
SPI4
LCD interface1
UART3
I2C2
I2S2
LED PWM16
Pulse counter8
Touch sensor10
Hall sensor1
Camera interface1

If you are using an ESP32-S3, you have a similar summary in this post ESP32-S3 Pinout and Hardware Details

ESP32 Pinout

We begin by looking at the pinout of the official Espressif development board for the ESP32, the ESP32 DevKitC.

esp32-devkitc

Keep in mind that these are the characteristics of this specific board. The one you have on your device will depend on the SoM and the development board you are using.

If you have questions about what a SoC, SoM, and a development board are, check out this post What is an SoC and a SoM

If you have any doubts about your board, it’s best to consult the official Espressif documentation and, above all, the information from the device manufacturer.

Here is the link to the official Espressif documentation about the Esp32 DevKitc 1 board.

ESP32-DevKitC V4 Getting Started Guide - ESP32 - — ESP-IDF Programming Guide latest documentation

Multiplexing

Pin multiplexing is one of the most important and useful features of the ESP32.

Basically, in the ESP32, we can reassign most functions to act on another pin, without affecting performance.

So, the values we are going to see are the default values, but you can generally change them to others as needed.

The RTC

The RTC (Real Time Clock) plays a fundamental role during Sleep modes. The RTC consists of the following parts:

  • RTC controller (including timers and IO peripherals)
  • RTC memory (fast and slow)
  • Ultra Low Power (ULP) coprocessor

The ESP32 has 8 kB of SRAM in the RTC part, called fast RTC memory. The data stored here is not cleared during deep sleep mode.

Additionally, there is another 8kB of SRAM called slow memory, which is used for the ULP processor.

Digital Pins

GPIO Pins

The ESP32 has up to 34 GPIO pins that can be assigned to different functions through programming.

Most of these digital GPIO pins can be configured with internal pull-up or pull-down resistors.

ESP32 Configuration (Strapping) Pins

There are five Strapping pins.

  • GPIO 0 (must be LOW to enter boot mode)
  • GPIO 2 (must be floating or LOW during boot)
  • GPIO 4
  • GPIO 5 (must be HIGH during boot)
  • GPIO 12 (must be LOW during boot)
  • GPIO 15 (must be HIGH during boot)

These pins are involved in the configuration during boot. So avoid using them in your project.

More information in this post read more ⯈

Input-Only GPIO Pins

These pins cannot be used as outputs, but can be used as digital or analog inputs, or for other purposes.

  • GPIO 34
  • GPIO 35
  • GPIO 36
  • GPIO 39

In addition, unlike the other GPIO pins, they do not have internal pull-up and pull-down resistors.

ESP32 GPIO Interrupt Pins

All GPIO pins can be configured as interrupts.

read more ⯈

ESP32 RTC GPIO Pins

Some GPIOs are connected to the RTC low-power subsystem and are known as RTC GPIOs

  • RTC_GPIO0 - GPIO 36
  • RTC_GPIO3 - GPIO 39
  • RTC_GPIO4 - GPIO 34
  • RTC_GPIO5 - GPIO 35
  • RTC_GPIO6 - GPIO 25
  • RTC_GPIO7 - GPIO 26
  • RTC_GPIO8 - GPIO 33
  • RTC_GPIO9 - GPIO 32
  • RTC_GPIO10 - GPIO 4
  • RTC_GPIO11 - GPIO 0
  • RTC_GPIO12 - GPIO 2
  • RTC_GPIO13 - GPIO 15
  • RTC_GPIO14 - GPIO 13
  • RTC_GPIO15 - GPIO 12
  • RTC_GPIO16 - GPIO 14
  • RTC_GPIO17 - GPIO 27

These pins are used to wake the ESP32 from the deep sleep low-power mode when the ultra-low-power coprocessor (ULP) is in operation.

ESP32 Touch Pins

The ESP32 has 10 capacitive touch GPIO pins.

  • TOUCH0 - GPIO 4
  • TOUCH1 - GPIO 0
  • TOUCH2 - GPIO 2
  • TOUCH3 - GPIO 15
  • TOUCH4 - GPIO 13
  • TOUCH5 - GPIO 12
  • TOUCH6 - GPIO 14
  • TOUCH7 - GPIO 27
  • TOUCH8 - GPIO 33
  • TOUCH9 - GPIO 32

When a capacitive load (like a human finger) is near the GPIO pin, the ESP32-S3 detects the change in capacitance.

read more ⯈

Enable Pin (EN)

Enable (EN) is the pin that controls the 3V3 regulator. It is configured with a pull-up resistor, so it is connected to ground to deactivate the 3.3V regulator. For example, to restart the ESP32.

Analog Pins

ESP32 PWM Pins

The ESP32 board has 16 PWM channels controlled by a PWM controller. The PWM output can be used to control motors and digital LEDs.

read more⯈

ESP32 ADC Pins

The ESP32 integrates two ADCs and supports measurements on 18 channels

  • ADC1_CH0 - GPIO 36
  • ADC1_CH1 - GPIO 37
  • ADC1_CH2 - GPIO 38
  • ADC1_CH3 - GPIO 39
  • ADC1_CH4 - GPIO 32
  • ADC1_CH5 - GPIO 33
  • ADC1_CH6 - GPIO 34
  • ADC1_CH7 - GPIO 35
  • ADC2_CH0 - GPIO 4
  • ADC2_CH1 - GPIO 0
  • ADC2_CH2 - GPIO 2
  • ADC2_CH3 - GPIO 15
  • ADC2_CH4 - GPIO 13
  • ADC2_CH5 - GPIO 12
  • ADC2_CH6 - GPIO 14
  • ADC2_CH7 - GPIO 27
  • ADC2_CH8 - GPIO 25
  • ADC2_CH9 - GPIO 26

The ADCs are 12-bit, so we have 4096 (2^12) discrete levels, which translates to a precision of 0.8mV.

read more ⯈

ESP32 DAC Pins

The ESP32 includes two DAC channels for converting digital signals into analog voltages.

  • DAC1 - GPIO 25
  • DAC2 - GPIO 26

These DACs have an 8-bit resolution, meaning that values from 0 to 255 are converted into an analog voltage ranging from 0 to 3.3V.

read more ⯈

Communication Pins

ESP32 UART Pins

The ESP32-S3 development board has three UART interfaces: UART0, UART1, and UART2, which support asynchronous communication (RS232 and RS485) and IrDA of up to 5 Mbps.

The UART0 pins are connected to the USB-to-serial converter and are used for programming and debugging. It is not recommended to use the UART0 pins.

On the other hand, the UART pins are reserved for the integrated flash memory chip. The UART1 pins are reserved for the integrated flash memory chip.

So using UART2 is a safe option for connecting UART devices.

read more ⯈

ESP32 I2C Pins

The ESP32 has a single I2C bus that allows connection of up to 112 sensors and peripherals. The SDA and SCL pins are assigned by default to the following pins.

  • SDA - GPIO 21
  • SCL - GPIO 22

However, it is possible to use any GPIO pin to implement the I2C protocol using the command wire.begin(SDA, SCL).

read more ⯈

ESP32 SPI Pins

The ESP32 has three SPI interfaces (SPI, HSPI, and VSPI). Only the VSPI and HSPI interfaces are usable SPI interfaces, and the third SPI bus is used for the integrated flash memory.

SPIMOSIMISOCLKCS
VSPIGPIO 23GPIO 19GPIO 18GPIO 5
HSPIGPIO 13GPIO 12GPIO 14GPIO 15

The VSPI pins are commonly used in standard libraries.

read more ⯈

SPI FLASH

These pins are connected to the integrated SPI flash memory in the ESP32-S3 chip. Do not use these pins in your projects.

  • GPIO 6 (SCK/CLK)
  • GPIO 7 (SDO/SD0)
  • GPIO 8 (SDI/SD1)
  • GPIO 9 (SHD/SD2)
  • GPIO 10 (SWP/SD3)
  • GPIO 11 (CSC/CMD)