

The ESP32 is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, featuring 30 pins for various I/O functions. It is widely used in Internet of Things (IoT) applications, embedded systems, and smart devices due to its high performance, low power consumption, and versatile connectivity options. The ESP32 is an excellent choice for projects requiring wireless communication, sensor integration, and real-time data processing.








The ESP32 (30 pin) has a versatile pinout. Below is a table summarizing the key pins and their functions:
| Pin | Name | Function |
|---|---|---|
| 1 | EN | Enable pin. Pull high to enable the chip. |
| 2 | IO0 | GPIO0, used for boot mode selection during programming. |
| 3 | IO1 (TX0) | GPIO1, UART0 TX pin. |
| 4 | IO3 (RX0) | GPIO3, UART0 RX pin. |
| 5 | IO4 | GPIO4, general-purpose I/O. |
| 6 | IO5 | GPIO5, general-purpose I/O. |
| 7 | IO12 | GPIO12, can be used as ADC, touch, or general-purpose I/O. |
| 8 | IO13 | GPIO13, can be used as ADC, touch, or general-purpose I/O. |
| 9 | IO14 | GPIO14, can be used as ADC, touch, or general-purpose I/O. |
| 10 | IO15 | GPIO15, can be used as ADC, touch, or general-purpose I/O. |
| 11 | IO16 | GPIO16, general-purpose I/O. |
| 12 | IO17 | GPIO17, general-purpose I/O. |
| 13 | IO18 | GPIO18, SPI clock (SCK) or general-purpose I/O. |
| 14 | IO19 | GPIO19, SPI MISO or general-purpose I/O. |
| 15 | IO21 | GPIO21, I2C SDA or general-purpose I/O. |
| 16 | IO22 | GPIO22, I2C SCL or general-purpose I/O. |
| 17 | IO23 | GPIO23, SPI MOSI or general-purpose I/O. |
| 18 | IO25 | GPIO25, DAC1 or general-purpose I/O. |
| 19 | IO26 | GPIO26, DAC2 or general-purpose I/O. |
| 20 | IO27 | GPIO27, ADC or general-purpose I/O. |
| 21 | IO32 | GPIO32, ADC or general-purpose I/O. |
| 22 | IO33 | GPIO33, ADC or general-purpose I/O. |
| 23 | IO34 | GPIO34, ADC input only. |
| 24 | IO35 | GPIO35, ADC input only. |
| 25 | GND | Ground. |
| 26 | 3V3 | 3.3V power output. |
| 27 | VIN | Input voltage (5V). |
| 28 | TX2 | UART2 TX pin. |
| 29 | RX2 | UART2 RX pin. |
| 30 | BOOT | Boot mode selection pin. |
Powering the ESP32:
Programming the ESP32:
Connecting Peripherals:
Uploading Code:
Below is an example of using the ESP32 to read a temperature sensor and send data via Wi-Fi:
#include <WiFi.h>
// Replace with your network credentials
const char* ssid = "Your_SSID";
const char* password = "Your_PASSWORD";
void setup() {
Serial.begin(115200); // Initialize serial communication at 115200 baud
WiFi.begin(ssid, password); // Connect to Wi-Fi network
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi!");
}
void loop() {
// Example: Read temperature sensor data (replace with actual sensor code)
float temperature = 25.0; // Placeholder value
Serial.print("Temperature: ");
Serial.println(temperature);
delay(2000); // Wait 2 seconds before the next reading
}
ESP32 Not Connecting to Wi-Fi:
Code Upload Fails:
GPIO Pins Not Working:
pinMode(pin, INPUT/OUTPUT)).Overheating:
Can the ESP32 operate on battery power? Yes, the ESP32 can be powered by a LiPo battery via the VIN pin.
What is the maximum current draw of the ESP32? The ESP32 can draw up to 500 mA during peak operation, so ensure your power supply can handle this.
Can I use the ESP32 with 5V logic devices? No, the ESP32 operates at 3.3V logic. Use level shifters for 5V devices.
This documentation provides a comprehensive guide to using the ESP32 (30 pin) microcontroller effectively in your projects.