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 and versatile microcontroller that integrates Wi-Fi and Bluetooth capabilities, making it an excellent choice for Internet of Things (IoT) applications. It features a dual-core processor, a wide range of GPIO pins, and support for various communication protocols. The addition of an expansion board enhances the ESP32's functionality by providing extra GPIO pins, improved power management, and additional connectivity options, making it easier to prototype and develop complex projects.

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 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 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 Input Control Interface with Joystick, Touch, and Reed Switches
Image of UI: A project utilizing esp32 with expansion board in a practical application
This circuit is designed to interface an ESP32 microcontroller with various input devices for sensing and control, including a joystick, potentiometer, capacitive touch sensors, reed switches, and push buttons, with additional GPIOs provided by an MCP23017 IO expander. It is set up for diverse input methods and is powered by a 3.3V supply, with the ESP32's code currently serving as a placeholder for further development.
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 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 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 UI: A project utilizing esp32 with expansion board in a practical application
ESP32-Based Input Control Interface with Joystick, Touch, and Reed Switches
This circuit is designed to interface an ESP32 microcontroller with various input devices for sensing and control, including a joystick, potentiometer, capacitive touch sensors, reed switches, and push buttons, with additional GPIOs provided by an MCP23017 IO expander. It is set up for diverse input methods and is powered by a 3.3V supply, with the ESP32's code currently serving as a placeholder for further development.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT devices and smart home automation
  • Wireless sensor networks
  • Robotics and automation systems
  • Wearable technology
  • Data logging and remote monitoring
  • Prototyping and educational projects

Technical Specifications

Key Technical Details

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

Pin Configuration and Descriptions

The ESP32 with an expansion board typically includes the following pin layout. Note that the exact 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
A0-A17 Analog input pins (ADC channels)
DAC1 Digital-to-Analog Converter Channel 1
DAC2 Digital-to-Analog Converter Channel 2

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the ESP32: Connect the ESP32 to a 5V power source via the USB port or the VIN pin. The expansion board will regulate the voltage to 3.3V for the ESP32.
  2. Connecting Peripherals: Use the GPIO pins on the expansion board to connect sensors, actuators, or other peripherals. Ensure that the voltage levels of connected devices are compatible with the 3.3V logic of the ESP32.
  3. Programming the ESP32:
    • Install the Arduino IDE and add the ESP32 board package.
    • Connect the ESP32 to your computer via USB.
    • Select the appropriate board and port in the Arduino IDE.
    • Write and upload your code to the ESP32.

Important Considerations and Best Practices

  • Voltage Levels: The ESP32 operates at 3.3V logic. Avoid connecting 5V signals directly to its GPIO pins to prevent damage.
  • Boot Mode: GPIO0 is used for boot mode selection. Ensure it is not pulled low during normal operation unless you intend to enter bootloader mode.
  • Power Supply: Use a stable power source to avoid unexpected resets or instability.
  • Wi-Fi and Bluetooth Interference: Place the ESP32 away from sources of electromagnetic interference to ensure reliable wireless communication.

Example Code for Arduino UNO Integration

The following example demonstrates how to use the ESP32 to read data from a DHT11 temperature and humidity sensor and send the data to a serial monitor.

#include <WiFi.h>
#include <DHT.h>

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

DHT dht(DHTPIN, DHTTYPE);

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

void loop() {
  // Read temperature and humidity from the DHT sensor
  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature();

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

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

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

Troubleshooting and FAQs

Common Issues Users Might Face

  1. ESP32 Not Detected by Computer:

    • Ensure the USB cable is functional and supports data transfer.
    • Install the correct USB-to-serial driver for your operating system.
    • Verify that the correct port is selected in the Arduino IDE.
  2. Upload Fails or Timeout Errors:

    • Check that the ESP32 is in bootloader mode by holding the BOOT button while uploading.
    • Ensure the correct board and port are selected in the Arduino IDE.
  3. Wi-Fi Connection Issues:

    • Verify the SSID and password in your code.
    • Ensure the Wi-Fi network is within range and not using unsupported security protocols.
  4. Unstable Operation or Random Resets:

    • Use a stable and sufficient power source.
    • Avoid connecting high-current devices directly to the ESP32's GPIO pins.

Solutions and Tips for Troubleshooting

  • Debugging: Use the serial monitor to print debug messages and identify issues in your code.
  • Resetting the ESP32: Press the RESET button on the expansion board to restart the microcontroller.
  • Testing Peripherals: Test each peripheral individually to isolate issues in complex circuits.
  • Firmware Updates: Ensure the ESP32 has the latest firmware to avoid compatibility issues.

By following this documentation, you can effectively utilize the ESP32 with an expansion board for a wide range of projects and applications.