The ESP32 Dev Board (20 pins) is a versatile microcontroller development board powered by the ESP32 chip. It features built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for Internet of Things (IoT) projects, wireless communication, and rapid prototyping. The board is compact, energy-efficient, and supports a wide range of peripherals, making it suitable for both hobbyists and professionals.
The ESP32 Dev Board (20 pins) has the following pinout:
Pin Name | Type | Description |
---|---|---|
VIN | Power Input | Input voltage (5V) for powering the board. |
GND | Ground | Ground connection. |
3V3 | Power Output | 3.3V output for powering external components. |
EN | Enable | Enables or disables the chip. Active high. |
IO0 | GPIO/Boot Mode | General-purpose I/O pin. Used for boot mode selection during programming. |
IO1-IO19 | GPIO | General-purpose I/O pins. Configurable as digital input/output, ADC, or PWM. |
ADC1/ADC2 | Analog Input | Analog-to-digital converter pins (12-bit resolution). |
DAC1/DAC2 | Analog Output | Digital-to-analog converter pins (8-bit resolution). |
TXD | UART TX | UART transmit pin for serial communication. |
RXD | UART RX | UART receive pin for serial communication. |
SCL | I2C Clock | I2C clock line for communication with I2C devices. |
SDA | I2C Data | I2C data line for communication with I2C devices. |
SPI Pins | SPI Interface | SPI communication pins (MOSI, MISO, SCK, CS). |
RST | Reset | Resets the board. |
Powering the Board:
Programming the Board:
Connecting Peripherals:
The following example demonstrates how to connect the ESP32 to a Wi-Fi network and blink an LED connected to GPIO2:
#include <WiFi.h> // Include the Wi-Fi library
// Replace with your network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";
const int ledPin = 2; // GPIO2 is connected to the onboard LED
void setup() {
pinMode(ledPin, OUTPUT); // Set GPIO2 as an output pin
Serial.begin(115200); // Start serial communication at 115200 baud
// Connect to Wi-Fi
Serial.print("Connecting to Wi-Fi");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nWi-Fi connected!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(ledPin, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
The board is not detected by the computer:
Upload fails with a timeout error:
Wi-Fi connection issues:
GPIO pins not working as expected:
Can I power the ESP32 with a battery?
Yes, you can use a 3.7V LiPo battery connected to the 3V3 pin or a 5V source connected to the VIN pin.
What is the maximum current output of the 3V3 pin?
The 3V3 pin can supply up to 500 mA, depending on the input power source.
Can I use the ESP32 with other IDEs?
Yes, the ESP32 is compatible with the Arduino IDE, PlatformIO, and the ESP-IDF framework.
How do I reset the board?
Press the RST button or toggle the EN pin to reset the board.