ESP32 Pinout | ESP-WROOM-32 Pinout

Содержание

In this tutorial, we will learn about the pinout information of ESP32. The 30-pin ESP32 Development Board will be used to demonstrate the ESP32 Pinout. We will also learn about some important peripherals of ESP32 Microcontroller and their associated pins, what GPIO pins can be used in your project.

ESP32-Development-Board

Why do we need to learn ESP32 Pinout?

ESP32 based boards come in a variety of shapes and sizes and pinout of each board is different to other. Also, not all pins of the ESP32 Microcontroller SoC will be available on a development board as some pins might be permanently tied to a dedicated function.

One such case is the Flash Memory. We know that all ESP32 boards come with 4 MB of Flash Memory to store the programs. So, some of the GPIO Pins (6 to be specific) are connected to SPI Flash IC and those pins cannot be used as regular GPIO Pins.

Hence, it is important to understand the pinout of popular ESP32 boards so that you will know what pins are available for use in projects.

Introduction to ESP32 Pin Layout

The ESP32 Microcontroller IC is available in a 48-pin QFN package. Since it is a QFN (Quad Flat No Leads) package, it is difficult solder the IC on to the PCB, if you are interested in making an ESP32 Board by yourself.

ESP32-Pin-Layout

So, what Espressif Systems (the developers of ESP32) did is, they took the ESP32 IC and made a small module board with edge castellations. One popular version of such module board is called ESP-WROOM-32.

In addition to the ESP32 IC, the ESP-WROOM-32 also contain a 4 MB SPI Flash IC, a 40 MHz Crystal Oscillator, PCB Antenna and some discrete passive components to make a working system.

ESP-WROOM-32

You can use this board in your hardware design (as it takes care of the complex RF section of the PCB) and make a development board or a breakout board or even a commercial product.

This is what third-party module manufacturers do. They take the ESP-WROOM-32 Module, design a break-out board based on this module with user friendly pins, USB Port, RESET and BOOT switches etc.

Getting-Started-with-ESP32

ESP-WROOM-32 Pinout

Let us start exploring the ESP32 Pinout by taking a look at the ESP WROOM 32 Pinout. The following image show the pinout of a typical ESP-WROOM-32 Module. It consists of 38-pin (14 pins on each long edge and 10 on bottom short edge).

ESP-WROOM-32-Pinout

The other short edge is left for PCB Antenna. If you notice the previous ESP-WROOM-32 image, then the Microcontroller and other components are not visible as they placed under the RF Shield.

Use this pinout of ESP-WROOM-32 module as a reference if you are using such module in your hardware design.

ESP32 Pinout

One popular ESP32 Development Board available today is the 30-pin version shown in the above image. It consists of ESP-WROOM-32 as the baseboard and additionally few pins and components to easily interact with ESP32.

The following image shows the pinout of a 30-pin ESP32 DevKit Development Board.

ESP32-Pinout

As you can see from the image, each pin has more than one possible functionality and while using a pin for particular task, double check its alternative functions.

Another version of ESP32 DevKit Board comes with 36-pins. This version is not as popular as the 30-pin version. But if you happen to have a 36-pin ESP32 board, the following pinout will be very helpful.

Note that the pinout of both the 30-pin and the 36-pin versions of ESP32 Development Boards are very identical except for some pins at the bottom. In the 36-Pin version, 6 GPIO pins (GPIO6 to GPIO11) are used for SPI Flash IC. So, they shouldn’t be used for other purposes. Finally, you just get one extra pin (GPIO0 – Pin 23).

ESP32-36-Pin-Pinout

Important ESP32 Peripherals

Now that we have seen a little bit about ESP32 Pinout. Let us now focus on some of the important peripherals of ESP32 and their associated pins. ESP32 Microcontroller has:

  • 34 Programmable GPIOs
  • 18 12-bit ADC Channels
  • 2 8-bit DAC Channels
  • 16 PWM Channels
  • 3 UART Interfaces
  • 3 SPI Interfaces
  • 2 I 2 C Interfaces
  • 2 I 2 S Interfaces
  • 10 Capacitive Touch Sensing GPIOs
  • 16 RTC GPIOs

The most commonly used peripheral is the GPIO. ESP32 has 34 GPIO pins with each pin carrying out more than one function (only one will be active). You can configure a pin as either a GPIO or an ADC or an UART in the program.

ADC and DAC pins are predefined and you have to use the manufacturer specified pins. But other functions like PWM, SPI, UART, I 2 C etc. can be assigned to any GPIO pin through program.

RTC GPIO

ESP32 has 16 RTC GPIOs, which are part of the RTC Low-Power subsystem. These pins can be used to wake ESP32 from deep sleep as external wake-up source.

ESP32 has two 12-bit SAR Analog to Digital Converter Modules with 8-channels and 10-channels each. So, ADC1 and ADC2 blocks combined together have 18 channels of 12-bit ADC.

With 12-bit resolution, the output Digital values will be in the range of 0 – 4093.

ESP32 Microcontroller has two independent 8-bit Digital to Analog Converter channels to convert digital values to analog voltage signals. The DAC has internal resistor network and uses power supply as input reference voltage.

The following two GPIO Pins are associated with DAC functionalities.

Capacitive Touch GPIOs

The ESP32 SoC has 10 capacitive-sensing GPIOs, which can detect variations in capacitance on a pin due to touching or approaching the GPIO Pin with a finger or stylus. These Touch GPIOs can be used in implementing capacitive touch pads, without any additional hardware.

The ESP32 Wi-Fi chip features three SPI blocks (SPI, HSPI and VSPI) in both master and slave modes. SPI is used to interface with Flash Memory. So, you have two SPI interfaces.

There are two I 2 C interfaces in ESP32 with complete flexibility on assigning pins i.e., SCL and SDA pins for both I 2 C interfaces can be assigned in the program by the user.

If you are using Arduino IDE, then the default I 2 C pins are:

The PWM Controller in ESP32 have 16 independent PWM waveform channels with configurable frequency and duty cycle. The PWM waveform can be used to drive motors and LEDs. You can configure the PWM signal frequency, channel, GPIO pin and also the duty cycle.

What GPIO Pins to use?

Let us now take a look at a table which specifies the GPIO pins and their input / output capabilities.


Источник: www.electronicshub.org