← Blog Posts

ESP32 Development Board – Complete Pinout Guide, GPIO Functions & Programming Tutorial

12 Nov 202686 views
ESP32 Development Board – Complete Pinout Guide, GPIO Functions & Programming Tutorial
Table of Contents
  1. 1. What Is ESP32?
  2. Key Features of ESP32
  3. 2. ESP32 Pinout Diagram
  4. 3. ESP32 Power Pins
  5. Important Power Supply Precautions
  6. 4. ESP32 GPIO Pin Functions
  7. ESP32 GPIO Pinout Table
  8. 5. ESP32 ADC Pins – Analog Input
  9. ADC1 Pins
  10. ADC2 Pins
  11. Applications of ADC
  12. 6. I2C Communication Pins
  13. Common I2C Devices
  14. 7. SPI Communication Pins
  15. VSPI Default Pins
  16. HSPI Default Pins
  17. Common SPI Devices
  18. 8. UART Communication Pins
  19. GPIO9 and GPIO10 are connected to internal flash on typical ESP32-WROOM-32 modules and should not be used for UART. UART1 can be assigned to suitable alternative GPIO pins through software.Common UART Applications
  20. 9. PWM Output and DAC Pins
  21. PWM Applications
  22. DAC Output Pins
  23. 10. ESP32 Capacitive Touch Sensor Pins
  24. Applications
  25. 11. ESP32 GPIO Pins to Avoid
  26. Internal Flash Pins
  27. Input-Only Pins
  28. Boot Strapping Pins
  29. 12. ESP32 Recommended GPIO Pins for Projects
  30. Information You Can Check
  31. Arduino Code – ESP32 Hardware Information Checker
  32. How to Use This Code
  33. Example Serial Monitor Output
  34. Required Components
  35. Circuit Connection
  36. Arduino Code – ESP32 LED Blink Test
  37. Expected Result
  38. 15. ESP32 Project Applications
  39. 16. Frequently Asked Questions (FAQ)
  40. 17. Conclusion

The ESP32 Development Board is one of the most popular microcontroller platforms for IoT (Internet of Things), Robotics, Smart Home Automation, and Embedded Systems development.

Developed by Espressif Systems, ESP32 offers built-in Wi-Fi and Bluetooth connectivity, powerful processing capabilities, multiple GPIO pins, and support for several communication protocols.

With ESP32, you can build various electronics projects, including Smart Energy Monitoring Systems, Home Automation, Wireless Sensor Networks, Robotics, Weather Stations, and Industrial Monitoring Systems.

In this tutorial, we will explore the ESP32 pinout diagram, GPIO functions, power pins, ADC, PWM, SPI, I2C, UART communication, and practical Arduino programming examples.

We will also show you how to check your ESP32's actual hardware specifications, including its chip model, CPU, flash memory, and PSRAM.

1. What Is ESP32?

ESP32 is a family of low-cost, low-power microcontroller systems developed by Espressif Systems.

Most commonly used ESP32 development boards include integrated Wi-Fi and Bluetooth connectivity, allowing developers to create wireless applications without requiring separate communication modules.


Key Features of ESP32

  • 32-bit microcontroller architecture.
  • Dual-core processor on many classic ESP32 variants.
  • Built-in 2.4 GHz Wi-Fi.
  • Bluetooth Classic and Bluetooth Low Energy (BLE) on supported variants.
  • Multiple GPIO pins for digital input and output.
  • 12-bit ADC (on classic ESP32).
  • PWM output using LEDC peripherals.
  • SPI, I2C, and UART communication interfaces.
  • Capacitive touch sensing on supported GPIO pins.
  • DAC output on classic ESP32 GPIO25 and GPIO26.
  • Support for Arduino IDE, ESP-IDF, and MicroPython.

Note: ESP32 is a product family, not a single chip. Specifications vary between ESP32, ESP32-S2, ESP32-S3, ESP32-C3, and other variants.

2. ESP32 Pinout Diagram

The ESP32 38-pin development board provides multiple GPIO pins, power connections, and communication interfaces.

Each GPIO pin can support different functions depending on the ESP32 chip and its configuration.

Before connecting sensors or external modules, it is important to understand the purpose of each pin.

3. ESP32 Power Pins

The ESP32 development board includes several power-related pins.

