Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use ESP32 38-pin Expansion Board: Examples, Pinouts, and Specs

Image of ESP32 38-pin Expansion BoardDesign with ESP32 38-pin Expansion Board in Cirkit Designer

Introduction

The ESP32 38-pin Expansion Board, manufactured by Espressif (Part ID: ESP32), is a versatile and user-friendly development board designed to simplify prototyping and development with the ESP32 microcontroller. Featuring 38 GPIO pins, this board provides seamless connectivity to a wide range of sensors, modules, and peripherals, making it an ideal choice for Internet of Things (IoT) applications, smart devices, and embedded systems.

Explore Projects Built with ESP32 38-pin Expansion Board

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ESP32-Based OLED Display Interface: A project utilizing ESP32 38-pin Expansion Board in a practical application
ESP32-Based OLED Display Interface

This circuit features an ESP32 microcontroller connected to an OLED 1.3" display. The ESP32's GPIO pins 21 and 22 are used for I2C communication (SDA and SCL respectively) with the OLED display. The display is powered by the 5V output from the ESP32, and both devices share a common ground.

Open Project in Cirkit Designer
Image of ESP32-Based Smart Irrigation and Environmental Monitoring System: A project utilizing ESP32 38-pin Expansion Board in a practical application
ESP32-Based Smart Irrigation and Environmental Monitoring System

This circuit features an ESP32 microcontroller as the central processing unit, interfaced with various sensors and actuators. It includes a humidity sensor (YL-69), a temperature and humidity sensor (DHT11), a buzzer, an RS485 transceiver for serial communication, and an LCD display for user interface. The circuit also controls two 5V mini water pumps via an L298N motor driver, powered by a series connection of two 18650 Li-Ion batteries, with a rocker switch for power control. Additionally, it integrates an NPK soil sensor for measuring soil nutrients.

Open Project in Cirkit Designer
Image of ESP32-Based Obstacle Detection and Display System with Servo Control: A project utilizing ESP32 38-pin Expansion Board in a practical application
ESP32-Based Obstacle Detection and Display System with Servo Control

This circuit features an ESP32 microcontroller board as the central processing unit, interfaced with multiple sensors and actuators. It includes IR and ultrasonic sensors for distance or obstacle detection, servomotors for movement control, and an ESP32-CAM module for image capture. The circuit also incorporates LEDs with current-limiting resistors for status indication and an I2C LCD display for outputting information or readings.

Open Project in Cirkit Designer
Image of ESP32-Based Smart Display with Camera and Audio Alert System: A project utilizing ESP32 38-pin Expansion Board in a practical application
ESP32-Based Smart Display with Camera and Audio Alert System

This circuit features two ESP32 microcontrollers, one standard 30-pin version and one ESP32-CAM module, both sharing a common ground and power supply. The 30-pin ESP32 is interfaced with an I2C LCD 16x2 Screen for display purposes, using its I2C pins (D21 for SDA and D22 for SCL), and controls a buzzer connected to pin D23. Additionally, the ESP32-CAM is connected to the 30-pin ESP32 via serial communication through pins TX2 and RX2 for potential image data transfer.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The ESP32 38-pin Expansion Board is built to support the powerful ESP32 microcontroller, offering robust performance and connectivity options. Below are the key technical details:

Key Technical Details

Pin Configuration and Descriptions

The ESP32 38-pin Expansion Board features a 38-pin layout, with each pin serving a specific function. Below is a detailed pinout description:

Pin Number Pin Name Function Description
1-3 GND Ground Common ground for the circuit.
4 3V3 Power Supply 3.3V output for powering external components.
5 EN Enable Active-high pin to enable the ESP32 chip.
6-7 IO0, IO2 GPIO General-purpose input/output pins.
8-9 IO4, IO5 GPIO, PWM Configurable as digital I/O or PWM output.
10-11 IO12, IO13 GPIO, ADC Configurable as digital I/O or analog input.
12-13 IO14, IO15 GPIO, PWM Configurable as digital I/O or PWM output.
14-15 IO16, IO17 GPIO, UART Configurable as digital I/O or UART communication pins.
16-17 IO18, IO19 GPIO, SPI Configurable as digital I/O or SPI communication pins.
18-19 IO21, IO22 GPIO, I2C Configurable as digital I/O or I2C communication pins.
20-21 IO23, IO25 GPIO, DAC Configurable as digital I/O or DAC output.
22-23 IO26, IO27 GPIO, ADC Configurable as digital I/O or analog input.
24-25 IO32, IO33 GPIO, ADC Configurable as digital I/O or analog input.
26-27 IO34, IO35 GPIO, ADC Input-only pins, configurable as analog input.
28-29 IO36, IO39 GPIO, ADC Input-only pins, configurable as analog input.
30 VIN Power Input External power input (5V).
31-38 Other Pins Various Includes additional GPIO, UART, and SPI pins.

Usage Instructions

The ESP32 38-pin Expansion Board is designed for ease of use, making it suitable for both beginners and experienced developers. Follow the steps below to get started:

How to Use the Component in a Circuit

  1. Powering the Board:

    • Connect the board to your computer using a Micro-USB cable for power and programming.
    • Alternatively, supply 5V to the VIN pin for external power.
  2. Programming the Board:

    • Install the ESP32 board package in the Arduino IDE or use the Espressif IDF (IoT Development Framework).
    • Select the correct board and port in the IDE settings.
  3. Connecting Peripherals:

    • Use the GPIO pins to connect sensors, actuators, or other modules.
    • Ensure that the voltage levels of connected devices are compatible with the 3.3V logic of the ESP32.
  4. Uploading Code:

    • Write your code in the Arduino IDE or another supported environment.
    • Press the "Upload" button to flash the code to the ESP32.

Important Considerations and Best Practices

Example Code for Arduino UNO Integration

Below is an example of how to use the ESP32 38-pin Expansion Board to read data from a DHT11 temperature and humidity sensor:

#include "DHT.h"

// Define the DHT sensor type and pin
#define DHTPIN 4       // GPIO4 is connected to the DHT11 data pin
#define DHTTYPE DHT11  // DHT11 sensor type

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(115200);  // Initialize serial communication
  dht.begin();           // Initialize the DHT sensor
  Serial.println("DHT11 Sensor Test");
}

void loop() {
  float temperature = dht.readTemperature();  // Read temperature in Celsius
  float humidity = dht.readHumidity();        // Read humidity percentage

  // Check if the readings are valid
  if (isnan(temperature) || isnan(humidity)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Print the readings to the Serial Monitor
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.println(" %");

  delay(2000);  // Wait 2 seconds before the next reading
}

Troubleshooting and FAQs

Common Issues Users Might Face

  1. Board Not Detected by Computer:

    • Ensure the USB cable is functional and supports data transfer.
    • Install the correct USB-to-serial driver for the ESP32.
  2. Code Upload Fails:

    • Check that the correct board and port are selected in the IDE.
    • Hold the "BOOT" button on the board while uploading the code.
  3. Unstable Operation:

    • Verify that the power supply is stable and sufficient.
    • Avoid using GPIO pins for high-current loads without proper drivers.

Solutions and Tips for Troubleshooting

By following this documentation, you can effectively utilize the ESP32 38-pin Expansion Board for your IoT and embedded system projects.