Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use ESP32 DevKitC: Examples, Pinouts, and Specs

Image of ESP32 DevKitCDesign with ESP32 DevKitC in Cirkit Designer

Introduction

The ESP32 DevKitC is a versatile development board built around the ESP32 chip, which integrates Wi-Fi and Bluetooth capabilities. This board is widely used in Internet of Things (IoT) applications, home automation, wearable devices, and rapid prototyping. Its compact design, powerful processing capabilities, and extensive connectivity options make it a popular choice for developers and hobbyists alike.

Explore Projects Built with ESP32 DevKitC

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 ESP32 and Logic Level Converter-Based Wi-Fi Controlled Interface: A project utilizing ESP32 DevKitC in a practical application
ESP32 and Logic Level Converter-Based Wi-Fi Controlled Interface

This circuit features an ESP32 Devkit V1 microcontroller connected to a Bi-Directional Logic Level Converter, which facilitates voltage level shifting between the ESP32 and external components. The ESP32 is powered through its VIN pin via an alligator clip cable, and the logic level converter is connected to various pins on the ESP32 to manage different voltage levels for communication.

Open Project in Cirkit Designer
Image of ESP32-Based Environmental Monitoring and Alert System with Solar Charging: A project utilizing ESP32 DevKitC in a practical application
ESP32-Based Environmental Monitoring and Alert System with Solar Charging

This circuit features an ESP32 Devkit V1 microcontroller connected to various sensors and modules for monitoring and communication purposes. It includes an MQ-2 gas sensor and a DHT11 temperature and humidity sensor, both interfaced with the ESP32 for environmental data collection. The circuit is powered by a 12V battery, regulated to 5V by step-down converters, and includes a solar charge controller connected to a solar panel for battery charging, a UPS module for power management, and a SIM900A module for GSM communication. Additionally, there is a WS2812 RGB LED strip for visual feedback and a piezo buzzer for audio alerts, both controlled by the ESP32.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

Key Technical Details

Specification Value
Microcontroller ESP32 dual-core Xtensa LX6
Clock Speed Up to 240 MHz
Flash Memory 4 MB (varies by model)
SRAM 520 KB
Connectivity Wi-Fi 802.11 b/g/n, Bluetooth 4.2 (BLE)
Operating Voltage 3.3V
Input Voltage (via USB) 5V
GPIO Pins 30-36 (varies by board revision)
ADC Channels Up to 18
DAC Channels 2
Communication Interfaces UART, SPI, I2C, I2S, CAN, PWM
Power Consumption Ultra-low power modes available
Dimensions Approx. 25.4mm x 51mm

Pin Configuration and Descriptions

The ESP32 DevKitC features a dual-row pin header layout. Below is a table summarizing the key pins and their functions:

Pin Name Function Description
VIN Input power (5V) when powering via an external source
3V3 Regulated 3.3V output
GND Ground
EN Enable pin (active high, used to reset the chip)
IO0 GPIO0, used for boot mode selection during programming
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-39 Additional GPIO pins (varies by board revision)
TX0, RX0 UART0 TX and RX pins (default serial communication)
ADC1-ADC2 Analog-to-Digital Converter channels
DAC1, DAC2 Digital-to-Analog Converter channels
SCL, SDA I2C clock and data lines
SPI Pins SPI communication pins (MOSI, MISO, SCK, CS)

Note: The exact pinout may vary slightly depending on the specific ESP32 DevKitC revision. Always refer to the datasheet or silkscreen on your board for accurate pin labeling.

Usage Instructions

How to Use the ESP32 DevKitC in a Circuit

  1. Powering the Board:

    • Connect the board to your computer via a micro-USB cable for power and programming.
    • Alternatively, supply 5V to the VIN pin or 3.3V to the 3V3 pin for external power.
  2. Programming the Board:

    • Install the Arduino IDE or ESP-IDF (Espressif IoT Development Framework).
    • Add the ESP32 board support package to the Arduino IDE via the Board Manager.
    • Select "ESP32 Dev Module" as the board type in the IDE.
    • Connect the board to your computer and select the appropriate COM port.
  3. Connecting Peripherals:

    • Use the GPIO pins to connect sensors, actuators, or other peripherals.
    • Ensure that the voltage levels of connected devices are compatible with the ESP32 (3.3V logic).
  4. Uploading Code:

    • Write your code in the Arduino IDE or ESP-IDF.
    • Press the "Upload" button in the IDE to flash the code to the ESP32.
    • If required, hold the IO0 button during the upload process to enter boot mode.

Example Code: Blinking an LED

Below is an example of how to blink an LED connected to GPIO2 using the Arduino IDE:

// 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

Troubleshooting and FAQs

Common Issues and Solutions

  1. Problem: The board is not detected by the computer.
    Solution:

    • Ensure the USB cable is functional and supports data transfer.
    • Install the correct USB-to-serial driver (e.g., CP210x or CH340, depending on your board).
  2. Problem: Code upload fails with a timeout error.
    Solution:

    • Hold the IO0 button while pressing the EN (reset) button to enter boot mode.
    • Check the selected COM port and board type in the Arduino IDE.
  3. Problem: Wi-Fi connection is unstable.
    Solution:

    • Ensure the power supply is sufficient and stable.
    • Check for interference from other devices on the same Wi-Fi channel.
  4. Problem: GPIO pins are not functioning as expected.
    Solution:

    • Verify the pin configuration in your code.
    • Check if the pin is being used for other functions (e.g., ADC, UART).

FAQs

Q: Can I power the ESP32 DevKitC with a battery?
A: Yes, you can use a LiPo battery with a 3.7V output connected to the 3V3 pin or a 5V source connected to the VIN pin.

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 DevKitC with MicroPython?
A: Yes, the ESP32 supports MicroPython. You can flash the MicroPython firmware to the board and use it for development.

Q: What is the maximum Wi-Fi range of the ESP32?
A: The range depends on environmental factors but typically extends up to 100 meters in open spaces.

Q: Does the ESP32 support OTA (Over-The-Air) updates?
A: Yes, the ESP32 supports OTA updates, allowing you to upload new firmware wirelessly.