

The ESP32 is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, designed for a wide range of applications. With its 30-pin configuration, the ESP32 offers extensive input/output options, making it a versatile choice for Internet of Things (IoT) projects, embedded systems, and wireless communication tasks. Its dual-core processor and low-power consumption make it suitable for both high-performance and energy-efficient applications.








| Specification | Value |
|---|---|
| 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 Standard | 802.11 b/g/n |
| Bluetooth | v4.2 BR/EDR and BLE |
| Operating Voltage | 3.3V |
| Input Voltage Range | 3.0V - 3.6V |
| GPIO Pins | 30 |
| ADC Channels | 18 (12-bit resolution) |
| DAC Channels | 2 |
| Communication Interfaces | UART, SPI, I2C, I2S, CAN, PWM |
| Power Consumption | Ultra-low power (varies by mode) |
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | EN | Enable pin (active high) |
| 2 | IO0 | GPIO0, used for boot mode selection |
| 3 | IO1 (TX0) | GPIO1, UART0 TX |
| 4 | IO3 (RX0) | GPIO3, UART0 RX |
| 5 | IO4 | GPIO4, PWM, ADC |
| 6 | IO5 | GPIO5, PWM, ADC |
| 7 | IO12 | GPIO12, ADC, Touch Sensor |
| 8 | IO13 | GPIO13, ADC, Touch Sensor |
| 9 | IO14 | GPIO14, PWM, ADC |
| 10 | IO15 | GPIO15, PWM, ADC |
| 11 | IO16 | GPIO16, UART2 RX |
| 12 | IO17 | GPIO17, UART2 TX |
| 13 | IO18 | GPIO18, SPI CLK |
| 14 | IO19 | GPIO19, SPI MISO |
| 15 | IO21 | GPIO21, I2C SDA |
| 16 | IO22 | GPIO22, I2C SCL |
| 17 | IO23 | GPIO23, SPI MOSI |
| 18 | IO25 | GPIO25, DAC1, ADC |
| 19 | IO26 | GPIO26, DAC2, ADC |
| 20 | IO27 | GPIO27, ADC, Touch Sensor |
| 21 | IO32 | GPIO32, ADC, Touch Sensor |
| 22 | IO33 | GPIO33, ADC, Touch Sensor |
| 23 | IO34 | GPIO34, ADC (input only) |
| 24 | IO35 | GPIO35, ADC (input only) |
| 25 | GND | Ground |
| 26 | 3V3 | 3.3V Power Supply |
| 27 | VIN | Input Voltage (5V recommended) |
| 28 | IO36 (VP) | GPIO36, ADC, Touch Sensor |
| 29 | IO39 (VN) | GPIO39, ADC, Touch Sensor |
| 30 | RST | Reset pin |
Powering the ESP32:
VIN pin to a 5V power source or use the 3V3 pin for a regulated 3.3V supply.GND) pin is connected to the circuit's ground.Programming the ESP32:
Connecting Peripherals:
Wi-Fi and Bluetooth Setup:
WiFi.h and BluetoothSerial.h) to configure wireless communication.The following example demonstrates how to connect the ESP32 to a Wi-Fi network and control an LED:
#include <WiFi.h> // Include the Wi-Fi library
const char* ssid = "Your_SSID"; // Replace with your Wi-Fi SSID
const char* password = "Your_Password"; // Replace with your Wi-Fi password
const int ledPin = 2; // GPIO2 is connected to the LED
void setup() {
pinMode(ledPin, OUTPUT); // Set GPIO2 as an output
Serial.begin(115200); // Initialize serial communication
WiFi.begin(ssid, password); // Connect to Wi-Fi
Serial.print("Connecting to Wi-Fi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nConnected to Wi-Fi");
}
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
}
ESP32 Not Connecting to Wi-Fi:
Upload Fails or Timeout Errors:
Random Resets or Instability:
GPIO Pins Not Working:
Can the ESP32 operate on battery power?
Yes, the ESP32 can be powered by a LiPo battery or other 3.3V-5V sources. Use deep sleep mode to conserve power.
How do I reset the ESP32?
Press the RST button or momentarily connect the EN pin to ground.
Can I use the ESP32 with 5V logic devices?
No, the ESP32 operates at 3.3V logic levels. Use a level shifter for compatibility with 5V devices.