PinFunctionDescription
3V33.3V OutputSupplies 3.3V to compatible sensors and modules
VIN / 5VPower InputUsed to supply 5V to supported development boards
GNDGroundCommon ground connection
ENEnableEnables or resets the ESP32 chip


Important Power Supply Precautions

  • ESP32 GPIO pins operate at 3.3V logic levels.
  • ESP32 GPIO pins are not 5V tolerant.
  • Never connect a 5V signal directly to an ESP32 GPIO.
  • Use a voltage divider or logic level converter when necessary.
  • Always connect the GND of external modules to ESP32 GND.
  • Check the development board's power input specifications before applying external power.

4. ESP32 GPIO Pin Functions

GPIO stands for General Purpose Input/Output. These pins allow the ESP32 to communicate with external electronic components.

You can use GPIO pins to control LEDs, relays, motors, sensors, displays, and other devices.


ESP32 GPIO Pinout Table

GPIOMain FunctionsSpecial Features
GPIO0Digital I/OADC2, Touch, Boot
GPIO1Digital I/OUART0 TX
GPIO2Digital I/OADC2, Touch
GPIO3Digital I/OUART0 RX
GPIO4Digital I/OADC2, Touch
GPIO5Digital I/OVSPI CS
GPIO12Digital I/OHSPI MISO, Touch
GPIO13Digital I/OHSPI MOSI, Touch
GPIO14Digital I/OHSPI CLK, Touch
GPIO15Digital I/OHSPI CS, Touch
GPIO16Digital I/OUART2 RX
GPIO17Digital I/OUART2 TX
GPIO18Digital I/OVSPI SCK
GPIO19Digital I/OVSPI MISO
GPIO21Digital I/OI2C SDA
GPIO22Digital I/OI2C SCL
GPIO23Digital I/OVSPI MOSI
GPIO25Digital I/ODAC1, ADC2
GPIO26Digital I/ODAC2, ADC2
GPIO27Digital I/OADC2, Touch
GPIO32Digital I/OADC1, Touch
GPIO33Digital I/OADC1, Touch
GPIO34Input OnlyADC1
GPIO35Input OnlyADC1
GPIO36Input OnlyADC1
GPIO39Input OnlyADC1


Note: This table describes the original ESP32-WROOM-32 family. Pin availability and functionality can differ between ESP32 variants and development boards.

5. ESP32 ADC Pins – Analog Input

ADC stands for Analog-to-Digital Converter.

ESP32 uses ADC to read analog signals from sensors and convert them into digital values that can be processed by the microcontroller.

The classic ESP32 provides a 12-bit ADC resolution, which generally produces readings from 0 to 4095.


ADC1 Pins

GPIOADC Channel
GPIO36ADC1_CH0
GPIO37ADC1_CH1
GPIO38ADC1_CH2
GPIO39ADC1_CH3
GPIO32ADC1_CH4
GPIO33ADC1_CH5
GPIO34ADC1_CH6
GPIO35ADC1_CH7


GPIO37 and GPIO38 are not normally exposed on standard ESP32 DevKit boards.


ADC2 Pins

GPIOADC Channel
GPIO4ADC2_CH0
GPIO0ADC2_CH1
GPIO2ADC2_CH2
GPIO15ADC2_CH3
GPIO13ADC2_CH4
GPIO12ADC2_CH5
GPIO14ADC2_CH6
GPIO27ADC2_CH7
GPIO25ADC2_CH8
GPIO26ADC2_CH9


Recommended


Use ADC1 pins whenever possible if your project requires Wi-Fi connectivity.On the original ESP32, ADC2 access is restricted when Wi-Fi is active.


Applications of ADC

  • LDR Light Sensors
  • Potentiometers
  • Analog Voltage Sensors
  • MQ Series Gas Sensors
  • Analog Current Sensors
  • Battery Voltage Monitoring

6. I2C Communication Pins

I2C (Inter-Integrated Circuit) is a serial communication protocol that allows multiple devices to communicate using two main signal lines.

The default I2C pins on the classic ESP32 are:

SignalGPIO
SDAGPIO21
SCLGPIO22

Common I2C Devices

  • SSD1306 OLED Display
  • I2C LCD Display
  • INA219 / INA226 Current Sensor
  • DS3231 RTC Module
  • BME280 Environmental Sensor
  • MPU6050 Gyroscope and Accelerometer

