Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

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

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

Introduction

The ESP32 (30 pin) is a powerful microcontroller designed for IoT (Internet of Things) applications and embedded systems. It features built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for wireless communication projects. With its 30 GPIO pins, the ESP32 offers a wide range of input/output functions, including ADC, DAC, PWM, I2C, SPI, UART, and more. Its versatility and high performance make it a popular choice among hobbyists and professionals alike.

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 ESP32-Based Smart Display with Camera and Audio Alert System: 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.

Open Project in Cirkit Designer
Image of ESP32-Based Environmental Monitoring System with Water Flow Sensing: 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.

Open Project in Cirkit Designer
Image of ESP32-Based OLED Display Interface: 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.

Open Project in Cirkit Designer
Image of ESP32-Based Environmental Monitoring System with OLED Display: 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.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

The ESP32 (30 pin) microcontroller is packed with features that make it suitable for a variety of applications. Below are its key technical details:

Key Technical Details

Pin Configuration and Descriptions

The ESP32 (30 pin) has a total of 30 pins, each with specific functions. 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.
IO0 GPIO0 / Boot Mode General-purpose I/O pin. Used for boot mode selection during programming.
IO2 GPIO2 General-purpose I/O pin.
IO4 GPIO4 General-purpose I/O pin.
IO5 GPIO5 General-purpose I/O pin.
IO12 GPIO12 / ADC / Touch General-purpose I/O pin with ADC and touch capabilities.
IO13 GPIO13 / ADC / Touch General-purpose I/O pin with ADC and touch capabilities.
IO14 GPIO14 / ADC / Touch General-purpose I/O pin with ADC and touch capabilities.
IO15 GPIO15 / ADC / Touch General-purpose I/O pin with ADC and touch capabilities.
IO16 GPIO16 General-purpose I/O pin.
IO17 GPIO17 General-purpose I/O pin.
IO18 GPIO18 / SPI_CLK General-purpose I/O pin or SPI clock pin.
IO19 GPIO19 / SPI_MISO General-purpose I/O pin or SPI MISO pin.
IO21 GPIO21 / I2C_SDA General-purpose I/O pin or I2C data pin.
IO22 GPIO22 / I2C_SCL General-purpose I/O pin or I2C clock pin.
IO23 GPIO23 / SPI_MOSI General-purpose I/O pin or SPI MOSI pin.
IO25 GPIO25 / DAC1 General-purpose I/O pin or DAC output.
IO26 GPIO26 / DAC2 General-purpose I/O pin or DAC output.
IO27 GPIO27 General-purpose I/O pin.
IO32 GPIO32 / ADC / Touch General-purpose I/O pin with ADC and touch capabilities.
IO33 GPIO33 / ADC / Touch General-purpose I/O pin with ADC and touch capabilities.
IO34 GPIO34 / ADC Input-only pin with ADC capabilities.
IO35 GPIO35 / ADC Input-only pin with ADC capabilities.
RX0 UART0_RX UART0 receive pin.
TX0 UART0_TX UART0 transmit pin.
RST Reset Resets the microcontroller.

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 cable to the micro-USB port.
    • Ensure the GND pin is connected to the ground of your circuit.
  2. 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 USB.
    • Select the correct board and port in the Arduino IDE.
    • Write and upload your code.
  3. Connecting Peripherals:

    • Use GPIO pins for digital input/output.
    • Use ADC pins for analog input (e.g., sensors).
    • Use I2C, SPI, or UART pins for communication with other devices.

Example Code for Arduino IDE

The following example demonstrates how to blink an LED connected to GPIO2:

// Define the LED pin
const int ledPin = 2;

void setup() {
  // Set the LED pin as an output
  pinMode(ledPin, OUTPUT);
}

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

  // Turn the LED off
  digitalWrite(ledPin, LOW);
  delay(1000); // Wait for 1 second
}

Important Considerations

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32 Not Detected by Computer:

    • Ensure the correct USB driver is installed (e.g., CP210x or CH340 driver).
    • Check the USB cable for data transfer capability (some cables are power-only).
  2. Upload Fails with "Timed Out" Error:

    • Press and hold the "BOOT" button on the ESP32 while uploading the code.
    • 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.
    • Check for interference or weak signal strength.
  4. Random Resets or Instability:

    • Ensure a stable power supply.
    • Add capacitors to the power lines to filter noise.

FAQs

Q: Can I power the ESP32 with a 5V power bank?
A: Yes, you can power the ESP32 via the USB port using a 5V power bank.

Q: How many devices can the ESP32 connect to via Bluetooth?
A: The ESP32 supports up to 7 simultaneous Bluetooth connections in BLE mode.

Q: Can I use the ESP32 with a 5V sensor?
A: Yes, but you need a level shifter to convert the 5V signal to 3.3V.

Q: What is the maximum range of the ESP32's Wi-Fi?
A: The range depends on the environment but typically extends up to 100 meters in open space.