- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The ESP32 and its Pin Description
For IoT projects, we need to use a microcontroller. ESP32 is one such microcontroller that can be used to start learning IOT and making IOT circuits. It is therefore important to learn about its pins layout and also what is the purpose of each pin and how it can be used. In this article, first, the layout of pins available in ESP32 Wroom 30-pin microcontroller is specified. Then the different types of pins that are available in ESP32 are described. ESP32 is used for a variety of applications including the use of wifi, transmitters, and receiver devices, Serial Peripheral Interfaces, analog and digital devices, and lots of sensors.
ESP32 Pins Types Descriptions
Step 1 − Describe the Power Pins of ESP32.
Step 2 − Describe the GPIO Pins of ESP32.
Step 3 − Describe the Analog Pins of ESP32.
Step 4 − Describe the I2C Pins of ESP32.
Step 5 − Describe the DAC Pins of ESP32.
Step 6 − Describe the Touch Pins of ESP32.
Step 7 − Describe the Transmitter and Receiver Pins of ESP32.
Pin Layout of ESP32
This is how an ESP32 wroom 30 pin microcontroller looks like. ESP32 Wroom 30 pin microcontroller has 30 pins with 15 pins on one side and 15 pins on the other side.

Fig: Showing the ESP32 microcontroller with its Pin numbers
The Power Pins of ESP32
ESP32 has 2 GND output pins. It has two pins for positive voltages, Vin and 3V3. Vin can be connected to an external voltage source of 5V to 14V. 3V3 is the pin that can output 3.3 volts and powers the ESP32.
General Purpose Input Output (GPIO) Pins of ESP32
There are 25 GPIO pins in ESP32 wroom 30 pin microcontroller. Although these can be used for different functions, there are some unsafe pins and these should be avoided, for example, RX0 and TX0. The safe-to-use pins are underlined here. All the GPIO pins are listed with GPIO numbers in the following table:
GPIO Pins |
ESP32 Pins |
---|---|
GPIO 1 |
TX0 |
GPIO 2 |
D2 |
GPIO 3 |
RX0 |
GPIO 4 |
D4 |
GPIO 5 |
D5 |
GPIO 12 |
D12 |
GPIO 13 |
D13 |
GPIO 14 |
D14 |
GPIO 15 |
D15 |
GPIO 16 |
RX2 |
GPIO 17 |
TX2 |
GPIO 18 |
D18 |
GPIO 19 |
D19 |
GPIO 21 |
D21 |
GPIO 22 |
D22 |
GPIO 23 |
D23 |
GPIO 25 |
D25 |
GPIO 26 |
D26 |
GPIO 27 |
D27 |
GPIO 32 |
D32 |
GPIO 33 |
D33 |
GPIO 34 |
D34 |
GPIO 35 |
D35 |
GPIO 36 |
VP |
GPIO 39 |
VN |
Analog Pins of ESP32:
SP32 has 15 analog-enabled pins called ADC pins. The Analog to Digital converters ADC1 and ADC2 of ESP32 can be used to map the voltages from 0V to 3.3 V to numbers between 0 to 4096. All the analog pins are listed with numbers in the following table:
Analog Pins |
ESP32 Pins |
---|---|
ADC2_0 |
D4 |
ADC2_2 |
D2 |
ADC1_0 |
VP |
ADC1_3 |
VN |
ADC1_4 |
D32 |
ADC1_5 |
D33 |
ADC1_6 |
D34 |
ADC1_7 |
D35 |
ADC1_8 |
D25 |
ADC1_9 |
D26 |
ADC2_0 |
D4 |
ADC2_2 |
D2 |
ADC2_3 |
D15 |
ADC2_4 |
D13 |
ADC2_5 |
D12 |
ADC2_6 |
D14 |
ADC2_7 |
D27 |
I2C (Inter-Integrated Circuit) Interface of ESP32:
I2C interface of ESP32 is used for communications between ESP32 (Master) and sensors (Slaves). For such communications, the ESP32’s D22 and D21 pins are allocated. All the I2C pins are listed with PINs in the following table:
For I2C Communications |
ESP32 Pins |
---|---|
SCL |
D17 |
SDA |
D16 |
DAC Pins of ESP32:
DAC Pins |
ESP32 Pins |
---|---|
DAC1 |
D25 |
DAC2 |
D26 |
Touch Pins of ESP32
There are 9 touch pins in ESP32 wroom 30 pin microcontroller. They are listed from Touch 0 to T9 excluding T1 which is not there in the 30-pin microcontroller.
Touch Pins |
ESP32 Pins |
---|---|
Touch 0 |
D4 |
Touch 2 |
D2 |
Touch 3 |
D15 |
Touch 4 |
D13 |
Touch 5 |
D12 |
Touch 6 |
D14 |
Touch 7 |
D27 |
Touch 8 |
D33 |
Touch 9 |
D32 |
Transmitter and Receiver Pins of ESP32:
Although ESP32 has three UART (Universal Asynchronous Receiver Transmitter) interfaces, only the following pins of UART2 are safe options to use while using the devices like distance sensors.
In this article, first, the pin diagram of ESP32 wroom 30-pin microcontroller is given. The ESP32 microcontroller can be used for a variety of applications while making IOT circuits. Its pins can be used as GPIO pins, analog pins, touch pins, UART pins, receiver/ transmitter, I2C communications, or for other purposes such as basic power connections. In this article, first, the pin layout is given, then the pins are presented in tabular forms after differentiating these into different categories. Along with the specified purpose for which the pins can be used,
Transmitter/ Receiver Pins |
ESP32 Pins |
---|---|
TX2 |
D22 |
RX2 |
D21 |