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

How to Use ESP32 38-PIN: Examples, Pinouts, and Specs

Image of ESP32 38-PIN
Cirkit Designer LogoDesign with ESP32 38-PIN in Cirkit Designer

Introduction

The ESP32 38-PIN is a powerful and versatile microcontroller designed for a wide range of applications, particularly in the Internet of Things (IoT) and embedded systems. It features built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for wireless communication projects. With 38 pins, the ESP32 offers extensive input/output (I/O) options, enabling developers to connect various sensors, actuators, and peripherals.

Explore Projects Built with ESP32 38-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!
ESP32-Based OLED Display Interface
Image of d: A project utilizing ESP32 38-PIN 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 Wi-Fi Controlled LED System
Image of PIR Tester: A project utilizing ESP32 38-PIN 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 Display with Camera and Audio Alert System
Image of cam_circuit_design: A project utilizing ESP32 38-PIN in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Security System with Fingerprint Authentication and Servo Lock Mechanism
Image of pta : A project utilizing ESP32 38-PIN in a practical application
This circuit features an ESP32 microcontroller that interfaces with an OLED display, a servo motor, and a fingerprint scanner. The ESP32 provides power to the OLED and servo, and communicates with the OLED via I2C (SCL and SDA lines) and with the fingerprint scanner via serial communication (TX and RX lines). The servo is controlled by the ESP32 through a PWM signal, enabling the circuit to display information, authenticate users via fingerprints, and perform mechanical actions with the servo.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ESP32 38-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 d: A project utilizing ESP32 38-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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of PIR Tester: A project utilizing ESP32 38-PIN 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 cam_circuit_design: A project utilizing ESP32 38-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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of pta : A project utilizing ESP32 38-PIN in a practical application
ESP32-Controlled Security System with Fingerprint Authentication and Servo Lock Mechanism
This circuit features an ESP32 microcontroller that interfaces with an OLED display, a servo motor, and a fingerprint scanner. The ESP32 provides power to the OLED and servo, and communicates with the OLED via I2C (SCL and SDA lines) and with the fingerprint scanner via serial communication (TX and RX lines). The servo is controlled by the ESP32 through a PWM signal, enabling the circuit to display information, authenticate users via fingerprints, and perform mechanical actions with the servo.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • IoT devices and smart home automation
  • Wireless sensor networks
  • Wearable technology
  • Robotics and automation systems
  • Data logging and remote monitoring
  • Prototyping and educational projects

Technical Specifications

The ESP32 38-PIN microcontroller is equipped with robust hardware and connectivity features. Below are its key technical specifications:

Specification Details
Microcontroller Tensilica Xtensa LX6 dual-core processor
Clock Speed Up to 240 MHz
Flash Memory 4 MB (varies by model)
SRAM 520 KB
Wi-Fi 802.11 b/g/n
Bluetooth Bluetooth 4.2 and BLE (Bluetooth Low Energy)
Operating Voltage 3.3V
Input Voltage Range 5V (via USB) or 7-12V (via VIN pin)
GPIO Pins 34 (multipurpose, including ADC, DAC, PWM, I2C, SPI, UART)
ADC Channels 18 (12-bit resolution)
DAC Channels 2
PWM Channels 16
Communication Protocols UART, SPI, I2C, I2S, CAN, Ethernet
Power Consumption Ultra-low power consumption in deep sleep mode (as low as 10 µA)
Dimensions 51mm x 25.5mm

Pin Configuration and Descriptions

The ESP32 38-PIN has a total of 38 pins, each with specific functions. Below is a summary of the pin configuration:

Pin Name Function
VIN Input power supply (7-12V)
GND Ground
3V3 3.3V output
EN Enable pin (active high)
IO0 GPIO0, used for boot mode selection
IO2 GPIO2, general-purpose I/O
IO4 GPIO4, general-purpose I/O
IO5 GPIO5, general-purpose I/O
IO12 GPIO12, general-purpose I/O
IO13 GPIO13, general-purpose I/O
IO14 GPIO14, general-purpose I/O
IO15 GPIO15, general-purpose I/O
IO16 GPIO16, general-purpose I/O
IO17 GPIO17, general-purpose I/O
IO18 GPIO18, general-purpose I/O
IO19 GPIO19, general-purpose I/O
IO21 GPIO21, general-purpose I/O
IO22 GPIO22, general-purpose I/O
IO23 GPIO23, general-purpose I/O
IO25 GPIO25, general-purpose I/O
IO26 GPIO26, general-purpose I/O
IO27 GPIO27, general-purpose I/O
IO32 GPIO32, general-purpose I/O
IO33 GPIO33, general-purpose I/O
IO34 GPIO34, input-only pin
IO35 GPIO35, input-only pin
ADC1/ADC2 Analog-to-digital converter channels
DAC1/DAC2 Digital-to-analog converter channels
TX0/RX0 UART0 TX/RX pins
TX1/RX1 UART1 TX/RX pins
TX2/RX2 UART2 TX/RX pins
SCL/SDA I2C clock and data pins
MOSI/MISO SPI data pins
SCK/CS SPI clock and chip select pins

Usage Instructions

How to Use the ESP32 38-PIN in a Circuit

  1. Powering the ESP32:

    • Use the VIN pin to supply 7-12V, or connect a 5V USB power source.
    • Ensure the GND pin is connected to the ground of your circuit.
  2. Programming the ESP32:

    • Connect the ESP32 to your computer via a USB cable.
    • Install the ESP32 board package in the Arduino IDE or use the ESP-IDF framework.
    • Select the correct board and port in the IDE before uploading code.
  3. Connecting Peripherals:

    • Use GPIO pins for digital I/O, ADC pins for analog input, and DAC pins for analog output.
    • For communication, use UART, SPI, or I2C pins as needed.
  4. Wi-Fi and Bluetooth Setup:

    • Use the built-in libraries (e.g., WiFi.h and BluetoothSerial.h in Arduino IDE) to configure wireless communication.

Important Considerations and Best Practices

  • Always use a level shifter when interfacing 5V devices with the ESP32, as its GPIO pins operate at 3.3V.
  • Avoid using GPIO pins 6-11, as they are reserved for the internal flash memory.
  • Use decoupling capacitors near the power pins to reduce noise and ensure stable operation.
  • When using Wi-Fi or Bluetooth, ensure proper antenna placement to avoid signal interference.

Example Code for Arduino UNO Integration

Below is an example of using the ESP32 to connect to a Wi-Fi network and send data to a server:

#include <WiFi.h> // Include the Wi-Fi library

const char* ssid = "Your_SSID";       // Replace with your Wi-Fi network name
const char* password = "Your_Password"; // Replace with your Wi-Fi password

void setup() {
  Serial.begin(115200); // Initialize serial communication at 115200 baud
  WiFi.begin(ssid, password); // Connect to the Wi-Fi network

  Serial.print("Connecting to Wi-Fi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500); // Wait for connection
    Serial.print(".");
  }
  Serial.println("\nConnected to Wi-Fi!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP()); // Print the ESP32's IP address
}

void loop() {
  // Add your main code here
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32 Not Connecting to Wi-Fi:

    • Double-check the SSID and password.
    • Ensure the router is within range and supports 2.4 GHz Wi-Fi (ESP32 does not support 5 GHz).
  2. Upload Errors in Arduino IDE:

    • Ensure the correct board and port are selected in the IDE.
    • Press and hold the "BOOT" button on the ESP32 while uploading the code.
  3. Random Resets or Instability:

    • Check the power supply for sufficient current (at least 500 mA).
    • Add decoupling capacitors to stabilize the power supply.
  4. GPIO Pin Not Working:

    • Verify the pin is not reserved for internal use (e.g., GPIO6-GPIO11).
    • Check for proper pinMode configuration in the code.

FAQs

  • Can the ESP32 operate on battery power?
    Yes, the ESP32 can be powered by a LiPo battery connected to the VIN pin. Use a voltage regulator if needed.

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

  • Can I use the ESP32 with 5V logic devices?
    No, the ESP32 operates at 3.3V logic. Use a level shifter for compatibility with 5V devices.