

The ESP32 is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for IoT (Internet of Things) applications and embedded systems. With its 30-pin configuration, the ESP32 offers a wide range of GPIO (General Purpose Input/Output) pins, ADC (Analog-to-Digital Converter) channels, PWM (Pulse Width Modulation) outputs, and communication interfaces such as UART, SPI, and I2C. Its versatility and high performance make it suitable for projects ranging from home automation to industrial control systems.








| 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 | 802.11 b/g/n |
| Bluetooth | v4.2 BR/EDR and BLE |
| Operating Voltage | 3.3V |
| Input Voltage Range | 5V (via USB) or 3.3V (via VIN pin) |
| GPIO Pins | 30 pins |
| ADC Channels | 18 (12-bit resolution) |
| PWM Outputs | Up to 16 |
| Communication Interfaces | UART, SPI, I2C, CAN, I2S |
| Power Consumption | Ultra-low power modes available |
The ESP32 (30-pin variant) has the following pinout:
| Pin Number | Pin Name | Functionality |
|---|---|---|
| 1 | EN | Enable pin (active high, resets the chip when pulled low) |
| 2 | IO1 | GPIO1, UART TXD0 |
| 3 | IO3 | GPIO3, UART RXD0 |
| 4 | IO4 | GPIO4, ADC2_CH0, Touch 0 |
| 5 | IO5 | GPIO5, ADC2_CH1, Touch 1 |
| 6 | IO12 | GPIO12, ADC2_CH5, Touch 5, HSPI MISO |
| 7 | IO13 | GPIO13, ADC2_CH4, Touch 4, HSPI MOSI |
| 8 | IO14 | GPIO14, ADC2_CH6, Touch 6, HSPI CLK |
| 9 | IO15 | GPIO15, ADC2_CH3, Touch 3, HSPI CS |
| 10 | IO16 | GPIO16, UART RXD2 |
| 11 | IO17 | GPIO17, UART TXD2 |
| 12 | IO18 | GPIO18, VSPI CLK |
| 13 | IO19 | GPIO19, VSPI MISO |
| 14 | IO21 | GPIO21, I2C SDA |
| 15 | IO22 | GPIO22, I2C SCL |
| 16 | IO23 | GPIO23, VSPI MOSI |
| 17 | IO25 | GPIO25, ADC2_CH8, DAC1 |
| 18 | IO26 | GPIO26, ADC2_CH9, DAC2 |
| 19 | IO27 | GPIO27, ADC2_CH7, Touch 7 |
| 20 | IO32 | GPIO32, ADC1_CH4, Touch 9 |
| 21 | IO33 | GPIO33, ADC1_CH5, Touch 8 |
| 22 | IO34 | GPIO34, ADC1_CH6 (input only) |
| 23 | IO35 | GPIO35, ADC1_CH7 (input only) |
| 24 | GND | Ground |
| 25 | 3V3 | 3.3V power output |
| 26 | VIN | Input voltage (5V via USB or external power supply) |
| 27 | TX0 | UART TXD0 (connected to GPIO1) |
| 28 | RX0 | UART RXD0 (connected to GPIO3) |
| 29 | BOOT | Boot mode selection (hold low during reset to enter bootloader mode) |
| 30 | GND | Ground |
Powering the ESP32:
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 blink an LED connected to GPIO2:
// 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
}
ESP32 Not Detected by Computer:
Code Upload Fails:
Wi-Fi Connection Issues:
GPIO Pin Not Working:
Q: Can the ESP32 operate on battery power?
A: Yes, the ESP32 can be powered by a LiPo battery connected to the VIN pin. Use a voltage regulator if necessary.
Q: How do I reset the ESP32?
A: Press the EN (Enable) button to reset the microcontroller.
Q: Can I use the ESP32 with 5V logic devices?
A: No, the ESP32 operates at 3.3V logic. Use level shifters to interface with 5V devices.
Q: What is the maximum current draw of the ESP32?
A: The ESP32 can draw up to 500 mA during peak operation, especially when using Wi-Fi or Bluetooth.