

The ESP32 is a powerful, low-cost microcontroller with built-in Wi-Fi and Bluetooth capabilities. It features 30 pins for various input/output (I/O) functions, making it an excellent choice for Internet of Things (IoT) applications, smart devices, and embedded systems. Its dual-core processor, extensive GPIO options, and support for multiple communication protocols make it versatile for a wide range of projects.








The ESP32 (30 pin) has a variety of pins for power, communication, and I/O. Below is a table summarizing the pin configuration:
| Pin Name | Function | Description |
|---|---|---|
| VIN | Power Input | Input voltage (7-12V) for powering 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 | I/O, Boot Mode Selection | General-purpose I/O, also used for boot mode selection during programming. |
| GPIO1 (TX0) | UART TX | UART0 transmit pin. |
| GPIO3 (RX0) | UART RX | UART0 receive pin. |
| GPIO2 | I/O, ADC, PWM | General-purpose I/O, ADC, or PWM output. |
| GPIO4 | I/O, ADC, PWM | General-purpose I/O, ADC, or PWM output. |
| GPIO5 | I/O, ADC, PWM | General-purpose I/O, ADC, or PWM output. |
| GPIO12-15 | I/O, ADC, PWM, Touch | General-purpose I/O, ADC, PWM, or capacitive touch input. |
| GPIO16-19 | I/O, SPI, ADC, PWM | General-purpose I/O, SPI communication, ADC, or PWM output. |
| GPIO21-23 | I/O, I2C, ADC, PWM | General-purpose I/O, I2C communication, ADC, or PWM output. |
| GPIO25-27 | I/O, ADC, DAC, PWM | General-purpose I/O, ADC, DAC, or PWM output. |
| GPIO32-39 | I/O, ADC, Touch | General-purpose I/O, ADC, or capacitive touch input. |
| TX2/RX2 | UART TX/RX | UART2 transmit and receive pins. |
| BOOT | Boot Mode Selection | Used to enter bootloader mode for programming. |
Note: Some GPIO pins have specific restrictions or are reserved for internal functions. Refer to the ESP32 datasheet for detailed pin behavior.
Powering the ESP32:
Connecting Peripherals:
Programming the ESP32:
Wi-Fi and Bluetooth Setup:
WiFi.h and BluetoothSerial.h) to configure wireless communication.Below is an example of using the ESP32 to connect to a Wi-Fi network and send data to a server:
#include <WiFi.h> // Include the WiFi library
// Replace with your network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";
void setup() {
Serial.begin(115200); // Initialize serial communication
delay(1000);
// Connect to Wi-Fi
Serial.print("Connecting to Wi-Fi");
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nWi-Fi connected!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP()); // Print the ESP32's IP address
}
void loop() {
// Add your main code here
}
Note: Replace
Your_SSIDandYour_PASSWORDwith your Wi-Fi network credentials.
ESP32 Not Connecting to Wi-Fi:
Upload Fails in Arduino IDE:
Unstable Operation or Random Resets:
GPIO Pin Not Working as Expected:
Can the ESP32 operate on battery power? Yes, the ESP32 can be powered by a battery. Use deep sleep mode to extend battery life.
Does the ESP32 support Over-the-Air (OTA) updates? Yes, the ESP32 supports OTA updates, allowing you to upload new firmware wirelessly.
Can I use the ESP32 with 5V logic devices? No, the ESP32 operates at 3.3V logic levels. Use a level shifter if interfacing with 5V devices.
How do I reset the ESP32? Press the EN (enable) button to reset the ESP32.
This documentation provides a comprehensive guide to using the ESP32 (30 pin) microcontroller effectively. For more advanced features, refer to the official ESP32 datasheet and programming guides.