For those looking to add wireless connectivity to embedded projects or to build IoT devices, the ESP32 is arguably the most popular choice. It offers a dual-core option for processor intensive applications, while built-in WiFi and Bluetooth simplify designs. It also has plenty of I/O, memory, and interoperability to meet the needs of most applications.

Espressif, the company behind the ESP-32 chip, also manufactures modules and development boards. If you intend to design a custom PCB with an ESP32, the ESP32-WROOM-32 module is an excellent choice. Opting the module over the bare chip has several advantages. Notably, the module is already FCC-approved, which means you won�t need to take any extra measures to achieve FCC compliance. This simplifies the manufacturing process considerably.

When it comes to custom PCB design, understanding the pinout of the ESP32-WROOM-32 becomes crucial. This article will go over the ESP32-WROOM-32 pinout in great detail.

ESP32-WROOM-32 Pinout

The ESP32-WROOM-32 module has 38 pins in total. The pinout is as follows:

esp32 wroom 32 pinout

Let�s take a closer look at the ESP32 pins and their functions one by one.

ESP32-WROOM-32 GPIO Pins

The ESP32-WROOM-32 module has 32 GPIO pins that can be assigned different functions by programming the appropriate registers. There are several kinds of GPIOs: digital-only, analog-enabled, capacitive-touch-enabled, etc. Most of the digital GPIOs can be configured with internal pull-up or pull-down, or set to high impedance.

esp32 wroom 32 gpio pins

Which GPIOs are safe to use?

Although the module has a lot of pins with various functions, some of them may not be suitable for your projects. The table below shows which pins are safe to use and which pins should be used with caution.

  • � Your top priority pins. They are perfectly safe to use.
  • � Pay close attention because their behavior, particularly during boot, can be unpredictable. Use them only when absolutely necessary.
  • � It is recommended that you avoid using these pins.
��Pin����Pin�Label����GPIO����Safe�to�use?��Reason
4SENSOR_VPGPIO36Input only GPIO, cannot be configured as output
5SENSOR_VNGPIO39Input only GPIO, cannot be configured as output
6IO34GPIO34Input only GPIO, cannot be configured as output
7IO35GPIO35Input only GPIO, cannot be configured as output
8IO32GPIO32
9IO33GPIO33
10IO25GPIO25
11IO26GPIO26
12IO27GPIO27
13IO14GPIO14
14IO12GPIO12must be LOW during boot
16IO13GPIO13
17SHD/SD2GPIO9Connected to Flash memory
18SWP/SD3GPIO10Connected to Flash memory
19SCS/CMDGPIO11Connected to Flash memory
20SCK/CLKGPIO6Connected to Flash memory
21SDO/SD0GPIO7Connected to Flash memory
22SDI/SD1GPIO8Connected to Flash memory
23IO15GPIO15must be HIGH during boot, prevents startup log if pulled LOW
24IO2GPIO2must be LOW during boot and also connected to the on-board LED
25IO0GPIO0must be HIGH during boot and LOW for programming
26IO4GPIO4
27IO16GPIO16
28IO17GPIO17
29IO5GPIO5must be HIGH during boot
30IO18GPIO18
31IO19GPIO19
33IO21GPIO21
34RXD0GPIO3Rx pin, used for flashing and debugging
35TXD0GPIO1Tx pin, used for flashing and debugging
36IO22GPIO22
37IO23GPIO23

The image below shows which GPIO pins can be used safely.

esp32 wroom 32 safe gpio pins

Input Only GPIOs

Pins 4, 5, 6 and 7 cannot be configured as outputs. They can be used as digital or analog inputs, or for other purposes. They also lack internal pull-up and pull-down resistors, unlike the other GPIO pins.

ESP32 Interrupt Pins

All GPIOs can be configured as interrupts. For more information, please refer to this tutorial.

ESP32-WROOM-32 ADC Pins

The ESP32-WROOM-32 module has two ADC (Analog to Digital Converter) blocks; ADC1 and ADC2. Each block has multiple channels:

  • ADC1: contains 6 channels (labeled as ADC1_CH0 and ADC1_CH3 to ADC1_CH7).
  • ADC2: contains 10 channels (labeled as ADC2_CH0 to ADC2_CH9).
esp32 wroom 32 adc pins