The I2C pins can also be changed through software using the Arduino Wire library.

7. SPI Communication Pins

SPI (Serial Peripheral Interface) is a high-speed communication protocol commonly used with displays, memory cards, wireless modules, and other peripherals.

The classic ESP32 provides two commonly used SPI pin groups.


VSPI Default Pins

SignalGPIO
MOSIGPIO23
MISOGPIO19
SCKGPIO18
CSGPIO5


HSPI Default Pins

SignalGPIO
MOSIGPIO13
MISOGPIO12
SCKGPIO14
CSGPIO15

Common SPI Devices

  • NRF24L01 Wireless Module
  • SD Card Module
  • TFT LCD Display
  • W5500 Ethernet Module
  • SPI Flash Memory

Note: GPIO12 is a boot-strapping pin on the classic ESP32. Be careful when using it with external SPI devices.

8. UART Communication Pins

UART (Universal Asynchronous Receiver/Transmitter) is used for serial communication between the ESP32 and external devices.

The classic ESP32 provides three UART controllers.

UARTTX GPIORX GPIOCommon Use
UART0GPIO1GPIO3USB Programming and Serial Monitor
UART1GPIO10*GPIO9*Additional Serial Communication
UART2GPIO17GPIO16GSM, GPS, and Serial Modules


GPIO9 and GPIO10 are connected to internal flash on typical ESP32-WROOM-32 modules and should not be used for UART. UART1 can be assigned to suitable alternative GPIO pins through software.Common UART Applications

  • SIM800L GSM Module
  • SIM900A GSM Module
  • GPS Modules
  • Serial Bluetooth Devices
  • Industrial Serial Communication

UART2 is often a convenient choice for external communication modules because UART0 is normally used for programming and debugging.

9. PWM Output and DAC Pins

PWM (Pulse Width Modulation) allows the ESP32 to control output power by rapidly switching a digital signal between HIGH and LOW states.

The ESP32 LEDC peripheral supports PWM generation.


PWM Applications

  • LED Brightness Control
  • DC Motor Speed Control
  • Servo Motor Signal Generation
  • Buzzer Tone Generation
  • Fan Speed Control

Most output-capable GPIO pins can generate PWM signals.


DAC Output Pins

The original ESP32 provides two 8-bit DAC channels.

GPIODAC Channel
GPIO25DAC1
GPIO26DAC2


These pins can generate analog voltage outputs using the classic ESP32 DAC hardware.

10. ESP32 Capacitive Touch Sensor Pins

The classic ESP32 includes built-in capacitive touch sensing.

This feature allows you to create touch buttons and touch-based control systems without requiring separate touch sensor modules.

Touch ChannelGPIO
TOUCH0GPIO4
TOUCH1GPIO0
TOUCH2GPIO2
TOUCH3GPIO15
TOUCH4GPIO13
TOUCH5GPIO12
TOUCH6GPIO14
TOUCH7GPIO27
TOUCH8GPIO33
TOUCH9GPIO32


Applications

  • Touch Buttons
  • Touch Switches
  • Touch-Controlled Lighting
  • Interactive Electronics Projects
  • Capacitive User Interfaces

Touch functionality and available APIs vary between ESP32 chip generations.

11. ESP32 GPIO Pins to Avoid

Not every GPIO pin on the ESP32 should be used for external circuits.

Some pins are reserved for internal flash communication, while others affect the chip's boot configuration.


Internal Flash Pins

Do Not Use

GPIOFunction
GPIO6SPI Flash Clock
GPIO7SPI Flash Data
GPIO8SPI Flash Data
GPIO9SPI Flash Data
GPIO10SPI Flash Data
GPIO11SPI Flash Command


These pins are normally connected to the internal flash memory on ESP32-WROOM-32 modules.


Input-Only Pins

The following pins support input operations only:


  • GPIO34
  • GPIO35
  • GPIO36
  • GPIO39

They cannot directly control LEDs, relays, or other digital output devices.


Boot Strapping Pins

The following pins are involved in boot configuration:


  • GPIO0
  • GPIO2
  • GPIO5
  • GPIO12
  • GPIO15

External circuits connected to these pins must not interfere with the required boot logic levels.

