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 ESP, is a low-cost, low-power system on a chip (SoC) with integrated Wi-Fi and Bluetooth capabilities. It is designed for a wide range of applications, including Internet of Things (IoT) devices, smart home systems, wearable electronics, and industrial automation. The ESP32 is highly versatile, offering dual-core processing, a rich set of peripherals, and extensive connectivity options, making it a popular choice for embedded systems development.

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-Controlled OLED Display and Servo with DotStar LED Strip and Audio Output
Image of Arena 2: A project utilizing Esp32 in a practical application
This circuit features an ESP32 microcontroller driving a variety of components. It controls an OLED display for visual output, a DotStar LED strip for lighting effects, a PAM8403 audio amplifier connected to a speaker for sound output, and a PCA9685 PWM Servo Breakout to manage a servo motor. The ESP32 also interfaces with a piezo speaker for additional sound generation, and the circuit is powered by a 18650 Li-ion battery setup with a TP4056 charging module. The ESP32's embedded code handles the display animation on the OLED.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Monitoring System with Motion Detection
Image of pro: A project utilizing Esp32 in a practical application
This circuit features an ESP32 microcontroller on a baseboard that interfaces with a PIR sensor for motion detection, a DHT22 sensor for measuring temperature and humidity, and a BH1750 sensor for detecting ambient light levels. The ESP32 is configured to communicate with the BH1750 using I2C protocol, with GPIO22 and GPIO21 serving as the SCL and SDA lines, respectively. Power is supplied to the sensors from the ESP32's voltage output pins, and sensor outputs are connected to designated GPIO pins for data acquisition.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Infrared Thermometer with I2C LCD Display
Image of infrared thermometer: A project utilizing Esp32 in a practical application
This circuit features an ESP32 microcontroller powered by a 18650 Li-Ion battery, with a TP4056 module for charging the battery via a USB plug. The ESP32 reads temperature data from an MLX90614 infrared temperature sensor and displays it on an I2C LCD 16x2 screen. The ESP32, MLX90614 sensor, and LCD screen are connected via I2C communication lines (SCL, SDA), and the circuit is designed to measure and display ambient and object temperatures.
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 Arena 2: A project utilizing Esp32 in a practical application
ESP32-Controlled OLED Display and Servo with DotStar LED Strip and Audio Output
This circuit features an ESP32 microcontroller driving a variety of components. It controls an OLED display for visual output, a DotStar LED strip for lighting effects, a PAM8403 audio amplifier connected to a speaker for sound output, and a PCA9685 PWM Servo Breakout to manage a servo motor. The ESP32 also interfaces with a piezo speaker for additional sound generation, and the circuit is powered by a 18650 Li-ion battery setup with a TP4056 charging module. The ESP32's embedded code handles the display animation on the OLED.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of pro: A project utilizing Esp32 in a practical application
ESP32-Based Environmental Monitoring System with Motion Detection
This circuit features an ESP32 microcontroller on a baseboard that interfaces with a PIR sensor for motion detection, a DHT22 sensor for measuring temperature and humidity, and a BH1750 sensor for detecting ambient light levels. The ESP32 is configured to communicate with the BH1750 using I2C protocol, with GPIO22 and GPIO21 serving as the SCL and SDA lines, respectively. Power is supplied to the sensors from the ESP32's voltage output pins, and sensor outputs are connected to designated GPIO pins for data acquisition.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of infrared thermometer: A project utilizing Esp32 in a practical application
ESP32-Based Infrared Thermometer with I2C LCD Display
This circuit features an ESP32 microcontroller powered by a 18650 Li-Ion battery, with a TP4056 module for charging the battery via a USB plug. The ESP32 reads temperature data from an MLX90614 infrared temperature sensor and displays it on an I2C LCD 16x2 screen. The ESP32, MLX90614 sensor, and LCD screen are connected via I2C communication lines (SCL, SDA), and the circuit is designed to measure and display ambient and object temperatures.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT devices (e.g., smart sensors, connected appliances)
  • Home automation systems
  • Wearable electronics
  • Wireless communication modules
  • Industrial automation and monitoring
  • Robotics and drones
  • Prototyping and educational projects

Technical Specifications

The ESP32 is packed with features that make it suitable for a variety of applications. Below are its key technical specifications:

General Specifications

