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

  • Home automation systems
  • Wearable devices
  • Industrial IoT solutions
  • Wireless sensor networks
  • Robotics and automation
  • Smart agriculture systems

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 Consumption (Active) ~160 mA
Power Consumption (Deep Sleep) ~10 µA

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 Pin Number Description
VIN 1 Input voltage (5V from USB or external power)
GND 2 Ground
3V3 3 3.3V output for powering external components
EN 4 Enable pin (active high)
GPIO0 5 General-purpose I/O, boot mode selection
GPIO2 6 General-purpose I/O
GPIO4 7 General-purpose I/O
GPIO5 8 General-purpose I/O
GPIO12 9 General-purpose I/O
GPIO13 10 General-purpose I/O
GPIO14 11 General-purpose I/O
GPIO15 12 General-purpose I/O
TXD0 13 UART0 Transmit
RXD0 14 UART0 Receive
SDA 15 I2C Data Line
SCL 16 I2C Clock Line

Usage Instructions

How to Use the ESP32 with Expansion Board in a Circuit

  1. Powering the ESP32:

    • Connect the ESP32 to a computer or USB power source using a micro-USB cable.
    • Alternatively, supply 5V to the VIN pin and connect GND to the ground.
  2. Programming the ESP32:

    • Install the Arduino IDE and add the ESP32 board package via the Board Manager.
    • Select the appropriate ESP32 board from the Tools menu.
    • Connect the ESP32 to your computer and upload your code.
  3. Connecting Sensors and Modules:

    • Use the GPIO pins on the expansion board to connect sensors, actuators, or other modules.
    • Ensure that the voltage levels of connected devices are compatible with the ESP32 (3.3V logic).
  4. Wi-Fi and Bluetooth Setup:

    • Use the built-in Wi-Fi and Bluetooth libraries to configure wireless communication.
    • For Wi-Fi, connect to a network using the WiFi library.
    • For Bluetooth, use the BluetoothSerial library for serial communication.

Important Considerations and Best Practices

  • Voltage Levels: The ESP32 operates at 3.3V logic. Avoid connecting 5V signals directly to GPIO pins without level shifters.
  • Power Supply: Ensure a stable power supply to avoid unexpected resets or instability.
  • Deep Sleep Mode: Use deep sleep mode to conserve power in battery-powered applications.
  • Boot Mode: GPIO0 must be pulled low during boot to enter programming mode.
  • Pin Multiplexing: Some pins have multiple functions (e.g., ADC, PWM). Check the datasheet to avoid conflicts.

Example Code for Arduino UNO Integration

Below is an example of using the ESP32 to read a temperature sensor and send data over Wi-Fi:

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

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

void setup() {
  Serial.begin(115200); // Initialize serial communication
  WiFi.begin(ssid, password); // Connect to Wi-Fi network

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to Wi-Fi...");
  }
  Serial.println("Connected to Wi-Fi");
}

void loop() {
  // Example: Read a sensor value (replace with actual sensor code)
  int sensorValue = analogRead(34); // Read from GPIO34 (ADC1 channel 6)
  Serial.print("Sensor Value: ");
  Serial.println(sensorValue);

  delay(1000); // Wait for 1 second before reading again
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32 Not Connecting to Wi-Fi:

    • Ensure the SSID and password are correct.
    • Check if the Wi-Fi network is within range.
    • Restart the ESP32 and router if necessary.
  2. Upload Fails or Timeout Errors:

    • Ensure the correct board and COM port are selected in the Arduino IDE.
    • Hold the BOOT button on the ESP32 while uploading the code.
  3. Unstable Operation or Random Resets:

    • Verify that the power supply provides sufficient current (at least 500 mA).
    • Check for loose connections or short circuits.
  4. GPIO Pin Not Working:

    • Confirm that the pin is not being used for another function (e.g., ADC, UART).
    • Avoid using reserved pins (e.g., GPIO6-GPIO11 are used for flash memory).

FAQs

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

Q: How do I reset the ESP32?
A: Press the RESET button on the expansion board or power cycle the device.

Q: Can I use the ESP32 with a battery?
A: Yes, you can power the ESP32 using a LiPo battery connected to the VIN and GND pins. Ensure the battery voltage is within the acceptable range.

Q: How do I enable deep sleep mode?
A: Use the esp_deep_sleep_start() function in your code to put the ESP32 into deep sleep mode.

This concludes the documentation for the ESP32 with Expansion Board.