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, low-cost microcontroller with built-in Wi-Fi and Bluetooth capabilities. It features 30 pins for various input/output (I/O) functions, making it an excellent choice for Internet of Things (IoT) applications, smart devices, and embedded systems. Its dual-core processor, extensive GPIO options, and support for multiple communication protocols make it versatile for a wide range of projects.

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 (e.g., smart home systems, sensors, and actuators)
  • Wireless communication (Wi-Fi and Bluetooth-enabled projects)
  • Data logging and monitoring systems
  • Robotics and automation
  • Wearable devices
  • Prototyping and development of embedded systems

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 7-12V (via VIN pin)
  • GPIO Pins: 30 pins (including ADC, DAC, PWM, I2C, SPI, UART)
  • ADC Resolution: 12-bit
  • DAC Resolution: 8-bit
  • Power Consumption: Ultra-low power consumption in deep sleep mode (~10 µA)

Pin Configuration and Descriptions

The ESP32 (30 pin) has a variety of pins for power, communication, and I/O. Below is a table summarizing the pin configuration:

Pin Name Function Description
VIN Power Input Input voltage (7-12V) for powering the ESP32.
GND Ground Ground connection.
3V3 Power Output Provides 3.3V output for external components.
EN Enable Enables or disables the chip (active high).
GPIO0 I/O, Boot Mode Selection General-purpose I/O, also used for boot mode selection during programming.
GPIO1 (TX0) UART TX UART0 transmit pin.
GPIO3 (RX0) UART RX UART0 receive pin.
GPIO2 I/O, ADC, PWM General-purpose I/O, ADC, or PWM output.
GPIO4 I/O, ADC, PWM General-purpose I/O, ADC, or PWM output.
GPIO5 I/O, ADC, PWM General-purpose I/O, ADC, or PWM output.
GPIO12-15 I/O, ADC, PWM, Touch General-purpose I/O, ADC, PWM, or capacitive touch input.
GPIO16-19 I/O, SPI, ADC, PWM General-purpose I/O, SPI communication, ADC, or PWM output.
GPIO21-23 I/O, I2C, ADC, PWM General-purpose I/O, I2C communication, ADC, or PWM output.
GPIO25-27 I/O, ADC, DAC, PWM General-purpose I/O, ADC, DAC, or PWM output.
GPIO32-39 I/O, ADC, Touch General-purpose I/O, ADC, or capacitive touch input.
TX2/RX2 UART TX/RX UART2 transmit and receive pins.
BOOT Boot Mode Selection Used to enter bootloader mode for programming.

Note: Some GPIO pins have specific restrictions or are reserved for internal functions. Refer to the ESP32 datasheet for detailed pin behavior.

Usage Instructions

How to Use the ESP32 in a Circuit

  1. Powering the ESP32:

    • Use the VIN pin to supply 7-12V or connect a 5V USB power source.
    • Ensure the 3.3V pin is used only for low-power external components.
  2. Connecting Peripherals:

    • Use GPIO pins for connecting sensors, actuators, or other peripherals.
    • Configure pins as input or output in your code as needed.
  3. Programming the ESP32:

    • Install the ESP32 board package in the Arduino IDE or use the ESP-IDF framework.
    • Connect the ESP32 to your computer via a USB cable.
    • Select the correct board and port in the IDE, then upload your code.
  4. Wi-Fi and Bluetooth Setup:

    • Use the built-in libraries (WiFi.h and BluetoothSerial.h) 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 bootloader mode.
  • Power Supply: Use a stable power source to avoid unexpected resets or instability.
  • Deep Sleep Mode: Utilize deep sleep mode for battery-powered applications to conserve energy.

Example Code for Arduino UNO Integration

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

#include <WiFi.h> // Include the WiFi library

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

void setup() {
  Serial.begin(115200); // Initialize serial communication
  delay(1000);

  // 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() {
  // Add your main code here
}

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

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32 Not Connecting to Wi-Fi:

    • Double-check the SSID and password.
    • Ensure the router is within range and supports 2.4 GHz (ESP32 does not support 5 GHz).
  2. Upload Fails in Arduino IDE:

    • Ensure the correct board and port are selected in the IDE.
    • Hold the BOOT button while uploading to enter bootloader mode.
  3. Unstable Operation or Random Resets:

    • Verify the power supply is stable and provides sufficient current (at least 500 mA).
    • Avoid using GPIO pins reserved for internal functions.
  4. GPIO Pin Not Working as Expected:

    • Check if the pin is reserved or has specific restrictions.
    • Ensure the pin is configured correctly in your code.

FAQs

  • Can the ESP32 operate on battery power? Yes, the ESP32 can be powered by a battery. Use deep sleep mode to extend battery life.

  • Does the ESP32 support Over-the-Air (OTA) updates? Yes, the ESP32 supports OTA updates, allowing you to upload new firmware wirelessly.

  • Can I use the ESP32 with 5V logic devices? No, the ESP32 operates at 3.3V logic levels. Use a level shifter if interfacing with 5V devices.

  • How do I reset the ESP32? Press the EN (enable) button to reset the ESP32.

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