In particular, GPIO12 requires special attention because an incorrect boot-time level can affect the flash supply voltage configuration on classic ESP32 modules.

Choosing the correct GPIO pins is important for reliable project development.

The following table provides some practical GPIO recommendations for common electronic components.

ComponentRecommended GPIO
LEDGPIO25, GPIO26, GPIO27
Relay ModuleGPIO25, GPIO26, GPIO27, GPIO32, GPIO33
OLED Display (I2C)GPIO21, GPIO22
Analog SensorGPIO32, GPIO33, GPIO34, GPIO35
SIM900A / SIM800LGPIO16, GPIO17
NRF24L01GPIO5, GPIO18, GPIO19, GPIO23
BuzzerGPIO25, GPIO26, GPIO27
Push ButtonGPIO32, GPIO33, GPIO34, GPIO35


These are suggested pin assignments for the classic ESP32. Always check for pin conflicts before connecting multiple modules.

13. ESP32 Hardware Information Checker – Identify Your ESP32 Board

One of the most useful things you can do before starting an ESP32 project is check the actual hardware specifications of your development board.

Not all ESP32 boards have the same specifications. Some modules include different chip models, flash capacities, PSRAM, CPU configurations, and memory capabilities.

For example:


  • ESP32-WROOM-32
  • ESP32-WROOM-32E
  • ESP32-WROVER
  • ESP32-S3
  • ESP32-C3
  • ESP32-S2

These modules have different hardware capabilities.

The following Arduino IDE program reads the available hardware information from your ESP32 and displays it in the Serial Monitor.


Information You Can Check

InformationDescription
Chip ModelIdentifies the ESP32 chip family/model
Chip RevisionHardware revision number
CPU FrequencyCurrent CPU clock frequency
CPU CoresNumber of processor cores
Flash SizeTotal onboard flash memory
Flash SpeedFlash memory operating frequency
Flash ModeFlash interface configuration
PSRAM StatusDetects whether PSRAM is available
PSRAM SizeTotal available external RAM
Free PSRAMCurrently available PSRAM
Total HeapTotal available dynamic RAM
Free HeapCurrently available heap memory
Minimum Free HeapLowest recorded free heap
Maximum Allocatable HeapLargest available contiguous heap block
MAC AddressESP32 hardware MAC address
ESP-IDF VersionUnderlying Espressif software framework version
Sketch SizeCompiled program size
Free Sketch SpaceRemaining application partition space


Arduino Code – ESP32 Hardware Information Checker

Complete Test Code


#include <Arduino.h>
#include <WiFi.h>
#include "esp_system.h"

// Change this name according to your development board
#define BOARD_NAME "ESP32 Development Board"

void printLine() {
  Serial.println("----------------------------------------");
}

