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

How to Use ESP32 (38 pins): Examples, Pinouts, and Specs

Image of ESP32 (38 pins)
Cirkit Designer LogoDesign with ESP32 (38 pins) in Cirkit Designer

Introduction

The ESP32 is a powerful microcontroller with integrated Wi-Fi and Bluetooth capabilities, making it an ideal choice for Internet of Things (IoT) applications and embedded systems. With its 38 pins, the ESP32 offers a wide range of input/output (I/O) functions, including digital and analog pins, PWM, I2C, SPI, UART, and more. Its dual-core processor and low-power modes make it suitable for both high-performance and energy-efficient applications.

Explore Projects Built with ESP32 (38 pins)

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 OLED Display Interface
Image of d: A project utilizing ESP32 (38 pins) 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 Ultrasonic, GPS, GSM, and Rain Sensor
Image of SMART BLIND STICK CONNECTION: A project utilizing ESP32 (38 pins) in a practical application
This circuit features an ESP32 microcontroller connected to multiple sensors and modules for environmental data collection and communication. It includes three HC-SR04 ultrasonic sensors for distance measurement, a rain sensor for detecting precipitation, a GPS NEO 6M module for location tracking, and a GSM SIM900 module for cellular communication. Additionally, there is a piezo buzzer for audio feedback and a push switch for user input, all sharing a common ground with the ESP32.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Wi-Fi Controlled LED System
Image of PIR Tester: A project utilizing ESP32 (38 pins) in a practical application
This circuit features two ESP32 microcontrollers communicating via UART, with one controlling an LED through a resistor. The primary ESP32 (ESP32 38 PINS) handles I2C communication and processes serial input to control the LED, while the secondary ESP32 (pocket esp32-c3) sends periodic data over UART.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Smart Connectivity Hub with RFID and GPS Tracking
Image of Ccapstone: A project utilizing ESP32 (38 pins) in a practical application
This circuit features an ESP32 microcontroller as the central processing unit, interfaced with an ESP32-CAM module for image capture, an RFID-RC522 module for RFID communication, a GPS NEO 6M module for location tracking, and a SIM800L module for GSM communication capabilities. The ESP32 is configured to communicate with these peripherals using GPIO and serial connections, enabling functionalities such as RFID-based identification, image capture, location tracking, and GSM-based data transmission. The provided code suggests that the ESP32-CAM module is programmable, but the specific functionality is not defined in the provided code snippet.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ESP32 (38 pins)

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 d: A project utilizing ESP32 (38 pins) 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 SMART BLIND STICK CONNECTION: A project utilizing ESP32 (38 pins) in a practical application
ESP32-Based Environmental Monitoring System with Ultrasonic, GPS, GSM, and Rain Sensor
This circuit features an ESP32 microcontroller connected to multiple sensors and modules for environmental data collection and communication. It includes three HC-SR04 ultrasonic sensors for distance measurement, a rain sensor for detecting precipitation, a GPS NEO 6M module for location tracking, and a GSM SIM900 module for cellular communication. Additionally, there is a piezo buzzer for audio feedback and a push switch for user input, all sharing a common ground with the ESP32.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of PIR Tester: A project utilizing ESP32 (38 pins) in a practical application
ESP32-Based Wi-Fi Controlled LED System
This circuit features two ESP32 microcontrollers communicating via UART, with one controlling an LED through a resistor. The primary ESP32 (ESP32 38 PINS) handles I2C communication and processes serial input to control the LED, while the secondary ESP32 (pocket esp32-c3) sends periodic data over UART.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Ccapstone: A project utilizing ESP32 (38 pins) in a practical application
ESP32-Based Smart Connectivity Hub with RFID and GPS Tracking
This circuit features an ESP32 microcontroller as the central processing unit, interfaced with an ESP32-CAM module for image capture, an RFID-RC522 module for RFID communication, a GPS NEO 6M module for location tracking, and a SIM800L module for GSM communication capabilities. The ESP32 is configured to communicate with these peripherals using GPIO and serial connections, enabling functionalities such as RFID-based identification, image capture, location tracking, and GSM-based data transmission. The provided code suggests that the ESP32-CAM module is programmable, but the specific functionality is not defined in the provided code snippet.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT devices (e.g., smart home systems, wearables, and sensors)
  • Wireless communication (Wi-Fi and Bluetooth)
  • Robotics and automation
  • Data logging and remote monitoring
  • Prototyping and development of embedded systems

