

The ESP32 is a powerful and versatile microcontroller designed for IoT (Internet of Things) applications and embedded systems. It features built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for projects requiring wireless communication. With its 30-pin configuration, the ESP32 provides a wide range of GPIO (General Purpose Input/Output) pins, ADC (Analog-to-Digital Converter) channels, PWM (Pulse Width Modulation) outputs, and other peripherals, enabling seamless integration into various electronic designs.








| 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 |
| ADC Channels | 18 (12-bit resolution) |
| PWM Outputs | Multiple (configurable on GPIO pins) |
| Communication Interfaces | UART, SPI, I2C, I2S, CAN, Ethernet |
| Power Consumption (Active) | ~160 mA |
| Deep Sleep Current | ~10 µA |
The ESP32 (30-pin variant) has the following pinout:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | EN | Enable pin (active high) |
| 2 | IO1 (TX0) | GPIO1, UART0 TX |
| 3 | IO3 (RX0) | GPIO3, UART0 RX |
| 4 | IO4 | GPIO4, PWM, ADC |
| 5 | IO5 | GPIO5, PWM, ADC |
| 6 | GND | Ground |
| 7 | IO18 | GPIO18, SPI CLK |
| 8 | IO19 | GPIO19, SPI MISO |
| 9 | IO21 | GPIO21, I2C SDA |
| 10 | IO22 | GPIO22, I2C SCL |
| 11 | IO23 | GPIO23, SPI MOSI |
| 12 | VIN | Power input (3.3V or 5V) |
| 13 | GND | Ground |
| 14 | IO25 | GPIO25, ADC, DAC |
| 15 | IO26 | GPIO26, ADC, DAC |
| 16 | IO27 | GPIO27, ADC |
| 17 | IO32 | GPIO32, ADC |
| 18 | IO33 | GPIO33, ADC |
| 19 | IO34 | GPIO34, ADC (input only) |
| 20 | IO35 | GPIO35, ADC (input only) |
| 21 | IO36 | GPIO36, ADC (input only) |
| 22 | IO39 | GPIO39, ADC (input only) |
| 23 | IO12 | GPIO12, ADC, SPI |
| 24 | IO13 | GPIO13, ADC, SPI |
| 25 | IO14 | GPIO14, ADC, SPI |
| 26 | IO15 | GPIO15, ADC, PWM |
| 27 | IO16 | GPIO16, UART2 TX |
| 28 | IO17 | GPIO17, UART2 RX |
| 29 | 3V3 | 3.3V power output |
| 30 | GND | Ground |
Powering the ESP32:
Connecting Peripherals:
Programming the ESP32:
The following example demonstrates how to blink an LED connected to GPIO2 of the ESP32:
// Define the GPIO pin for the LED
#define LED_PIN 2
void setup() {
// Initialize the LED pin as an output
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// Turn the LED on
digitalWrite(LED_PIN, HIGH);
delay(1000); // Wait for 1 second
// Turn the LED off
digitalWrite(LED_PIN, LOW);
delay(1000); // Wait for 1 second
}
ESP32 Not Detected by the Computer:
Upload Fails in Arduino IDE:
Wi-Fi Connection Issues:
Random Resets or Instability:
Q: Can I use the ESP32 with 5V sensors?
A: The ESP32 operates at 3.3V logic levels. Use a level shifter to interface with 5V sensors.
Q: How do I enable Bluetooth on the ESP32?
A: Use the ESP32 Bluetooth libraries in your code. Refer to the ESP32 documentation for examples.
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 space.
Q: Can I power the ESP32 with a battery?
A: Yes, you can use a LiPo battery with a 3.7V output or a regulated 3.3V source.
This concludes the documentation for the ESP32 (30-pin variant).