

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 developers to connect sensors, actuators, and other peripherals with ease. Its dual-core processor and low-power consumption make it suitable for both high-performance and energy-efficient applications.








The ESP32 (30-pin) 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, I2C, SPI | Multipurpose pins supporting I2C and SPI communication. |
| GPIO21-23 | General Purpose I/O, I2C, SPI | Multipurpose pins supporting I2C and SPI communication. |
| 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. |
| TX2/RX2 | UART TX/RX | Additional UART communication pins. |
| BOOT | Boot Mode Selection | Used for flashing firmware (connect to GND during programming). |
Note: Some pins have multiple functions. Refer to the ESP32 datasheet for detailed pin multiplexing information.
Powering the ESP32:
Programming the ESP32:
Connecting Peripherals:
Wi-Fi and Bluetooth Setup:
Below is an example of using the ESP32 to connect to a Wi-Fi network:
#include <WiFi.h> // Include the Wi-Fi library
const char* ssid = "Your_SSID"; // Replace with your Wi-Fi network name
const char* password = "Your_Password"; // Replace with your Wi-Fi password
void setup() {
Serial.begin(115200); // Initialize serial communication at 115200 baud
delay(1000); // Wait for a second to stabilize
Serial.println("Connecting to Wi-Fi...");
WiFi.begin(ssid, password); // Start Wi-Fi connection
while (WiFi.status() != WL_CONNECTED) {
delay(500); // Wait for connection
Serial.print(".");
}
Serial.println("\nWi-Fi connected!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP()); // Print the assigned IP address
}
void loop() {
// Add your main code here
}
Note: Replace
Your_SSIDandYour_Passwordwith your Wi-Fi credentials.
ESP32 Not Detected by Computer:
Wi-Fi Connection Fails:
Random Resets or Instability:
GPIO Pin Not Working:
Q: Can the ESP32 handle multiple tasks simultaneously?
Q: How do I update the ESP32 firmware?
Q: Can I use the ESP32 with 5V sensors?
Q: What is the maximum Wi-Fi range of the ESP32?
This documentation provides a comprehensive guide to using the ESP32 (30-pin) microcontroller effectively. For more advanced features, refer to the official Espressif documentation.