ESP 32 Pinout, its Specifications And Programming

Introduction

ESP 32 pinout, WROOM 32 board is a Wi-Fi and Bluetooth module that is based on the Tensilica Xtensa LX6 dual-core microprocessor which is a dual-core processor with an operating frequency of up to 240 MHz. ESP 32 is developed by Espressif System, this board helps in connecting Wi-Fi and Bluetooth to microcontroller boards.

As mentioned ESP-32 is a low-cost Bluetooth and wifi module and it is the reason behind its widespread success in IoT-related projects. Another contributing reason behind its success is that ESP 32 has significantly more GPIO pins than ESP 01 so there is no need to multiplex the I/O pins.

Many variants of ESP-32 boards are available in the market, in today’s article we will be discussing the WROOM 32 board. Let us have a look at the board components of the WROOM 32:

Board Components

esp-32-onboard-components
  1. Microprocessor – As mentioned earlier the ESP-32 is based on the Tensilica Xtensa LX6 microcontroller chip which is a dual-core Bluetooth and wifi chip that can go up to 80 – 240 MHz of frequency.
  2. LED – There is a LED present on the board which starts blinking when power is supplied to the board.
  3. Antenna – WROOM 32 has an in-built chip antenna which is used for connecting the board to wifi or Bluetooth connectivity. The presence of an inbuilt antenna helps in simplifying the design by eliminating the need for an external antenna.
  4. UART Bridge – It is required for connecting USB and UART for communication purposes.
  5. Micro USB – It is required for connecting the ESP 32 board to the 5v power supply.
  6. Boot/Flash Button – It is required for entering the boot or flash mode.
  7. Enable Button – It is used to enable the ESP 32 board. It is also required during entering boot mode.
  8. Power LED – There is an inbuilt power led present in the ESP – 32 module which is red in color and it will start blinking when the board is connected to a power supply.
  9. Voltage Regulator – There is an inbuilt voltage regulator available on the ESP 32 board which regulates the input voltage which is being supplied to the board.

That is all in the board components of the WROOM 32 board. Let us now have a look at the features of the board:

Board Features

BoardESP-01
ProcessorTensilica Xtensa LX6
Antenna1
Flash Memory4 MB
Board Dimension18mm x 25.5mm
Weight Of the board2.5g.
I/O Port28 – 34
ADC channels18
Interfaces 3 UART, 3 SPI, 2 I2C, 2 I2S
PWM Channels16
Capacitive Sensing GPIO10
DAC2

Power Consumption OF WROOM 32

The power consumption details of the WROOM-32 is as follows:

Power Supply2.2v to 3.6v
Current Consumption100mA
I/O Voltage3.6 v(max)
I/O source current12mA (max)
Modem Sleep 3 mA to 20 mA
Light Sleep0.8 mA
Deep Sleep0.15 mA

Pinout OF WROOM 32

Pin Number GPIOPin NameSafe to useReason
0D0Yes, but needed to pay attentionHigh for boot and low for programming
1 TX0NoTx pin
2D2Yes, but needed to pay attentionLOW during boot, connect to on-board LED
3RX0NoRx pin
4D4Yes
5D5Yes, but needed to pay attentionHigh for boot
6D6NoConnected to Flash memory
7D7NoConnected to Flash memory
8D8NoConnected to Flash memory
9D9NoConnected to Flash memory
10D10NoConnected to Flash memory
11D11NoConnected to Flash memory
12D12Yes, but needed to pay attentionLow during boot
13D13Yes
14D14Yes
15D15Yes, but needed to pay attentionMust be high during boot. Strapping Pin
16RX2Yes
17TX2Yes
18D18Yes
19D19Yes
21D21Yes
22D22Yes
23D23yes
24D24Yes
25D25Yes
26D26Yes
27D27Yes
32D32Yes
33D33Yes
34D34Yes, but needed to pay attentionInput only GPIO, can be configured as input only.
35D35Yes, but needed to pay attentionInput only GPIO, can be configured as input only.
36VPYes, but needed to pay attentionInput only GPIO, can be configured as input only.
39VNYes, but needed to pay attentionInput only GPIO, can be configured as input only

Power Pins

There are two pins available which are treated as power pins. These pins are the Vin pin and the 3V3 pin. The board gets enabled when a supply of 5v is transmitted to the board.

The 3v3 pin is the output of the voltage regulator which can get up to 600mA.

esp 32 power pins

Enable Pin

The EN pin is the enabled pin for the board. When this pin is pulled high the EN chip is enabled and when this pin is pulled low the chip is disabled.

esp 32 enable pins

Input Only Pins

There are 4 input-only pins available on the board. These input-only pins are GPIO 34, GPIO 35, Gpio 36(VP), and GPIO 39(VN). These pins can not be configured as output.

esp 32 input only pins

SPI flash-integrated pins

In some variants of the ESP 32 board GPIO pins from GPIO 6 pin to GPIO 11 pin are exposed. These pins are connected to the integrated SPI flash.

esp 32 spi flash integrated pins

GPIO 6 (SCK/CLK)

GPIO 7 (SDO/SD0)

GPIO 8 (SDI/SD1)

GPIO 9 (SHD/SD2)

GPIO 10 (SWP/SD3)

GPIO 11 (CSC/CMD)

Capacitive Touch GPIO

As its name suggests capacitive touch GPIO sensors are used to sense a change in anything having an electrical charge in it. There are a total of 10 Capacitive Touch GPIO sensors are there in ESP WROOM 32 board.

