

The ESP32 is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for Internet of Things (IoT) applications and embedded systems. With its 30-pin configuration, the ESP32 offers a wide range of input/output (I/O) options, enabling seamless integration with sensors, actuators, and other peripherals. Its dual-core processor and low-power consumption make it suitable for both high-performance and energy-efficient designs.








The ESP32 (30-pin variant) has a versatile pinout. Below is a table summarizing the key pins and their functions:
| Pin Name | Function | Description |
|---|---|---|
| VIN | Power Input | Accepts 5V input to power the ESP32. |
| GND | Ground | Common ground for the circuit. |
| 3V3 | Power Output | Provides 3.3V output for external components. |
| EN | Enable | Enables or disables the chip (active high). |
| GPIO0 | General Purpose I/O, Boot Mode | Used for boot mode selection during programming. |
| GPIO1 (TX0) | UART TX | UART transmit pin (used for serial communication). |
| GPIO3 (RX0) | UART RX | UART receive pin (used for serial communication). |
| GPIO2 | General Purpose I/O, ADC, PWM | Multipurpose pin with ADC and PWM capabilities. |
| GPIO4 | General Purpose I/O, ADC, PWM | Multipurpose pin with ADC and PWM capabilities. |
| GPIO5 | General Purpose I/O, ADC, PWM | Multipurpose pin with ADC and PWM capabilities. |
| GPIO12-15 | General Purpose I/O, ADC, PWM | Multipurpose pins with ADC and PWM capabilities. |
| GPIO16-19 | General Purpose I/O, SPI, I2C | Multipurpose pins supporting SPI and I2C communication. |
| GPIO21-23 | General Purpose I/O, I2C, PWM | Multipurpose pins supporting I2C and PWM functionalities. |
| GPIO25-27 | General Purpose I/O, ADC, DAC, PWM | Multipurpose pins with ADC, DAC, and PWM capabilities. |
| GPIO32-39 | General Purpose I/O, ADC, Touch | Multipurpose pins with ADC and capacitive touch sensing capabilities. |
| TXD0, RXD0 | UART Communication | Default UART pins for serial communication. |
| BOOT | Boot Mode Selection | Used to enter bootloader mode for programming. |
Note: Some pins have multiple functions. Refer to the ESP32 datasheet for detailed pin multiplexing information.
Powering the ESP32:
Connecting Peripherals:
Programming the ESP32:
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() {
pinMode(LED_PIN, OUTPUT); // Set GPIO2 as an output pin
}
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
}
Tip: Replace
LED_PINwith the GPIO number where your LED is connected.
ESP32 Not Detected by Computer:
Upload Fails in Arduino IDE:
Wi-Fi Connection Issues:
Random Resets or Instability:
Q: Can I power the ESP32 with a 5V battery?
A: Yes, you can connect a 5V battery to the VIN pin. Ensure the battery provides a stable voltage.
Q: How do I use the ESP32's Bluetooth functionality?
A: Use the BluetoothSerial library in the Arduino IDE to implement Bluetooth communication.
Q: Can I use the ESP32 with 5V sensors?
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 to reset the ESP32.
By following this documentation, you can effectively utilize the ESP32 (30-pin variant) in your projects. For advanced features, refer to the official ESP32 datasheet and programming guides.