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

How to Use ESP32: Examples, Pinouts, and Specs

Image of ESP32
Cirkit Designer LogoDesign with ESP32 in Cirkit Designer

Introduction

The ESP32, manufactured by Espressif Systems (Shanghai) Co., Ltd, is a powerful and versatile microcontroller designed for IoT applications and embedded systems. With integrated Wi-Fi and Bluetooth capabilities, the ESP32 offers a cost-effective solution for projects requiring wireless communication. Its dual-core processor, extensive GPIO options, and support for various communication protocols make it a popular choice among hobbyists and professionals alike.

Explore Projects Built with ESP32

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 Sensor Monitoring System with OLED Display and E-Stop
Image of MVP_design: A project utilizing ESP32 in a practical application
This circuit features an ESP32 microcontroller that interfaces with a variety of sensors and output devices. It is powered by a Lipo battery through a buck converter, ensuring a stable voltage supply. The ESP32 collects data from a DHT11 temperature and humidity sensor and a vibration sensor, controls a buzzer, and displays information on an OLED screen. An emergency stop (E Stop) is connected for safety purposes, allowing the system to be quickly deactivated.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based NTP Clock with DHT22 Temperature Sensor and WS2812 LED Matrix Display
Image of date time and temperature display : A project utilizing ESP32 in a practical application
This circuit features an ESP32 Devkit V1 microcontroller connected to a DHT22 temperature and humidity sensor and an 8x8 WS2812 RGB LED matrix. The ESP32 reads temperature data from the DHT22 sensor and displays the current date, time, and temperature on the LED matrix, with date and time synchronized via NTP (Network Time Protocol). The ESP32 provides power to both the DHT22 and the LED matrix and communicates with the DHT22 via GPIO 4 and with the LED matrix via GPIO 5.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Monitoring System with Water Flow Sensing
Image of Water: A project utilizing ESP32 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 Smart Weather Station with Wi-Fi Connectivity
Image of flowchart 3D: A project utilizing ESP32 in a practical application
This circuit features an ESP32 microcontroller interfacing with various sensors and modules, including a DHT22 temperature and humidity sensor, an ESP32 CAM for image capture, an I2C LCD screen for display, a load cell with an HX711 interface for weight measurement, and a buzzer for audio alerts. The ESP32 handles data acquisition, processing, and communication with these peripherals to create a multi-functional monitoring and alert system.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ESP32

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 MVP_design: A project utilizing ESP32 in a practical application
ESP32-Based Sensor Monitoring System with OLED Display and E-Stop
This circuit features an ESP32 microcontroller that interfaces with a variety of sensors and output devices. It is powered by a Lipo battery through a buck converter, ensuring a stable voltage supply. The ESP32 collects data from a DHT11 temperature and humidity sensor and a vibration sensor, controls a buzzer, and displays information on an OLED screen. An emergency stop (E Stop) is connected for safety purposes, allowing the system to be quickly deactivated.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of date time and temperature display : A project utilizing ESP32 in a practical application
ESP32-Based NTP Clock with DHT22 Temperature Sensor and WS2812 LED Matrix Display
This circuit features an ESP32 Devkit V1 microcontroller connected to a DHT22 temperature and humidity sensor and an 8x8 WS2812 RGB LED matrix. The ESP32 reads temperature data from the DHT22 sensor and displays the current date, time, and temperature on the LED matrix, with date and time synchronized via NTP (Network Time Protocol). The ESP32 provides power to both the DHT22 and the LED matrix and communicates with the DHT22 via GPIO 4 and with the LED matrix via GPIO 5.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Water: A project utilizing ESP32 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 flowchart 3D: A project utilizing ESP32 in a practical application
ESP32-Based Smart Weather Station with Wi-Fi Connectivity
This circuit features an ESP32 microcontroller interfacing with various sensors and modules, including a DHT22 temperature and humidity sensor, an ESP32 CAM for image capture, an I2C LCD screen for display, a load cell with an HX711 interface for weight measurement, and a buzzer for audio alerts. The ESP32 handles data acquisition, processing, and communication with these peripherals to create a multi-functional monitoring and alert system.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT devices and smart home automation
  • Wireless sensor networks
  • Wearable electronics
  • Industrial automation
  • Robotics and drones
  • Real-time data monitoring and logging

Technical Specifications

The ESP32 DEVKITV1 is a development board based on the ESP32 microcontroller. Below are its key technical details:

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 (VIN) 5V (via USB or external power supply)
GPIO Pins 30+
ADC Channels 18 (12-bit resolution)
DAC Channels 2
Communication Interfaces UART, SPI, I2C, I2S, CAN, PWM
Power Consumption Ultra-low power (varies by mode)
Dimensions 25.4 mm x 50.8 mm

Pin Configuration and Descriptions

The ESP32 DEVKITV1 has a total of 38 pins. Below is a summary of the pin configuration:

Pin Number Pin Name Description
1-3 GND Ground
4 VIN Input voltage (5V)
5-6 3V3 3.3V output
7-22 GPIO0-GPIO39 General-purpose input/output pins
23-24 ADC1/ADC2 Analog-to-digital converter channels
25-26 DAC1/DAC2 Digital-to-analog converter channels
27 EN Enable pin (active high)
28 IO0 Boot mode selection pin
29-30 TX/RX UART communication pins
31-32 SCL/SDA I2C clock and data lines
33-34 MOSI/MISO SPI data lines
35 SCK SPI clock line
36-38 NC Not connected

Usage Instructions

How to Use the ESP32 in a Circuit

  1. Powering the ESP32:

    • Connect the VIN pin to a 5V power source or use the micro-USB port for power and programming.
    • Ensure the GND pin is connected to the ground of your circuit.
  2. Programming the ESP32:

    • Install the Arduino IDE and add the ESP32 board support package.
    • Connect the ESP32 to your computer via a USB cable.
    • Select the correct board (ESP32 Dev Module) and COM port in the Arduino IDE.
  3. Connecting Peripherals:

    • Use GPIO pins for digital input/output.
    • Use ADC pins for analog input and DAC pins for analog output.
    • Connect communication peripherals (e.g., sensors, displays) to the appropriate UART, SPI, or I2C pins.

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 boot to enter programming mode.
  • Power Supply: Use a stable power source to avoid unexpected resets or malfunctions.
  • Wi-Fi and Bluetooth: Avoid placing the ESP32 near metal objects or enclosures that may interfere with wireless signals.

Example Code for Arduino IDE

Below is an example code to connect the ESP32 to a Wi-Fi network and print the IP address:

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

const char* ssid = "Your_SSID";       // Replace with your Wi-Fi SSID
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 the serial monitor

  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
}

Troubleshooting and FAQs

Common Issues and Solutions

  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.
  2. Wi-Fi Connection Fails:

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

    • Verify the power supply is stable and capable of providing sufficient current.
    • Avoid using GPIO pins connected to peripherals during boot.
  4. Code Upload Fails:

    • Ensure GPIO0 is pulled low during programming.
    • Press and hold the "BOOT" button while uploading the code.

FAQs

Q: Can the ESP32 operate on battery power?
A: Yes, the ESP32 can be powered by a LiPo battery connected to the VIN pin. Ensure the battery voltage is within the acceptable range (typically 3.7V to 4.2V).

Q: How do I reset the ESP32?
A: Press the "EN" button on the development board to reset the ESP32.

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 of the ESP32.

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

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