ESP32 Projects

Pinout and definition of the ESP32 module

pinout and definition of the ESP32 module

One of the advantages of the ESP32 is that it has far more GPIOs than the ESP8266. You don’t have to juggle or multiplex the IO. There are a few things to note, so take a close look at the pinout diagram.

ESP32 Peripherals and I/O

Although the ESP32 has a total of 48 GPIO pins, only 25 of them are broken out to headers on both sides of the board. These pins can be assigned to a variety of peripheral duties, including:

● 15 ADC channels: 15 channels of 12-bit SAR ADC. The ADC range can be set in firmware to 0-1V, 0-1.4V, 0-2V or 0-4V

● 2 UART interfaces: One for serial code loading. They have flow control and support IRDA!

● 25 PWM outputs: 25 channel PWM pins are used to dim LEDs or control motors.

● 2 DAC channels: 8-bit DAC can generate true analog voltage.

● 3 SPI and 1 I2C interfaces: There are 3 SPI and 1 I2C interfaces, which can connect various sensors and peripheral devices.

● 9 touch pins: 9 GPIOs have capacitive touch sensing.

Thanks to the pin multiplexing feature of the ESP32, this means that a single GPIO pin can act as an ADC input/DAC output/touch pin.

ESP32 Pinout

The ESP32 development board has a total of 30 pins that connect it to the outside world. For simplicity, pins with similar functions are grouped together. The pins are as follows:

Let’s analyze the ESP32 pins and their functions in more detail.

GPIO Pins

The ESP32 development board has 25 GPIO pins that can be assigned to various functions programmatically. Each enabled GPIO can be configured to be internally pulled up or down or set to high impedance.

Input-only GPIO pins

GPIO34, GPIO35, GPIO36 (VP), and GPIO39 (VN) pins cannot be configured as outputs, they can be used as digital inputs, analog inputs, or for other purposes. Also note that they do not have internal pull-up or pull-down resistors like other GPIO pins.

Likewise, the GPIO36 (VP) and GPIO39 (VN) pins are also integral to the ADC ultra-low noise pre-amplifier, which helps in configuring the sampling time and noise of the Pre-Amp.

ESP32 Interrupt Pins

All GPIOs can be configured as interrupts.

ADC Pins

The ESP32 has 15 12-bit ADC input channels. These GPIOs can be used to convert the analog voltage on the pins into digital numbers.

 

The ADC on the ESP32 is a 12-bit ADC, which means it has the ability to detect 4096 discrete analog levels. In other words, it will map the input voltage to an integer value between 0 and 4095 between 0 and the operating voltage of 3.3V.

You can also set the ADC resolution and ADC range of a channel in the code.

DAC Pinout

ESP32 has two 8-bit DAC channels that can be used to convert digital signals into true analog voltages. It can be used as a digital potentiometer to control analog devices.

 

The dual DAC on the ESP32 has 8-bit resolution, which means that a value between 0 and 256 will produce an analog voltage between 0 and 3.3V.

Touch Pin

ESP32 has 9 capacitive contact GPIOs. When a capacitive load (such as a human finger) is in close proximity to a GPIO, ESP32 detects the change in capacitance.

 pinout and definition of the ESP32 module

By connecting them to any conductive object like wire, thread, foil, cloth, conductive paint etc. These capacitive touch pins can also be used to wake up the ESP32 from deep sleep.

SPI Pins

SPI pins ESP32 has three SPIs (SPI, HSPI and VSPI) that support slave and master modes. These SPIs also support the following common SPI features:

● 4 timing modes for SPI format transfer

● Up to 80 MHz and 80 MHz split clock

● Up to 64 bytes FIFO

 pinout and definition of the ESP32 module

 

Only VSPI and HSPI are available SPI interfaces, and the integrated flash chip uses a third SPI bus. Standard libraries usually use the VSPI pins in between.

I2C Pinout

ESP32 has a single I2C bus that allows you to connect up to 112 sensors and peripherals. By default, the SDA and SCL pins are assigned to the following pins. However, you can type the I2C protocol on any GPIO pin with the Wire.Begin(SDA, SCL) command.

 pinout and definition of the ESP32 module

UART Pinout

ESP32 has 2 UART interfaces, namely UART0 and UART2, which provide asynchronous communication (RS232 and RS485) and IRDA support and communicate at up to 5Mbps.

● The UART0 pins are connected to the USB to serial converter for flashing and debugging. Therefore, it is not recommended to use the UART0 pins.

● UART2 on the other hand are additional Serial 1 pins and are not connected to the USB to Serial converter. This means you can use them to connect to UART devices such as GPS, fingerprint sensor, etc.

 pinout and definition of the ESP32 module

PWM Pins

The board has 25 channels of PWM pins (almost all GPIO pins) controlled by a Pulse Width Modulation (PWM) controller. The PWM outputs can be used to drive digital motors and LEDs.

 pinout and definition of the ESP32 module

 

The controller consists of PWM timers and PWM operators. Each timer provides time in a synchronized or independent form, and each PWM operator generates a waveform for one PWM channel.

RTC GPIO Pins

Some GPIOs are brought out to the RTC low power subsystem, they are called RTC GPIOs. These are special pins used to wake up the ESP32 from deep sleep when the Ultra Low Power (ULP) collaborator is running. The following GPIOs can be used as external wakeup sources.

 pinout and definition of the ESP32 module

Power pin

There are two sets of power pins – VIN pins and 3.3V pins. If you have a regulated 5V voltage source, you can use the VIN pin to directly supply the ESP32 and its peripherals. The 3.3V pin is the output of the onboard voltage regulator. This pin can be used to provide power to external components. GND is the ground pin of the ESP32 development board.

 pinout and definition of the ESP32 module

EN pin

The EN pin is used to enable the ESP32. When pulled high, the chip is enabled. When pulled low, the chip operates with minimal power.

 

Back to top button