void setup() {
  Serial.begin(115200);
  delay(1500);

  Serial.println();
  printLine();
  Serial.println("       ESP32 HARDWARE INFORMATION");
  printLine();

  // Board Information
  Serial.print("Board Name          : ");
  Serial.println(BOARD_NAME);

  // Chip Information
  Serial.print("Chip Model          : ");
  Serial.println(ESP.getChipModel());

  Serial.print("Chip Revision       : ");
  Serial.println(ESP.getChipRevision());

  Serial.print("CPU Cores           : ");
  Serial.println(ESP.getChipCores());

  Serial.print("CPU Frequency       : ");
  Serial.print(ESP.getCpuFreqMHz());
  Serial.println(" MHz");

  // Flash Information
  Serial.println();
  Serial.println("FLASH INFORMATION");

  Serial.print("Flash Size          : ");
  Serial.print(ESP.getFlashChipSize() / 1024 / 1024);
  Serial.println(" MB");

  Serial.print("Flash Speed         : ");
  Serial.print(ESP.getFlashChipSpeed() / 1000000);
  Serial.println(" MHz");

  Serial.print("Flash Mode          : ");
  Serial.println((int)ESP.getFlashChipMode());

  // PSRAM Information
  Serial.println();
  Serial.println("PSRAM INFORMATION");

  if (psramFound()) {
    Serial.println("PSRAM Status        : DETECTED");

    Serial.print("Total PSRAM         : ");
    Serial.print(ESP.getPsramSize() / 1024);
    Serial.println(" KB");

    Serial.print("Free PSRAM          : ");
    Serial.print(ESP.getFreePsram() / 1024);
    Serial.println(" KB");
  } else {
    Serial.println("PSRAM Status        : NOT DETECTED");
    Serial.println("PSRAM Size          : 0 KB");
  }

  // RAM / Heap Information
  Serial.println();
  Serial.println("RAM INFORMATION");

  Serial.print("Total Heap          : ");
  Serial.print(ESP.getHeapSize() / 1024);
  Serial.println(" KB");

  Serial.print("Free Heap           : ");
  Serial.print(ESP.getFreeHeap() / 1024);
  Serial.println(" KB");

  Serial.print("Minimum Free Heap   : ");
  Serial.print(ESP.getMinFreeHeap() / 1024);
  Serial.println(" KB");

  Serial.print("Max Allocatable     : ");
  Serial.print(ESP.getMaxAllocHeap() / 1024);
  Serial.println(" KB");

  // MAC Address
  Serial.println();
  Serial.println("DEVICE INFORMATION");

  Serial.print("MAC Address         : ");
  Serial.println(WiFi.macAddress());

  Serial.print("eFuse MAC           : ");
  Serial.printf("%012llX\n", ESP.getEfuseMac());

  // ESP-IDF Version
  Serial.print("ESP-IDF Version     : ");
  Serial.println(ESP.getSdkVersion());

  // Program Information
  Serial.println();
  Serial.println("PROGRAM INFORMATION");

  Serial.print("Sketch Size         : ");
  Serial.print(ESP.getSketchSize() / 1024);
  Serial.println(" KB");

  Serial.print("Free Sketch Space   : ");
  Serial.print(ESP.getFreeSketchSpace() / 1024);
  Serial.println(" KB");

  printLine();
  Serial.println("HARDWARE CHECK COMPLETED");
  printLine();
}

void loop() {
  // No repeated operation required
}

How to Use This Code

  1. Connect your ESP32 development board to your computer using a USB cable.
  2. Open Arduino IDE.
  3. Select the correct ESP32 board from Tools → Board.
  4. Select the correct COM port.
  5. Upload the hardware information checker code.
  6. Open Tools → Serial Monitor.
  7. Set the baud rate to 115200.
  8. Check the hardware information displayed in the Serial Monitor.

Example Serial Monitor Output

The following is an illustrative example. Actual values depend on your ESP32 module.


----------------------------------------
       ESP32 HARDWARE INFORMATION
----------------------------------------
Board Name          : ESP32 Development Board
Chip Model          : ESP32-D0WD-V3
Chip Revision       : 3
CPU Cores           : 2
CPU Frequency       : 240 MHz

FLASH INFORMATION
Flash Size          : 4 MB
Flash Speed         : 80 MHz
Flash Mode          : 3

PSRAM INFORMATION
PSRAM Status        : NOT DETECTED
PSRAM Size          : 0 KB

RAM INFORMATION
Total Heap          : 320 KB
Free Heap           : 280 KB
Minimum Free Heap   : 270 KB
Max Allocatable     : 120 KB

DEVICE INFORMATION
MAC Address         : XX:XX:XX:XX:XX:XX
eFuse MAC           : XXXXXXXXXXXX
ESP-IDF Version     : 5.x

PROGRAM INFORMATION
Sketch Size         : 250 KB
Free Sketch Space   : 3500 KB

----------------------------------------
HARDWARE CHECK COMPLETED
----------------------------------------

Example values are illustrative, not guaranteed readings.

Important notes:


  • The BOARD_NAME value is manually defined. The ESP32 chip cannot reliably identify the exact development board manufacturer or board name automatically.
  • The chip model identifies the silicon, not necessarily the complete module name.
  • PSRAM is not available on every ESP32 board. A WROOM module without PSRAM will normally report NOT DETECTED.
  • Flash size and free sketch space are different measurements. Free sketch space depends on the selected partition scheme.
  • The eFuse MAC is printed as a 12-digit hexadecimal value; it is not necessarily the same MAC address format as the Wi-Fi interface.
  • Some information or API availability may differ between ESP32 chip families and Arduino-ESP32 core versions.

This program is especially useful for checking unknown ESP32 boards before starting a project.

14. ESP32 Basic GPIO Test – LED Blink Test

After checking the hardware specifications, the next step is to test whether your ESP32 can successfully control its GPIO pins.