These sensors can be used as an alternative to mechanical buttons and they can be used for waking up the board from a deep sleep.

capacitive touch gpio pins

List of pins where the capacitive touch sensors are connected :

T0 (GPIO 4)

T1 (GPIO 0)

T2 (GPIO 2)

T3 (GPIO 15)

T4 (GPIO 13)

T5 (GPIO 12)

T6 (GPIO 14)

T7 (GPIO 27)

T8 (GPIO 33)

T9 (GPIO 32)

Analog To Digital Converter

These ADC pins are used to convert analog signals to digital signals. The ESP 32 board has 12×38 bits ADC input channels. The ADC input channels have a resolution of 12 bits so you can get analog readings from 0 to 4095.

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)
Here, 0 represents 0 volts whereas 4095 represents 3.3 volts. One thing to be kept in mind about ADC input channels is that the ADC 2 pin will not work when the board is connected to Wi-Fi and for resolving this problem you can use ADC GPIO 1 instead for getting the value.

Digital To Analog Converter

There are 2 DAC channels of 2×8 bits are available on ESP WROOM 32 board. As its name suggests DAC is used to convert digital signals to analog signals.

The DAC channels are

DAC 1(GPIO 25)
DAC 2(GPIO 26)

RTC GPIO

The RTC GPIO are used for waking up the ESP 32 board from deep sleep when the ultra-low power(ULP) co-processor is running. The list of the GPIOs which can be used as an external wake-up source of the board when it is in deep sleep are :

RTC_GPIO0 (GPIO36)
RTC_GPIO3 (GPIO39)
RTC_GPIO4 (GPIO34)
RTC_GPIO5 (GPIO35)
RTC_GPIO6 (GPIO25)
RTC_GPIO7 (GPIO26)
RTC_GPIO8 (GPIO33)
RTC_GPIO9 (GPIO32)
RTC_GPIO10 (GPIO4)
RTC_GPIO11 (GPIO0)
RTC_GPIO12 (GPIO2)
RTC_GPIO13 (GPIO15)
RTC_GPIO14 (GPIO13)
RTC_GPIO15 (GPIO12)
RTC_GPIO16 (GPIO14)
RTC_GPIO17 (GPIO27)

PWM Pins

Pulse Width Modulation pins are available on ESP 32 board. These pins are used to generate PWM signals of different properties.

All pins on the ESP 32 board which can generate output can be used as PWM pins except pins from 34-39.

I2C channels

The ESP 32 board has 2 I2C channels. These channels can be set as SDA and SCL. I2C is another communication protocol available on the board.

esp 32 I2C communication pins

The pins which can be used as SDA and SCL are:

GPIO 21 (SDA)
GPIO 22 (SCL)

SPI Pins

The ESP 32 SPI0 and SPI1 pins are used internally to access the ESP32’s attached flash memory That’s why we can’t use these pins. They share one signal bus via an arbiter.

SPI pins available on the board are:

SPIMOSIMISOCLKCS
VSPI (Verilog implementation of an SPI slave)GPIO 23GPIO 19GPIO 18GPIO 5
HSPIGPIO 13GPIO 12GPIO 14GPIO 15
esp 32 spi pins

Strapping Pins

Strapping pins are used to put the ESP 32 into flashing mode or we can say that on bootloader. The board puts the pins in the right state for flashing or boot mode so that you will not face any error during flashing the ESP 32 board.

Strapping pins available on the board are:

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)

Programming ESP WROOM 32 Board

  1. Add ESP Wroom 32 board to Arduino IDE
  2. Install the driver
  3. Connect the board to the PC

Add ESP Wroom 32 board to Arduino IDE

  1. For this purpose at first, you have to open Arduino IDE.
  2. Then go to the file
  3. Then preferences now paste links in additional boards to manage URLs.
  4. Go to tools
  5. Then Boards
  6. Then Board manager
  7. Now search for ESP32
  8. Select “ESP32 by Espressif systems”.
  9. Then click on install.
  10. Now, you can see a lot of famous ESP32 boards. You have to select “DOIT ESP32 DEVKIT V1” if you are using ESP Wroom 32.

Install the driver

Traditionally we connect any board to a PC using a USB cable but in the case of ESP Wroom 32, it communicates using UART. For this purpose, we have a bridge already available on the board for connecting UART with USB.

Now for connecting the UART and USB, we need a bridge driver which can be downloaded from the silicon lab’s official website.

Now click on the Driver to download the bridge driver( It is preferred to download in zip format) according to your operating system. in case you can’t extract files from a zipped folder.

For Windows, it is recommended to download the Windows driver.

Connect The Board To PC

  1. Firstly open the “Device Manager” on your PC
  2. Now connect the board to the PC using a USB B cable.
  3. In ports, you can see silicon labs CP210x USB to UART bridge(COMx).
  4. At the last x, there would be a digit which is to be noted down carefully.
  5. Then reopen the Arduino IDE.Go to tools
  6. Then go to ports
  7. There you can see a port:x, select it.
  8. Before uploading the code press the boot button.
  9. Then upload the LED blinking code written below:-
int LED_BUILTIN = 2;
void setup() {
pinMode (LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}

10. Now, click on upload.

11. Once the code is uploaded press the EN button and then you can see everything working as planned.

Frequently Asked Questions

Q1 – How to fix the error when trying to upload a new code to your ESP32 board?

Ans – In some of the ESP 32 boards the boot button needs to be held for 3 seconds when connecting is seen on the screen and then your code will upload.

By this way the board will get into the flashing mode and the error will be solved.

Leave a Comment