

The ESP32 is a powerful and versatile microcontroller developed by Espressif Systems. It features integrated Wi-Fi and Bluetooth capabilities, making it an excellent choice for Internet of Things (IoT) applications, smart devices, and embedded systems. With its 30-pin configuration, the ESP32 provides a wide range of input/output (I/O) options, enabling developers to connect sensors, actuators, and other peripherals with ease.








The ESP32 (30-pin variant) has a standard pinout. Below is a table describing the key pins:
| Pin Name | Function | Description |
|---|---|---|
| VIN | Power Input | Accepts 5V input to power the ESP32. |
| GND | Ground | Ground connection. |
| 3V3 | Power Output | Provides 3.3V output for external components. |
| EN | Enable | Enables or disables the chip. Active high. |
| GPIO0 | Input/Output, Boot Mode Select | Used for boot mode selection during programming. |
| GPIO1 (TX0) | UART TX | UART0 transmit pin. |
| GPIO3 (RX0) | UART RX | UART0 receive pin. |
| GPIO2 | Input/Output, ADC, PWM | General-purpose I/O, supports ADC and PWM. |
| GPIO4 | Input/Output, ADC, PWM | General-purpose I/O, supports ADC and PWM. |
| GPIO5 | Input/Output, ADC, PWM | General-purpose I/O, supports ADC and PWM. |
| GPIO12-15 | Input/Output, ADC, PWM, SPI | General-purpose I/O, supports ADC, PWM, and SPI communication. |
| GPIO16-19 | Input/Output, ADC, PWM, I2C | General-purpose I/O, supports ADC, PWM, and I2C communication. |
| GPIO21-23 | Input/Output, ADC, PWM, I2C, SPI | General-purpose I/O, supports ADC, PWM, I2C, and SPI communication. |
| GPIO25-27 | Input/Output, ADC, PWM, DAC | General-purpose I/O, supports ADC, PWM, and DAC (GPIO25 and GPIO26 only). |
| GPIO32-39 | Input/Output, ADC, PWM | General-purpose I/O, supports ADC and PWM. |
| BOOT | Boot Mode Select | Used to enter bootloader mode for programming. |
Note: Some GPIO pins have specific restrictions or are used internally by the ESP32. Refer to the datasheet for detailed pin functionality.
Powering the ESP32:
Connecting Peripherals:
Programming the ESP32:
Using Communication Protocols:
Below is an example of how to blink an LED connected to GPIO2 using the Arduino IDE:
// 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
}
Tip: Replace
GPIO2with the pin number where your LED is connected.
ESP32 Not Detected by Computer:
Upload Fails with Timeout Error:
ESP32 Keeps Resetting:
Wi-Fi Connection Issues:
Q: Can I power the ESP32 with a 5V power supply?
A: Yes, you can power the ESP32 via the VIN pin or the USB port with a 5V supply. However, the GPIO pins operate at 3.3V logic.
Q: How do I use the ESP32's Bluetooth functionality?
A: The ESP32 supports both Bluetooth Classic and BLE. Use the Arduino IDE's Bluetooth libraries or Espressif's ESP-IDF framework to implement Bluetooth functionality.
Q: Can I use the ESP32 with a 5V sensor?
A: Use a level shifter to safely interface 5V sensors with the ESP32's 3.3V GPIO pins.
Q: What is the maximum current the ESP32 can source/sink on a GPIO pin?
A: Each GPIO pin can source/sink up to 12 mA. For higher currents, use an external transistor or driver circuit.
By following this documentation, you can effectively use the ESP32 (30-pin variant) in your projects and troubleshoot common issues with ease.