

The ESP32 is a powerful microcontroller with integrated Wi-Fi and Bluetooth capabilities, making it an excellent choice for Internet of Things (IoT) applications. It features a dual-core processor, low-power consumption, and a wide range of peripherals. The addition of an expansion board enhances its functionality by providing extra GPIO pins, improved power management, and simplified connectivity to sensors, actuators, and other modules.








| Specification | Value |
|---|---|
| Microcontroller | ESP32 Dual-Core Xtensa LX6 |
| 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 (via USB) | 5V |
| GPIO Pins | Up to 30 (varies with expansion board) |
| ADC Channels | 18 |
| DAC Channels | 2 |
| Communication Interfaces | UART, SPI, I2C, I2S, CAN, PWM |
| Power Modes | Active, Sleep, Deep Sleep |
Below is a typical pinout for the ESP32 with an expansion board. Note that the exact pin configuration may vary depending on the specific expansion board model.
| Pin Name | Description |
|---|---|
| VIN | Input voltage (5V from USB or external source) |
| 3V3 | 3.3V output for powering external components |
| GND | Ground |
| EN | Enable pin (active high to enable the ESP32) |
| GPIO0 | General-purpose I/O, often used for boot mode |
| GPIO2 | General-purpose I/O |
| GPIO4 | General-purpose I/O |
| GPIO5 | General-purpose I/O |
| GPIO12 | General-purpose I/O |
| GPIO13 | General-purpose I/O |
| GPIO14 | General-purpose I/O |
| GPIO15 | General-purpose I/O |
| GPIO16 | General-purpose I/O |
| GPIO17 | General-purpose I/O |
| TXD0 | UART0 Transmit |
| RXD0 | UART0 Receive |
| SDA | I2C Data Line |
| SCL | I2C Clock Line |
| ADC1_CH0 | Analog-to-Digital Converter Channel 0 |
| ADC1_CH1 | Analog-to-Digital Converter Channel 1 |
Powering the ESP32:
Connecting Sensors and Modules:
Programming the ESP32:
Wi-Fi and Bluetooth Setup:
Below is an example code 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";
#define LED_PIN 2 // GPIO2 is connected to the LED
void setup() {
pinMode(LED_PIN, OUTPUT); // Set GPIO2 as an output pin
Serial.begin(115200); // Initialize serial communication
// 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()); // Print the ESP32's IP address
}
void loop() {
digitalWrite(LED_PIN, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(LED_PIN, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
ESP32 Not Connecting to Wi-Fi:
Code Upload Fails:
GPIO Pin Not Responding:
Power Instability:
Q: Can I use the ESP32 with 5V sensors directly?
A: No, the ESP32 operates at 3.3V logic levels. Use a level shifter to interface with 5V sensors.
Q: How do I reset the ESP32?
A: Press the "EN" button on the expansion board to reset the ESP32.
Q: Can I use the ESP32 for battery-powered projects?
A: Yes, the ESP32 supports low-power modes, making it suitable for battery-powered applications.
Q: What is the maximum range of the ESP32's Wi-Fi?
A: The range depends on environmental factors but typically extends up to 50 meters indoors and 200 meters outdoors.