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

How to Use Esp32 38pin: Examples, Pinouts, and Specs

Image of Esp32 38pin
Cirkit Designer LogoDesign with Esp32 38pin in Cirkit Designer

Introduction

The ESP32 38-pin is a powerful microcontroller designed for IoT (Internet of Things) applications and embedded systems. It features integrated Wi-Fi and Bluetooth capabilities, making it ideal for wireless communication and smart device projects. With 38 pins, the ESP32 offers a wide range of input/output (I/O) options, including digital, analog, PWM, and communication interfaces such as UART, SPI, and I2C. Its versatility and high performance make it a popular choice for developers and hobbyists alike.

Explore Projects Built with Esp32 38pin

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 38pin 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 38pin 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 38pin 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 38pin 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 38pin

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 38pin 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 38pin 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 38pin 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 38pin 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

  • Smart home automation systems
  • IoT devices and sensors
  • Wireless data logging and monitoring
  • Robotics and motor control
  • Wearable devices
  • Industrial automation and control systems

Technical Specifications

The ESP32 38-pin microcontroller is built for high performance and flexibility. Below are its key technical details:

Key Technical Details

  • Processor: Dual-core Xtensa® 32-bit LX6 CPU
  • 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, CAN, I2S
  • Power Consumption: Ultra-low power in deep sleep mode (~10 µA)

Pin Configuration and Descriptions

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

Pin Number Pin Name Function
1 EN Enable pin (active high, used to reset the chip)
2 IO36 (VP) ADC1 Channel 0, GPIO36, input-only pin
3 IO39 (VN) ADC1 Channel 3, GPIO39, input-only pin
4 IO34 ADC1 Channel 6, GPIO34, input-only pin
5 IO35 ADC1 Channel 7, GPIO35, input-only pin
6 IO32 ADC1 Channel 4, GPIO32, touch sensor T9
7 IO33 ADC1 Channel 5, GPIO33, touch sensor T8
8 IO25 DAC1, GPIO25, ADC2 Channel 8
9 IO26 DAC2, GPIO26, ADC2 Channel 9
10 IO27 GPIO27, ADC2 Channel 7, touch sensor T7
11 IO14 GPIO14, ADC2 Channel 6, touch sensor T6
12 IO12 GPIO12, ADC2 Channel 5, touch sensor T5
13 IO13 GPIO13, ADC2 Channel 4, touch sensor T4
14 IO15 GPIO15, ADC2 Channel 3, touch sensor T3
15 IO2 GPIO2, ADC2 Channel 2, touch sensor T2
16 IO4 GPIO4, ADC2 Channel 0, touch sensor T0
17 IO16 GPIO16, UART2_RX
18 IO17 GPIO17, UART2_TX
19 IO5 GPIO5, SPI_SS
20 IO18 GPIO18, SPI_CLK
21 IO19 GPIO19, SPI_MISO
22 IO21 GPIO21, I2C SDA
23 IO22 GPIO22, I2C SCL
24 IO23 GPIO23, SPI_MOSI
25 GND Ground
26 3V3 3.3V power output
27 VIN Input voltage (5V)
28-38 Other GPIOs Configurable as digital I/O, PWM, or communication pins

Usage Instructions

How to Use the ESP32 38-Pin in a Circuit

  1. Powering the ESP32:

    • Use a USB cable to power the ESP32 via the micro-USB port (5V input).
    • Alternatively, supply 3.3V directly to the VIN pin. Ensure the power source is stable.
  2. Connecting to Peripherals:

    • Use GPIO pins for digital input/output.
    • Connect sensors to ADC pins for analog input.
    • Use UART, SPI, or I2C pins for communication with other devices.
  3. Programming the ESP32:

    • Install the ESP32 board package in the Arduino IDE.
    • Connect the ESP32 to your computer via USB.
    • Select the correct board and port in the Arduino IDE.
    • Write and upload your code.

Important Considerations and Best Practices

  • Always use a level shifter when interfacing 5V devices with the ESP32 (3.3V logic).
  • Avoid using ADC2 pins when Wi-Fi is active, as they share resources.
  • Use pull-up or pull-down resistors for input pins to prevent floating states.
  • Ensure proper grounding to avoid noise and instability in analog readings.

Example Code for Arduino IDE

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

// Define the GPIO pin for the LED
const int ledPin = 2;

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

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

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

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 in Arduino IDE:

    • Check that the correct board and port are selected.
    • 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 router is within range and supports 2.4 GHz Wi-Fi.
  4. Unstable Analog Readings:

    • Use proper grounding and decoupling capacitors.
    • Avoid using ADC2 pins when Wi-Fi is active.

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.

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

  • Q: Can I use the ESP32 with 5V sensors?
    A: Yes, but you must use a level shifter to convert 5V signals to 3.3V.

This documentation provides a comprehensive guide to using the ESP32 38-pin microcontroller effectively.