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

How to Use ESP32 (30 pin): Examples, Pinouts, and Specs

Image of ESP32 (30 pin)
Cirkit Designer LogoDesign with ESP32 (30 pin) in Cirkit Designer

Introduction

The ESP32 is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for Internet of Things (IoT) applications and embedded systems. With its 30-pin configuration, the ESP32 offers a wide range of input/output (I/O) options, enabling developers to connect sensors, actuators, and other peripherals with ease. Its dual-core processor and low-power consumption make it suitable for both high-performance and energy-efficient applications.

Explore Projects Built with ESP32 (30 pin)

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 Display with Camera and Audio Alert System
Image of cam_circuit_design: A project utilizing ESP32 (30 pin) in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Monitoring System with Water Flow Sensing
Image of Water: A project utilizing ESP32 (30 pin) in a practical application
This circuit features an ESP32 Devkit V1 microcontroller connected to a DHT22 temperature and humidity sensor and a water flow sensor. The ESP32 reads environmental data from the DHT22 via a digital input pin (D33) and monitors water flow through the water flow sensor connected to another digital input pin (D23). The ESP32 is powered through its VIN pin, and both sensors are powered by the ESP32's 3V3 output, with common ground connections.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based OLED Display Interface
Image of d: A project utilizing ESP32 (30 pin) in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Monitoring System with OLED Display
Image of esproj: A project utilizing ESP32 (30 pin) in a practical application
This circuit features an ESP32 microcontroller as the central processing unit, interfacing with a DHT11 temperature and humidity sensor, an MPU-6050 accelerometer and gyroscope, an OLED display, and a separate temperature sensor. The ESP32 communicates with the MPU-6050 and the OLED display via I2C (using pins D22 and D21 for SCL and SDA, respectively), reads temperature data from the DHT11 sensor through pin D18, and interfaces with the additional temperature sensor via pin D5. All components share a common power supply connected to the ESP32's Vin pin and a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ESP32 (30 pin)

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 cam_circuit_design: A project utilizing ESP32 (30 pin) 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Water: A project utilizing ESP32 (30 pin) in a practical application
ESP32-Based Environmental Monitoring System with Water Flow Sensing
This circuit features an ESP32 Devkit V1 microcontroller connected to a DHT22 temperature and humidity sensor and a water flow sensor. The ESP32 reads environmental data from the DHT22 via a digital input pin (D33) and monitors water flow through the water flow sensor connected to another digital input pin (D23). The ESP32 is powered through its VIN pin, and both sensors are powered by the ESP32's 3V3 output, with common ground connections.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of d: A project utilizing ESP32 (30 pin) 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of esproj: A project utilizing ESP32 (30 pin) in a practical application
ESP32-Based Environmental Monitoring System with OLED Display
This circuit features an ESP32 microcontroller as the central processing unit, interfacing with a DHT11 temperature and humidity sensor, an MPU-6050 accelerometer and gyroscope, an OLED display, and a separate temperature sensor. The ESP32 communicates with the MPU-6050 and the OLED display via I2C (using pins D22 and D21 for SCL and SDA, respectively), reads temperature data from the DHT11 sensor through pin D18, and interfaces with the additional temperature sensor via pin D5. All components share a common power supply connected to the ESP32's Vin pin and a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT devices and smart home automation
  • Wireless sensor networks
  • Wearable technology
  • Robotics and drones
  • Industrial automation
  • Prototyping and educational projects

Technical Specifications

Key Technical Details

  • Microcontroller: Tensilica Xtensa LX6 dual-core processor
  • Clock Speed: Up to 240 MHz
  • Flash Memory: 4 MB (varies by model)
  • SRAM: 520 KB
  • Wi-Fi: 802.11 b/g/n
  • Bluetooth: v4.2 BR/EDR and BLE
  • Operating Voltage: 3.3V
  • Input Voltage Range: 5V (via USB) or 3.3V (via VIN pin)
  • GPIO Pins: 30 pins (multipurpose)
  • ADC Channels: 18 (12-bit resolution)
  • DAC Channels: 2 (8-bit resolution)
  • PWM Channels: Multiple (configurable)
  • Communication Protocols: UART, SPI, I2C, I2S, CAN
  • Power Consumption: Ultra-low power modes available
  • Operating Temperature: -40°C to 125°C

Pin Configuration and Descriptions

The ESP32 (30-pin) has a versatile pinout. Below is a table summarizing the key pins and their functions:

Pin Name Function Description
VIN Power Input Accepts 5V input to power the ESP32.
GND Ground Common ground for the circuit.
3V3 Power Output Provides 3.3V output for external components.
EN Enable Enables or disables the chip (active high).
GPIO0 General Purpose I/O, Boot Mode Used for boot mode selection during programming.
GPIO1 (TX0) UART TX UART transmit pin (used for serial communication).
GPIO3 (RX0) UART RX UART receive pin (used for serial communication).
GPIO2 General Purpose I/O, ADC, PWM Multipurpose pin with ADC and PWM capabilities.
GPIO4 General Purpose I/O, ADC, PWM Multipurpose pin with ADC and PWM capabilities.
GPIO5 General Purpose I/O, ADC, PWM Multipurpose pin with ADC and PWM capabilities.
GPIO12-15 General Purpose I/O, ADC, PWM Multipurpose pins with ADC and PWM capabilities.
GPIO16-19 General Purpose I/O, I2C, SPI Multipurpose pins supporting I2C and SPI communication.
GPIO21-23 General Purpose I/O, I2C, SPI Multipurpose pins supporting I2C and SPI communication.
GPIO25-27 General Purpose I/O, ADC, DAC, PWM Multipurpose pins with ADC, DAC, and PWM capabilities.
GPIO32-39 General Purpose I/O, ADC, Touch Multipurpose pins with ADC and capacitive touch sensing capabilities.
TX2/RX2 UART TX/RX Additional UART communication pins.
BOOT Boot Mode Selection Used for flashing firmware (connect to GND during programming).

Note: Some pins have multiple functions. Refer to the ESP32 datasheet for detailed pin multiplexing information.

Usage Instructions

How to Use the ESP32 in a Circuit

  1. Powering the ESP32:

    • Use the VIN pin to supply 5V or connect a 3.3V regulated power source to the 3V3 pin.
    • Ensure a common ground connection between the ESP32 and other components in the circuit.
  2. Programming the ESP32:

    • Connect the ESP32 to your computer via a USB cable.
    • Install the necessary drivers (e.g., CP2102 or CH340, depending on your ESP32 model).
    • Use the Arduino IDE or ESP-IDF (Espressif IoT Development Framework) for programming.
    • Select the correct board (e.g., "ESP32 Dev Module") and COM port in the IDE.
  3. Connecting Peripherals:

    • Use GPIO pins to interface with sensors, actuators, and other devices.
    • For analog inputs, connect sensors to ADC-capable pins (e.g., GPIO32-39).
    • For PWM outputs, use GPIO pins configured for PWM (e.g., GPIO2, GPIO4).
  4. Wi-Fi and Bluetooth Setup:

    • Use the built-in Wi-Fi and Bluetooth libraries in the Arduino IDE or ESP-IDF to configure wireless communication.

Important Considerations and Best Practices

  • Voltage Levels: The ESP32 operates at 3.3V logic levels. Avoid connecting 5V signals directly to GPIO pins.
  • Boot Mode: Ensure GPIO0 is pulled low during programming to enter boot mode.
  • Power Supply: Use a stable power source to avoid unexpected resets or instability.
  • Pin Multiplexing: Be mindful of pin multiplexing when using peripherals like UART, SPI, or I2C.

Example Code for Arduino UNO Integration

Below is an example of using the ESP32 to connect to a Wi-Fi network:

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

const char* ssid = "Your_SSID";       // Replace with your Wi-Fi network name
const char* password = "Your_Password"; // Replace with your Wi-Fi password

void setup() {
  Serial.begin(115200); // Initialize serial communication at 115200 baud
  delay(1000);          // Wait for a second to stabilize

  Serial.println("Connecting to Wi-Fi...");
  WiFi.begin(ssid, password); // Start Wi-Fi connection

  while (WiFi.status() != WL_CONNECTED) {
    delay(500); // Wait for connection
    Serial.print(".");
  }

  Serial.println("\nWi-Fi connected!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP()); // Print the assigned IP address
}

void loop() {
  // Add your main code here
}

Note: Replace Your_SSID and Your_Password with your Wi-Fi credentials.

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32 Not Detected by Computer:

    • Ensure the correct USB driver (e.g., CP2102 or CH340) is installed.
    • Try a different USB cable or port.
  2. Wi-Fi Connection Fails:

    • Double-check the SSID and password.
    • Ensure the Wi-Fi network is within range.
  3. Random Resets or Instability:

    • Verify the power supply is stable and sufficient (at least 500mA).
    • Avoid using GPIO pins connected to peripherals during boot.
  4. GPIO Pin Not Working:

    • Check if the pin is being used for another function (e.g., UART, SPI).
    • Refer to the ESP32 datasheet for pin multiplexing details.

FAQs

  • Q: Can the ESP32 handle multiple tasks simultaneously?

    • A: Yes, the ESP32's dual-core processor allows for multitasking using FreeRTOS.
  • Q: How do I update the ESP32 firmware?

    • A: Use the ESP-IDF or Arduino IDE to flash new firmware via USB.
  • Q: Can I use the ESP32 with 5V sensors?

    • A: Use a level shifter to safely interface 5V sensors with the 3.3V GPIO pins.
  • Q: What is the maximum Wi-Fi range of the ESP32?

    • A: The range depends on the environment but typically extends up to 100 meters in open space.

This documentation provides a comprehensive guide to using the ESP32 (30-pin) microcontroller effectively. For more advanced features, refer to the official Espressif documentation.