Parameter Value
Manufacturer ESP
Part ID ESP32
Processor Dual-core Xtensa® 32-bit LX6 microprocessor
Clock Speed Up to 240 MHz
Flash Memory 4 MB (varies by model)
SRAM 520 KB
Wireless Connectivity Wi-Fi 802.11 b/g/n, Bluetooth 4.2 (Classic and BLE)
Operating Voltage 3.0V to 3.6V
GPIO Pins Up to 34
ADC Channels 18 (12-bit resolution)
DAC Channels 2
Communication Interfaces UART, SPI, I2C, I2S, CAN, PWM
Power Consumption Ultra-low power modes available

Pin Configuration and Descriptions

The ESP32 has a flexible pinout, with multiple GPIO pins that can be configured for various functions. Below is a summary of the pin configuration:

Pin Name Functionality Description
GPIO0 Input/Output, Boot Mode Selection Used for boot mode selection during startup.
GPIO1 UART TX Default UART transmit pin.
GPIO2 Input/Output, ADC, PWM General-purpose pin with ADC and PWM support.
GPIO3 UART RX Default UART receive pin.
GPIO4 Input/Output, ADC, PWM General-purpose pin with ADC and PWM support.
GPIO5 Input/Output, ADC, PWM General-purpose pin with ADC and PWM support.
GPIO12 Input/Output, ADC, Touch Sensor Supports ADC and capacitive touch sensing.
GPIO13 Input/Output, ADC, Touch Sensor Supports ADC and capacitive touch sensing.
GPIO14 Input/Output, ADC, PWM General-purpose pin with ADC and PWM support.
GPIO15 Input/Output, ADC, PWM General-purpose pin with ADC and PWM support.
GPIO16 Input/Output General-purpose pin.
GPIO17 Input/Output General-purpose pin.

Note: The ESP32 has many more pins and features. Refer to the official datasheet for a complete pinout and detailed descriptions.

Usage Instructions

The ESP32 can be used in a variety of circuits and projects. Below are the steps and best practices for using the ESP32:

Basic Setup

  1. Power Supply: Ensure the ESP32 is powered with a stable voltage between 3.0V and 3.6V. A common setup uses a 3.3V regulator.
  2. Programming: The ESP32 can be programmed using the Arduino IDE, ESP-IDF, or other development environments. Install the necessary drivers and libraries for your chosen platform.
  3. Connections:
    • Connect the ESP32 to your computer via a USB-to-Serial adapter or a development board with built-in USB support.
    • Use GPIO pins for interfacing with sensors, actuators, and other peripherals.

Example: Blinking an LED with Arduino IDE

Below is an example of how to blink an LED connected to GPIO2 using the Arduino IDE:

// Define the GPIO pin where the LED is connected
#define LED_PIN 2

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

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

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

Important Considerations

  • Boot Mode: Ensure GPIO0 is pulled low during boot to enter programming mode.
  • Voltage Levels: The ESP32 operates at 3.3V logic levels. Avoid connecting 5V signals directly to its pins.
  • Power Consumption: Use deep sleep modes for battery-powered applications to reduce power consumption.
  • Antenna Placement: For optimal Wi-Fi and Bluetooth performance, ensure the onboard antenna is not obstructed by metal or other materials.

Troubleshooting and FAQs

Common Issues

  1. ESP32 Not Detected by Computer:

    • Ensure the correct drivers for the USB-to-Serial adapter are installed.
    • Check the USB cable for data transfer capability (some cables are power-only).
  2. Upload Fails with "Failed to Connect" Error:

    • Ensure GPIO0 is pulled low during programming.
    • Press and hold the "BOOT" button (if available) while uploading the code.
  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. Random Resets or Instability:

    • Check the power supply for stability and sufficient current (at least 500mA).
    • Avoid floating input pins; use pull-up or pull-down resistors as needed.

FAQs

Q: Can the ESP32 be powered with 5V?
A: The ESP32 itself operates at 3.3V, but many development boards include a 5V-to-3.3V regulator, allowing them to be powered with 5V.

Q: How do I use Bluetooth on the ESP32?
A: The ESP32 supports both Bluetooth Classic and BLE. Use the BluetoothSerial library for Classic Bluetooth or the BLE library for BLE in the Arduino IDE.

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

Q: Can I use the ESP32 with batteries?
A: Yes, the ESP32 is suitable for battery-powered applications. Use deep sleep modes to conserve power and ensure the battery voltage is within the supported range.

For more detailed information, refer to the official ESP32 datasheet and programming guides.