The resolution of the ADCs on the ESP32 can be configured up to 12 bits. This means that the ADC can detect 4096 (2^12) discrete analog levels. This results in a resolution of 3.3 V (operating voltage) / 4096 units, or 0.0008 volts (0.8 mV) per unit.

Warning:

When Wi-Fi is enabled, the ADC2 pins cannot be used. If you need Wi-Fi, consider using the ADC1 pins instead.

ESP32-WROOM-32 DAC Pins

The ESP32-WROOM-32 module contains two 8-bit Digital-to-Analog Converters (DACs). These DACs are useful for converting digital signals into analog voltages.

esp32 wroom 32 dac pins

ESP32-WROOM-32 Touch Pins

The ESP32-WROOM-32 module has ten capacitive touch-enabled GPIOs labeled TOUCH0 through TOUCH9. These pins work by measuring the change in capacitance when a finger or conductive object is near the surface of the pin.

They can be used for various applications, such as touch buttons, touch sliders, or even basic gesture recognition. They can also be used to wake the ESP32 from deep sleep, which is particularly useful in power-sensitive applications.

esp32 wroom 32 touch pins

ESP32-WROOM-32 I2C Pins

The ESP32-WROOM-32 module has two I2C bus interfaces, but no dedicated I2C pins. Instead, it allows for flexible pin assignment, meaning any GPIO pin can be configured as I2C SDA (data line) and SCL (clock line).

However, GPIO21 (SDA) and GPIO22 (SCL) are commonly used as the default I2C pins to make it easier for people using existing Arduino code, libraries, and sketches.

esp32 wroom 32 i2c pins

ESP32-WROOM-32 SPI Pins

The ESP32-WROOM-32 module features three SPIs (SPI, HSPI, and VSPI). HSPI and VSPI are commonly used for general purposes, while the third one is used for interfacing with the SPI flash memory integrated on the module.

Similar to I2C, the ESP32 allows flexible pin assignment for SPI. This means that any GPIO pin can be configured as SPI pins.

esp32 wroom 32 spi pins

ESP32-WROOM-32 UART Pins

The ESP32-WROOM-32 module has three UART interfaces: UART0, UART1, and UART2. These interfaces enable serial communication with various peripherals or for logging and debugging purposes.

esp32 wroom 32 uart pins

Please note that the UART1 pins (GPIO 9 and GPIO 10) are used for interfacing with the SPI flash memory integrated on the module, so you can�t use them. However, you can still use UART1 by bit-banging the UART protocol on other GPIO pins.

Besides the basic TX and RX pins, UART interfaces on the ESP32 also support RTS (Request To Send) and CTS (Clear To Send) for hardware flow control, though these are less commonly used.

ESP32-WROOM-32 PWM Pins

Almost all GPIO pins on the module can be configured to generate PWM output.

esp32 wroom 32 pwm pins

The PWM on the ESP32 can be configured with high resolution, typically up to 16 bits, allowing for fine control over the PWM signals. PWM frequency can also be adjusted, with a typical range from a few Hz to tens of MHz, making it suitable for a wide range of applications, from controlling motors to dimming LEDs.

ESP32-WROOM-32 RTC GPIO Pins

Some GPIOs are routed to the RTC low-power subsystem and are known as RTC GPIOs. These GPIOs can be used for waking up the ESP32 from deep sleep and for interfacing with RTC peripherals.

esp32 wroom 32 rtc gpio pins

ESP32-WROOM-32 Strapping Pins

There are five strapping pins on the ESP32: GPIO0, GPIO2, GPIO5, GPIO12, and GPIO15. The state of these pins determines whether the ESP32 enters BOOT mode (to run the program stored in flash memory) or FLASH mode (to upload a program to flash memory) upon power-up.

esp32 wroom 32 strapping pins

Be aware that if peripherals are connected to these pins, you might face issues when trying to flash the ESP32 with new firmware. This is because these peripherals could prevent the ESP32 from entering the correct mode.

ESP32-WROOM-32 Power Pins

The power pins provide the necessary voltage to the module to operate:

3V3 is the main supply voltage pin. It should be provided with a stable 3.3V power supply.

GND is the ground pin.

esp32 wroom 32 power pins

ESP32-WROOM-32 Enable Pin

The EN pin is the enable pin for the ESP32. When pulled HIGH, the chip is enabled and operational; when pulled LOW, the chip is disabled.

esp32 wroom 32 en pin

Login
ADS CODE