ESP32 DevKit V1 Pinout and Wiring Guide

This guide will help you understand the ESP32 DevKit V1 pinout and  wiring Guide for various projects. The ESP32 DevKit V1 is an affordable and versatile development board popular in IoT projects due to its built-in Wi-Fi, Bluetooth, and numerous I/O pins. This tutorial provides detailed information suitable for beginners.

ESP32 DevKit V1 Pinout Diagram

To get started, here is a labeled diagram of the ESP32 DevKit V1, showing the functions of all the pins:

[Include the generated pinout diagram image here]

Detailed Pinout Table for ESP32 DevKit V1

The ESP32 DevKit V1 has 38 pins with various functions. Here’s a detailed breakdown of each pin:

Pin Name GPIO Number Function Description
3V3 Power Supply Provides 3.3V power to the board and peripherals.
GND Ground Common ground for all components.
VIN Power Input Accepts a 5V supply to power the board (alternative to USB).
GPIO0 0 Boot Mode / I/O Used to put the ESP32 in programming mode.
GPIO1 1 UART TX Default TX pin for serial communication.
GPIO2 2 General Purpose I/O Can be used for LED control or other tasks; has a built-in LED.
GPIO3 3 UART RX Default RX pin for serial communication.
GPIO4 4 I/O / Touch Sensor Supports touch sensing and can be used for general I/O.
GPIO5 5 I/O / SPI SS Used for SPI chip select (SS) or other general-purpose tasks.
GPIO12 12 I/O / ADC / Touch Sensor Analog input, touch sensor, or general I/O.
GPIO13 13 I/O / ADC / Touch Sensor Analog input, touch sensor, or general I/O.
GPIO14 14 I/O / ADC Analog input or general I/O.
GPIO15 15 I/O / Touch Sensor Can also be used as a touch sensor.
GPIO16 16 I/O General-purpose I/O.
GPIO17 17 I/O General-purpose I/O.
GPIO18 18 SPI SCK Serial Clock for SPI communication.
GPIO19 19 SPI MISO SPI data input.
GPIO21 21 I2C SDA Data line for I2C communication.
GPIO22 22 I2C SCL Clock line for I2C communication.
GPIO23 23 SPI MOSI SPI data output.
GPIO25 25 I/O / ADC / DAC Can be used as analog input or Digital-to-Analog Converter output.
GPIO26 26 I/O / ADC / DAC Can be used as analog input or DAC output.
GPIO27 27 I/O / ADC / Touch Sensor Supports touch sensing and can be used as an analog input.
GPIO32 32 ADC / Touch Sensor Can read analog signals or be used as a touch sensor.
GPIO33 33 ADC / Touch Sensor Analog input and touch sensing capabilities.
GPIO34-39 34-39 ADC (Input Only) These pins can only be used for reading analog values (input-only).
EN Enable Pull high to enable the chip; pull low for a low-power state.
BOOT Boot Mode Used to put the ESP32 in programming mode.

Powering the ESP32 DevKit V1

The ESP32 can be powered in multiple ways:

  1. Via USB Cable: Connect the board to your computer or a USB power source using a micro USB cable.
  2. Via VIN Pin (5V Supply): The VIN pin accepts a 5V power source, which can be useful for powering the ESP32 with a battery.
  3. Using the 3V3 Pin: Supplies 3.3V to the board from an external regulator.

Tip: Make sure not to exceed 3.3V on the GPIO pins as the ESP32 is not 5V tolerant.

Using GPIO Pins for Digital I/O

The General Purpose Input/Output (GPIO) pins on the ESP32 can be used for various digital tasks:

  1. Controlling an LED:
    • Connect the LED’s anode (longer leg) to a GPIO pin (e.g., GPIO2).
    • Connect the cathode (shorter leg) to GND through a current-limiting resistor (220 ohms).
  2. Reading a Button State:
    • Connect one terminal of the button to a GPIO pin (e.g., GPIO16).
    • Connect the other terminal to GND.
    • Enable the internal pull-up resistor in the code.
  3. Touch Sensors:
    • The ESP32 includes several touch-sensitive GPIO pins (e.g., GPIO4, GPIO27). These can be used to detect touch without additional hardware.

Working with Analog Pins (ADC)

The ESP32 has multiple ADC (Analog to Digital Converter) channels that can read voltages from 0V to 3.3V.

Connecting an Analog Sensor

  1. Light Sensor Example:
    • Connect the sensor’s power pin to 3.3V.
    • Connect the ground pin to GND.
    • Connect the output pin to an ADC-capable GPIO (e.g., GPIO36).
  2. Adjusting ADC Resolution:
    • The default resolution is 12 bits (0-4095), which can be changed in the code to 9, 10, or 11 bits for different applications.

Note: Avoid using ADC2 channels while the Wi-Fi is active, as they share internal resources.

I2C Communication Setup with ESP32 DevKit V1

The I2C (Inter-Integrated Circuit) protocol allows communication with multiple peripherals using two pins: SDA and SCL.

  1. Connecting I2C Devices (e.g., OLED Display)
    • SDA (Data Line): Connect to GPIO21.
    • SCL (Clock Line): Connect to GPIO22.
  2. Pull-up Resistors
    • I2C typically requires 4.7kΩ pull-up resistors on the SDA and SCL lines.

Using SPI Communication with ESP32 DevKit V1

The SPI (Serial Peripheral Interface) protocol is used for high-speed communication.

Wiring an SPI Device (e.g., SD Card)

  1. SCK (Clock): Connect to GPIO18.
  2. MISO (Data In): Connect to GPIO19.
  3. MOSI (Data Out): Connect to GPIO23.
  4. SS (Chip Select): Connect to GPIO5.

Tip: Make sure to use logic level shifters if interfacing with 5V SPI devices.

Troubleshooting Common Issues

  1. ESP32 Not Powering On
    • Verify that you are using a reliable 5V power source.
    • Check that the USB cable is functioning correctly.
  2. Upload Failed: Connecting Error
    • Press the BOOT button while uploading.
    • Ensure the correct COM port is selected in the IDE.
  3. Unstable Analog Readings
    • Use a capacitor across the ADC pin to filter noise.
    • Avoid using ADC2 pins when Wi-Fi is active.

FAQs: Common Questions About ESP32 DevKit V1 Pinout

1. What is the ESP32 DevKit V1 pinout?

  • It is the arrangement of pins on the ESP32 used for power, input/output, and communication.

2. Is the ESP32 DevKit V1 5V tolerant?

  • No, most GPIO pins are not 5V tolerant. Use 3.3V for the GPIO pins.

3. Can I power the ESP32 via USB?

  • Yes, you can power the board through the USB port or the VIN pin.

Conclusion: ESP32 DevKit V1 Pinout and Wiring Guide for Beginners

This ESP32 DevKit V1 pinout and wiring guide covers essential details about power, GPIO, analog pins, and communication protocols (I2C and SPI). By understanding these basics, you can confidently start building IoT projects with the ESP32.