Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use ESP32 with Expansion Board: Examples, Pinouts, and Specs

Image of ESP32 with Expansion Board
Cirkit Designer LogoDesign with ESP32 with Expansion Board in Cirkit Designer

Introduction

The ESP32 is a powerful microcontroller with integrated Wi-Fi and Bluetooth capabilities, making it an excellent choice for Internet of Things (IoT) applications. It features a dual-core processor, low-power consumption, and a wide range of peripherals. The addition of an expansion board enhances its functionality by providing extra GPIO pins, improved power management, and simplified connectivity to sensors, actuators, and other modules.

Explore Projects Built with ESP32 with 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!
ESP32-Based Smart Irrigation and Environmental Monitoring System
Image of fyp: A project utilizing ESP32 with Expansion Board in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Monitoring and Weight Detection System with Camera and Display
Image of flowchart 3D: A project utilizing ESP32 with Expansion Board in a practical application
This circuit features an ESP32 on a baseboard as the central microcontroller, interfaced with various peripherals. It includes a DHT22 sensor for measuring temperature and humidity, an I2C LCD screen for display, a buzzer for audio alerts, and an ESP32 CAM module for capturing images or video. Additionally, the circuit integrates an HX711 bridge sensor interface connected to a load cell for weight measurement, with a 10k Ohm resistor for the DHT22 pull-up configuration.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Vibration Motor Controller with I2C IO Expansion
Image of VIBRATYION: A project utilizing ESP32 with Expansion Board in a practical application
This circuit features an ESP32 Wroom Dev Kit microcontroller interfaced with an MCP23017 I/O expansion board via I2C communication, utilizing GPIO 21 and GPIO 22 for SDA and SCL lines, respectively. A vibration motor is controlled by an NPN transistor acting as a switch, with a diode for back EMF protection and a resistor to limit base current. The ESP32 can control the motor by sending signals to the MCP23017, which then interfaces with the transistor to turn the motor on or off.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Obstacle Detection and Display System with Servo Control
Image of xyhaeee: A project utilizing ESP32 with Expansion Board in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ESP32 with 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 fyp: A project utilizing ESP32 with 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of flowchart 3D: A project utilizing ESP32 with Expansion Board in a practical application
ESP32-Based Environmental Monitoring and Weight Detection System with Camera and Display
This circuit features an ESP32 on a baseboard as the central microcontroller, interfaced with various peripherals. It includes a DHT22 sensor for measuring temperature and humidity, an I2C LCD screen for display, a buzzer for audio alerts, and an ESP32 CAM module for capturing images or video. Additionally, the circuit integrates an HX711 bridge sensor interface connected to a load cell for weight measurement, with a 10k Ohm resistor for the DHT22 pull-up configuration.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of VIBRATYION: A project utilizing ESP32 with Expansion Board in a practical application
ESP32-Based Vibration Motor Controller with I2C IO Expansion
This circuit features an ESP32 Wroom Dev Kit microcontroller interfaced with an MCP23017 I/O expansion board via I2C communication, utilizing GPIO 21 and GPIO 22 for SDA and SCL lines, respectively. A vibration motor is controlled by an NPN transistor acting as a switch, with a diode for back EMF protection and a resistor to limit base current. The ESP32 can control the motor by sending signals to the MCP23017, which then interfaces with the transistor to turn the motor on or off.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of xyhaeee: A project utilizing ESP32 with 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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Smart home automation systems
  • IoT devices and prototypes
  • Wireless sensor networks
  • Wearable devices
  • Robotics and control systems
  • Data logging and remote monitoring

Technical Specifications

Key Technical Details

Specification Value
Microcontroller ESP32 Dual-Core Xtensa LX6
Clock Speed Up to 240 MHz
Flash Memory 4 MB (varies by model)
SRAM 520 KB
Wi-Fi Standard 802.11 b/g/n
Bluetooth v4.2 BR/EDR and BLE
Operating Voltage 3.3V
Input Voltage (via USB) 5V
GPIO Pins Up to 30 (varies with expansion board)
ADC Channels 18
DAC Channels 2
Communication Interfaces UART, SPI, I2C, I2S, CAN, PWM
Power Modes Active, Sleep, Deep Sleep