This simple test uses an external LED connected to GPIO25.


Required Components

ComponentQuantity
ESP32 Development Board1
LED1
220Ω Resistor1
Jumper WiresAs required
USB Cable1


Circuit Connection

ESP32 PinConnection
GPIO25220Ω Resistor → LED Anode (+)
GNDLED Cathode (-)


#define LED_PIN 25

void setup() {
  Serial.begin(115200);

  pinMode(LED_PIN, OUTPUT);

  Serial.println("ESP32 GPIO TEST STARTED");
}

void loop() {

  digitalWrite(LED_PIN, HIGH);
  Serial.println("LED ON");

  delay(1000);

  digitalWrite(LED_PIN, LOW);
  Serial.println("LED OFF");

  delay(1000);
}

Expected Result

After uploading the code:


  • The LED will turn ON.
  • After one second, the LED will turn OFF.
  • This process will repeat continuously.
  • The Serial Monitor will display LED ON and LED OFF messages.

If the LED blinks correctly, your selected GPIO is working as an output under this test.

Note: GPIO25 is an example output pin on the original ESP32. Check your particular board's pin availability before testing.

15. ESP32 Project Applications

ESP32 is suitable for a wide range of electronics and IoT applications.

Some popular project ideas include:


  1. Smart Home Automation System
  2. IoT-Based Energy Monitoring System
  3. ESP32 Wi-Fi Weather Station
  4. Smart Water Quality Monitoring System
  5. Wireless Robotics Control System
  6. GSM-Based Power Failure Monitoring System
  7. ESP32-CAM Surveillance System
  8. Industrial IoT Monitoring System
  9. Solar Energy Monitoring System
  10. Wireless Sensor Monitoring Network

16. Frequently Asked Questions (FAQ)

Q1. Can ESP32 operate using a 5V power supply?

Yes. Most ESP32 development boards support 5V input through their USB or VIN/5V power connections. However, the ESP32 GPIO pins operate at 3.3V logic and are not 5V tolerant.

Q2. How many GPIO pins does ESP32 have?

The original ESP32 chip has up to 34 programmable GPIOs, but not all are suitable for general-purpose use. The number of accessible pins depends on the development board.

Q3. Does ESP32 support Wi-Fi and Bluetooth simultaneously?

Classic ESP32 supports Wi-Fi and Bluetooth/BLE coexistence. However, simultaneous operation shares radio resources.

Q4. Can I program ESP32 using Arduino IDE?

Yes. Install the Espressif ESP32 board package in Arduino IDE, select the appropriate board, and upload your program.

Q5. What is the ADC resolution of ESP32?

The classic ESP32 has a 12-bit ADC resolution, providing digital readings from 0 to 4095.

Q6. Does every ESP32 board have PSRAM?

No. PSRAM availability depends on the particular ESP32 chip and module. For example, standard ESP32-WROOM-32 modules generally do not include PSRAM, while some ESP32-WROVER and ESP32-S3 modules include it.

Q7. How can I check the ESP32 chip model?

Upload the Hardware Information Checker code provided in this tutorial and open the Arduino Serial Monitor at 115200 baud.

Q8. What is the difference between Flash Memory and PSRAM?

Flash memory stores firmware, program files, and persistent data. PSRAM provides additional temporary working memory for applications that need more RAM.

Q9. Can I use GPIO34 and GPIO35 as output pins?

No. On the classic ESP32, GPIO34, GPIO35, GPIO36, and GPIO39 are input-only pins.

Q10. Which GPIO pins are recommended for I2C communication?

The default I2C pins are GPIO21 (SDA) and GPIO22 (SCL).

17. Conclusion

The ESP32 Development Board is a powerful and versatile platform for electronics, robotics, embedded systems, and IoT development.

Understanding its pinout, GPIO functions, ADC, PWM, SPI, I2C, UART, and power requirements is essential for building reliable projects.

In this tutorial, we covered the complete ESP32 pinout guide, important hardware precautions, and practical Arduino programming examples.

We also included a Hardware Information Checker that helps identify the ESP32 chip model, CPU configuration, Flash Memory, PSRAM, and other hardware specifications.

Whether you are a beginner or an experienced electronics developer, understanding these features will help you work more efficiently with ESP32.

Keep exploring

Recent Projects

View all →