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-WROOM-32D, manufactured by Espressif, is a powerful microcontroller module that integrates both Wi-Fi and Bluetooth capabilities. It is widely used in Internet of Things (IoT) applications, smart devices, and projects requiring wireless communication. The ESP32 is known for its high performance, low power consumption, and versatility, making it a popular choice for developers and hobbyists 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
  • Prototyping and educational projects

Technical Specifications

The ESP32-WROOM-32D is built around the ESP32-D0WDQ6 chip and offers a range of features suitable for various applications.

Key Technical Details

Parameter Value
Manufacturer Espressif
Part ID ESP32-WROOM-32D
Microcontroller Core Dual-core Xtensa® 32-bit LX6
Clock Speed Up to 240 MHz
Flash Memory 4 MB (external SPI flash)
SRAM 520 KB
Wireless Connectivity Wi-Fi 802.11 b/g/n, Bluetooth v4.2 BR/EDR
Operating Voltage 3.0V to 3.6V
GPIO Pins 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
Operating Temperature -40°C to +85°C

Pin Configuration and Descriptions

The ESP32-WROOM-32D has 38 pins. Below is a summary of the key pins and their functions:

Pin Number Name Function Description
1 EN Enable pin. Active high to enable the chip.
2 IO0 GPIO0, used for boot mode selection.
3 IO2 GPIO2, general-purpose I/O.
4 IO4 GPIO4, general-purpose I/O.
5 IO5 GPIO5, general-purpose I/O.
6-11 N/A Reserved for internal flash memory.
12 IO12 GPIO12, ADC2 channel 5, touch sensor.
13 IO13 GPIO13, ADC2 channel 4, touch sensor.
14 IO14 GPIO14, ADC2 channel 6, touch sensor.
15 IO15 GPIO15, ADC2 channel 3, touch sensor.
16 IO16 GPIO16, general-purpose I/O.
17 IO17 GPIO17, general-purpose I/O.
18 IO18 GPIO18, SPI clock (SCK).
19 IO19 GPIO19, SPI MISO.
21 IO21 GPIO21, I2C SDA.
22 IO22 GPIO22, I2C SCL.
23 IO23 GPIO23, SPI MOSI.
25 IO25 GPIO25, DAC1, ADC2 channel 8.
26 IO26 GPIO26, DAC2, ADC2 channel 9.
27 IO27 GPIO27, ADC2 channel 7.
32 IO32 GPIO32, ADC1 channel 4, touch sensor.
33 IO33 GPIO33, ADC1 channel 5, touch sensor.
34 IO34 GPIO34, ADC1 channel 6 (input only).
35 IO35 GPIO35, ADC1 channel 7 (input only).
36 IO36 GPIO36, ADC1 channel 0 (input only).
39 IO39 GPIO39, ADC1 channel 3 (input only).

Usage Instructions

The ESP32 can be programmed using the Arduino IDE, Espressif's ESP-IDF, or other development environments. Below are the steps to use the ESP32 in a basic circuit and program it.

Basic Circuit Setup

  1. Power Supply: Connect the ESP32 to a 3.3V power source. Avoid exceeding 3.6V to prevent damage.
  2. Boot Mode: To upload code, connect GPIO0 to GND and press the EN (reset) button.
  3. USB Connection: Use a USB-to-serial adapter to connect the ESP32 to your computer.
  4. Peripherals: Connect sensors, actuators, or other devices to the GPIO pins as needed.

Programming with Arduino IDE

  1. Install the ESP32 board package in the Arduino IDE:
    • Go to File > Preferences and add the following URL to the "Additional Board Manager URLs":
      https://dl.espressif.com/dl/package_esp32_index.json
      
    • Open Tools > Board > Boards Manager, search for "ESP32," and install the package.
  2. Select the ESP32 board:
    • Go to Tools > Board and choose "ESP32 Dev Module."
  3. Write and upload your code.

Example Code: Blinking an LED

// Example: Blink an LED connected to GPIO2 on the ESP32

#define LED_PIN 2  // Define the GPIO pin for the LED

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

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

Important Considerations

  • Voltage Levels: Ensure all connected peripherals operate at 3.3V logic levels.
  • Power Supply: Use a stable power source to avoid unexpected resets.
  • GPIO Limitations: Some GPIO pins are reserved for internal functions (e.g., GPIO6–11 for flash memory).
  • Wi-Fi and Bluetooth: Avoid using ADC2 channels when Wi-Fi is active, as they share resources.

Troubleshooting and FAQs

Common Issues

  1. ESP32 Not Detected by Computer:

    • Ensure the correct USB driver is installed for your USB-to-serial adapter.
    • Check the USB cable for data transfer capability (some cables are power-only).
  2. Code Upload Fails:

    • Verify that GPIO0 is connected to GND during upload.
    • Press and hold the EN button while uploading.
  3. Wi-Fi Connection Issues:

    • Double-check the SSID and password in your code.
    • Ensure the router is within range and supports 2.4 GHz Wi-Fi.
  4. Random Resets:

    • Check for power supply stability.
    • Avoid using GPIO pins reserved for internal functions.

Tips for Troubleshooting

  • Use the serial monitor in the Arduino IDE to view debug messages.
  • Test with a simple program (e.g., blinking an LED) to verify basic functionality.
  • Refer to the Espressif datasheet and technical reference manual for advanced debugging.

By following this documentation, you can effectively use the ESP32-WROOM-32D in your projects and troubleshoot common issues.