

The ESP32 is a powerful microcontroller designed for IoT (Internet of Things) applications and embedded systems. It features built-in Wi-Fi and Bluetooth capabilities, making it a versatile choice for wireless communication projects. 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. Its high processing power and low energy consumption make it suitable for applications such as smart home devices, wearables, robotics, and industrial automation.








The ESP32 (30-pin variant) has the following pinout:
| Pin Number | Pin Name | Function |
|---|---|---|
| 1 | EN | Enable pin (active high, resets the chip when pulled low) |
| 2 | IO1 (TX0) | GPIO1, UART0 TX (serial communication) |
| 3 | IO3 (RX0) | GPIO3, UART0 RX (serial communication) |
| 4 | IO4 | GPIO4, supports PWM, ADC, and other functions |
| 5 | IO5 | GPIO5, supports PWM, ADC, and other functions |
| 6 | GND | Ground |
| 7 | IO18 | GPIO18, supports SPI SCK, PWM, and other functions |
| 8 | IO19 | GPIO19, supports SPI MISO, PWM, and other functions |
| 9 | IO21 | GPIO21, supports I2C SDA, PWM, and other functions |
| 10 | IO22 | GPIO22, supports I2C SCL, PWM, and other functions |
| 11 | VIN | Input voltage (5V) |
| 12 | IO23 | GPIO23, supports SPI MOSI, PWM, and other functions |
| 13 | IO25 | GPIO25, supports ADC, PWM, and other functions |
| 14 | IO26 | GPIO26, supports ADC, PWM, and other functions |
| 15 | IO27 | GPIO27, supports ADC, PWM, and other functions |
| 16 | IO32 | GPIO32, supports ADC, PWM, and other functions |
| 17 | IO33 | GPIO33, supports ADC, PWM, and other functions |
| 18 | IO34 | GPIO34, input-only pin, supports ADC |
| 19 | IO35 | GPIO35, input-only pin, supports ADC |
| 20 | GND | Ground |
| 21 | IO12 | GPIO12, supports ADC, PWM, and other functions |
| 22 | IO13 | GPIO13, supports ADC, PWM, and other functions |
| 23 | IO14 | GPIO14, supports ADC, PWM, and other functions |
| 24 | IO15 | GPIO15, supports ADC, PWM, and other functions |
| 25 | IO16 | GPIO16, supports ADC, PWM, and other functions |
| 26 | IO17 | GPIO17, supports ADC, PWM, and other functions |
| 27 | IO2 | GPIO2, supports ADC, PWM, and other functions |
| 28 | IO0 | GPIO0, boot mode selection pin |
| 29 | IO36 | GPIO36, input-only pin, supports ADC |
| 30 | IO39 | GPIO39, input-only pin, supports ADC |
Powering the ESP32:
Programming the ESP32:
Connecting Peripherals:
Uploading Code:
The following example demonstrates how to blink an LED connected to GPIO2:
// Define the GPIO pin for the LED
#define LED_PIN 2
void setup() {
// Set 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:
Code Upload Fails:
Wi-Fi Connection Issues:
Random Resets or Instability:
Q: Can the ESP32 be powered directly with a 3.3V source?
A: Yes, you can power the ESP32 by connecting a 3.3V source to the 3.3V pin.
Q: How do I use the ESP32's Bluetooth functionality?
A: Use the BluetoothSerial library in the Arduino IDE or the ESP-IDF Bluetooth stack to implement Bluetooth communication.
Q: Can I use the ESP32 for battery-powered applications?
A: Yes, the ESP32 supports ultra-low power modes, making it suitable for battery-powered projects.
Q: What is the maximum current draw of the ESP32?
A: The ESP32 can draw up to 500mA during peak operation, especially when using Wi-Fi or Bluetooth.
This concludes the documentation for the ESP32 (30-pin variant).