Pin Configuration and Descriptions

Below is a typical pinout for the ESP32 with an expansion board. Note that the exact pin configuration may vary depending on the specific expansion board model.

Pin Name Description
VIN Input voltage (5V from USB or external source)
3V3 3.3V output for powering external components
GND Ground
EN Enable pin (active high to enable the ESP32)
GPIO0 General-purpose I/O, often used for boot mode
GPIO2 General-purpose I/O
GPIO4 General-purpose I/O
GPIO5 General-purpose I/O
GPIO12 General-purpose I/O
GPIO13 General-purpose I/O
GPIO14 General-purpose I/O
GPIO15 General-purpose I/O
GPIO16 General-purpose I/O
GPIO17 General-purpose I/O
TXD0 UART0 Transmit
RXD0 UART0 Receive
SDA I2C Data Line
SCL I2C Clock Line
ADC1_CH0 Analog-to-Digital Converter Channel 0
ADC1_CH1 Analog-to-Digital Converter Channel 1

Usage Instructions

How to Use the ESP32 with Expansion Board in a Circuit

  1. Powering the ESP32:

    • Connect the ESP32 to a computer or power source using a micro-USB cable.
    • Ensure the input voltage is 5V when using the VIN pin for external power.
  2. Connecting Sensors and Modules:

    • Use the GPIO pins on the expansion board to connect sensors, actuators, or other modules.
    • For analog sensors, connect them to the ADC pins (e.g., ADC1_CH0).
  3. Programming the ESP32:

    • Install the Arduino IDE and add the ESP32 board package.
    • Select the correct board and port in the Arduino IDE.
    • Write or upload your code to the ESP32 via the USB connection.
  4. Wi-Fi and Bluetooth Setup:

    • Use the built-in Wi-Fi and Bluetooth libraries to configure wireless communication.

Important Considerations and Best Practices

  • Always use a level shifter when interfacing 5V logic devices with the ESP32's 3.3V GPIO pins.
  • Avoid drawing excessive current from the 3V3 pin to prevent instability.
  • Use pull-up or pull-down resistors for GPIO pins that require stable logic levels.
  • Ensure proper grounding to avoid noise and interference in your circuit.

Example Code for Arduino IDE

Below is an example code to connect the ESP32 to a Wi-Fi network and blink an LED connected to GPIO2.

#include <WiFi.h> // Include the Wi-Fi library

// Replace with your network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";

#define LED_PIN 2 // GPIO2 is connected to the LED

void setup() {
  pinMode(LED_PIN, OUTPUT); // Set GPIO2 as an output pin
  Serial.begin(115200); // Initialize serial communication

  // Connect to Wi-Fi
  Serial.print("Connecting to Wi-Fi");
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nWi-Fi connected!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP()); // Print the ESP32's IP address
}

void loop() {
  digitalWrite(LED_PIN, HIGH); // Turn the LED on
  delay(1000); // Wait for 1 second
  digitalWrite(LED_PIN, LOW); // Turn the LED off
  delay(1000); // Wait for 1 second
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32 Not Connecting to Wi-Fi:

    • Double-check the SSID and password in your code.
    • Ensure the Wi-Fi network is active and within range.
    • Restart the ESP32 and router if necessary.
  2. Code Upload Fails:

    • Ensure the correct board and port are selected in the Arduino IDE.
    • Press and hold the "BOOT" button on the ESP32 while uploading the code.
  3. GPIO Pin Not Responding:

    • Verify the pin configuration in your code.
    • Check for loose connections or faulty components.
  4. Power Instability:

    • Use a stable 5V power source.
    • Avoid overloading the 3V3 pin with high-current devices.

FAQs

Q: Can I use the ESP32 with 5V sensors directly?
A: No, the ESP32 operates at 3.3V logic levels. Use a level shifter to interface with 5V sensors.

Q: How do I reset the ESP32?
A: Press the "EN" button on the expansion board to reset the ESP32.

Q: Can I use the ESP32 for battery-powered projects?
A: Yes, the ESP32 supports low-power modes, making it suitable for battery-powered applications.

Q: What is the maximum range of the ESP32's Wi-Fi?
A: The range depends on environmental factors but typically extends up to 50 meters indoors and 200 meters outdoors.