Technical Specifications

Key Technical Details

  • Processor: Dual-core Xtensa® 32-bit LX6 microprocessor
  • 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 3.3V (via VIN pin)
  • GPIO Pins: 34 (configurable as digital I/O, PWM, ADC, etc.)
  • ADC Channels: 18 (12-bit resolution)
  • DAC Channels: 2 (8-bit resolution)
  • Communication Protocols: UART, SPI, I2C, I2S, CAN, Ethernet
  • Power Modes: Active, Light Sleep, Deep Sleep, Hibernation
  • Operating Temperature: -40°C to +125°C

Pin Configuration and Descriptions

The ESP32 (38-pin variant) has the following pinout:

Pin Name Type Description
VIN Power Input Input voltage (5V) for powering the ESP32 via an external source.
GND Ground Ground connection.
3V3 Power Output Regulated 3.3V output.
EN Enable Enables the chip when pulled high.
IO0 GPIO, Boot Mode General-purpose I/O; used for boot mode selection during programming.
IO2 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
IO4 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
IO5 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
IO12 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
IO13 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
IO14 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
IO15 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
IO16-IO39 GPIO, ADC, PWM General-purpose I/O; supports ADC and PWM.
TX0 UART TX UART transmit pin (serial communication).
RX0 UART RX UART receive pin (serial communication).
DAC1 DAC Output Digital-to-Analog Converter output channel 1.
DAC2 DAC Output Digital-to-Analog Converter output channel 2.
SCL I2C Clock I2C clock line.
SDA I2C Data I2C data line.
SPI Pins SPI Communication Includes MOSI, MISO, SCK, and CS for SPI communication.

Note: Not all GPIO pins support all functions simultaneously. Refer to the ESP32 datasheet for pin multiplexing details.

Usage Instructions

How to Use the ESP32 in a Circuit

  1. Powering the ESP32:

    • Use a 5V power source connected to the VIN pin or power the board via the USB port.
    • Ensure the power supply can provide sufficient current (at least 500 mA).
  2. Connecting Peripherals:

    • Use GPIO pins for digital I/O operations.
    • Connect sensors or analog devices to ADC pins (e.g., IO32, IO33).
    • Use UART, SPI, or I2C pins for communication with other devices.
  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 USB.
    • Select the correct board and port in the IDE, then upload your code.

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 IO0 is pulled low during programming to enter boot mode.
  • Power Consumption: Use deep sleep or hibernation modes to reduce power consumption in battery-powered applications.
  • Pin Multiplexing: Be aware of pin multiplexing to avoid conflicts between peripherals.

Example Code for Arduino UNO Integration

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

// Define the GPIO pin for the LED
#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
}

Tip: Use the Serial Monitor in the Arduino IDE to debug your code and monitor outputs.

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. Upload Fails with Timeout Error:

    • Check that IO0 is pulled low during programming.
    • Press and hold the "BOOT" button on the ESP32 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 overloaded.
  4. GPIO Pin Not Working:

    • Confirm the pin is not being used by another peripheral (e.g., ADC, UART).
    • Check for proper wiring and connections.

FAQs

  • Q: Can the ESP32 handle 5V logic signals?
    A: No, the ESP32 operates at 3.3V logic levels. Use a level shifter for 5V signals.

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

  • Q: Can I use the ESP32 with batteries?
    A: Yes, the ESP32 can be powered using a 3.7V LiPo battery connected to the VIN pin.

  • Q: How do I reduce power consumption?
    A: Use deep sleep or hibernation modes in your code to minimize power usage.

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