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 38 PINS is a versatile microcontroller designed for IoT applications and embedded systems. It features integrated Wi-Fi and Bluetooth capabilities, making it a powerful solution for wireless communication. With 38 GPIO pins, the ESP32 offers extensive input and output options, enabling developers to connect a wide range of sensors, actuators, and peripherals. Its high processing power, low energy consumption, and rich feature set make it suitable for smart home devices, wearables, industrial automation, and more.

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 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-Controlled Multi-Display Interface with Pushbutton Interaction
Image of Info-Orbs: A project utilizing ESP32 38 PINS in a practical application
This circuit features an ESP32 microcontroller interfaced with multiple round TFT displays, controlled via shared serial communication lines, and several pushbuttons connected to individual GPIOs for input. The ESP32 coordinates the display of information and responds to user inputs from the pushbuttons.
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 PINS 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

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 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 Info-Orbs: A project utilizing ESP32 38 PINS in a practical application
ESP32-Controlled Multi-Display Interface with Pushbutton Interaction
This circuit features an ESP32 microcontroller interfaced with multiple round TFT displays, controlled via shared serial communication lines, and several pushbuttons connected to individual GPIOs for input. The ESP32 coordinates the display of information and responds to user inputs from the pushbuttons.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of cam_circuit_design: A project utilizing ESP32 38 PINS 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

Technical Specifications

The ESP32 38 PINS microcontroller is equipped with the following key technical features:

  • 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
  • GPIO Pins: 38 (multipurpose, including ADC, DAC, PWM, I2C, SPI, UART)
  • ADC Channels: 18 (12-bit resolution)
  • DAC Channels: 2
  • PWM Outputs: Up to 16 channels
  • Power Consumption: Ultra-low power in deep sleep mode (~10 µA)

Pin Configuration and Descriptions

The ESP32 38 PINS has 38 GPIO pins, each with multiple functions. Below is a summary of the pin configuration:

Pin Number Pin Name Function Description
1 EN Enable Active-high pin to enable or reset the chip.
2 IO0 GPIO0, Boot Mode General-purpose I/O, used for boot mode selection during programming.
3 IO1 GPIO1, TX0 UART0 transmit pin, also used as GPIO.
4 IO2 GPIO2 General-purpose I/O, supports PWM and ADC.
5 IO3 GPIO3, RX0 UART0 receive pin, also used as GPIO.
6-11 N/A Flash Memory Pins Reserved for internal flash memory.
12 IO12 GPIO12, ADC2_CH5 General-purpose I/O, ADC input, supports PWM.
13 IO13 GPIO13, ADC2_CH4 General-purpose I/O, ADC input, supports PWM.
14 IO14 GPIO14, ADC2_CH6 General-purpose I/O, ADC input, supports PWM.
15 IO15 GPIO15, ADC2_CH3 General-purpose I/O, ADC input, supports PWM.
16-38 Various GPIO, ADC, DAC, I2C, SPI, UART, PWM Multipurpose pins for various communication protocols and analog/digital I/O.

Note: Some GPIO pins have specific restrictions or are used during boot. Refer to the ESP32 datasheet for detailed pin behavior.

Usage Instructions

How to Use the ESP32 38 PINS in a Circuit

  1. Powering the ESP32:

    • The ESP32 operates at 3.3V. Use a voltage regulator if your power source exceeds this voltage.
    • Connect the 3.3V pin to a stable power supply and GND to ground.
  2. Programming the ESP32:

    • Use a USB-to-serial adapter or a development board with a built-in USB interface.
    • Install the ESP32 board package in the Arduino IDE or use the ESP-IDF framework for advanced development.
    • Connect the ESP32 to your computer via USB and select the appropriate COM port in the IDE.
  3. Connecting Peripherals:

    • Use GPIO pins for digital input/output, ADC pins for analog input, and DAC pins for analog output.
    • For communication, use I2C, SPI, or UART pins as needed.
  4. Uploading Code:

    • Write your code in the Arduino IDE or ESP-IDF.
    • Press the "Upload" button in the IDE. If required, hold the BOOT button on the ESP32 during the upload process.

Example Code: Blinking an LED

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

// Define the GPIO pin where the LED is connected
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
}

Important Considerations and Best Practices

  • Voltage Levels: Ensure all connected peripherals operate at 3.3V logic levels to avoid damaging the ESP32.
  • Boot Mode Pins: Avoid pulling GPIO0, GPIO2, and GPIO15 to incorrect states during boot, as this may interfere with normal operation.
  • Power Supply: Use a stable power source to prevent unexpected resets or malfunctions.
  • Deep Sleep Mode: Utilize deep sleep mode for battery-powered applications to conserve energy.

Troubleshooting and FAQs

Common Issues and Solutions

  1. ESP32 Not Detected by Computer:

    • Ensure the correct USB driver is installed for your USB-to-serial adapter.
    • Check the USB cable for damage or try a different cable.
  2. Code Upload Fails:

    • Hold the BOOT button while uploading the code.
    • Verify the correct COM port and board type are selected in the IDE.
  3. Wi-Fi Connection Issues:

    • Double-check the SSID and password in your code.
    • Ensure the Wi-Fi network is within range and not using unsupported security protocols.
  4. GPIO Pin Not Working:

    • Verify the pin is not being used for another function (e.g., boot mode).
    • Check for loose connections or incorrect wiring.

FAQs

Q: Can I power the ESP32 with a 5V source?
A: Yes, if you are using a development board with an onboard voltage regulator. Otherwise, use a 3.3V power source.

Q: How many devices can I connect via I2C?
A: The ESP32 supports multiple I2C devices, limited by the unique addresses of the devices and the bus capacitance.

Q: Can the ESP32 operate in both Wi-Fi and Bluetooth modes simultaneously?
A: Yes, the ESP32 supports simultaneous Wi-Fi and Bluetooth operation, but performance may vary depending on the workload.

Q: What is the maximum current output of a GPIO pin?
A: Each GPIO pin can source or sink up to 12 mA. For higher currents, use an external transistor or driver circuit.