The ESP32 (30 pin) is a powerful microcontroller designed for IoT (Internet of Things) applications and embedded systems. It features built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for wireless communication projects. With its 30 GPIO pins, the ESP32 offers a wide range of input/output functions, including ADC, DAC, PWM, I2C, SPI, UART, and more. Its versatility and high performance make it a popular choice among hobbyists and professionals alike.
The ESP32 (30 pin) has the following pinout:
Pin Name | Function | Description |
---|---|---|
VIN | Power Input | Input voltage (7-12V) for powering the ESP32. |
GND | Ground | Ground connection. |
3V3 | Power Output | 3.3V output for powering external components. |
EN | Enable | Enables or disables the chip. Active high. |
IO0 | GPIO0 / Boot Mode | General-purpose I/O pin. Used for boot mode selection during programming. |
IO2 | GPIO2 | General-purpose I/O pin. |
IO4 | GPIO4 | General-purpose I/O pin. |
IO5 | GPIO5 | General-purpose I/O pin. |
IO12 | GPIO12 / ADC2_CH5 | General-purpose I/O pin with ADC functionality. |
IO13 | GPIO13 / ADC2_CH4 | General-purpose I/O pin with ADC functionality. |
IO14 | GPIO14 / ADC2_CH6 / HSPI_CLK | General-purpose I/O pin with SPI clock functionality. |
IO15 | GPIO15 / ADC2_CH3 / HSPI_CS | General-purpose I/O pin with SPI chip select functionality. |
IO16 | GPIO16 | General-purpose I/O pin. |
IO17 | GPIO17 | General-purpose I/O pin. |
IO18 | GPIO18 / VSPI_CLK | General-purpose I/O pin with SPI clock functionality. |
IO19 | GPIO19 / VSPI_MISO | General-purpose I/O pin with SPI MISO functionality. |
IO21 | GPIO21 / I2C SDA | General-purpose I/O pin with I2C data functionality. |
IO22 | GPIO22 / I2C SCL | General-purpose I/O pin with I2C clock functionality. |
IO23 | GPIO23 / VSPI_MOSI | General-purpose I/O pin with SPI MOSI functionality. |
IO25 | GPIO25 / DAC1 / ADC2_CH8 | General-purpose I/O pin with DAC and ADC functionality. |
IO26 | GPIO26 / DAC2 / ADC2_CH9 | General-purpose I/O pin with DAC and ADC functionality. |
IO27 | GPIO27 / ADC2_CH7 | General-purpose I/O pin with ADC functionality. |
IO32 | GPIO32 / ADC1_CH4 | General-purpose I/O pin with ADC functionality. |
IO33 | GPIO33 / ADC1_CH5 | General-purpose I/O pin with ADC functionality. |
IO34 | GPIO34 / ADC1_CH6 | Input-only pin with ADC functionality. |
IO35 | GPIO35 / ADC1_CH7 | Input-only pin with ADC functionality. |
Powering the ESP32:
Connecting Peripherals:
Programming the ESP32:
Uploading Code:
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
}
ESP32 Not Detected by Computer:
Code Upload Fails:
Wi-Fi Connection Issues:
GPIO Pin Not Working:
Q: Can the ESP32 operate on 5V logic?
A: No, the ESP32 operates on 3.3V logic. Use a level shifter for 5V devices.
Q: How do I reset the ESP32?
A: Press the EN (Enable) button to reset the ESP32.
Q: Can I use the ESP32 with a LiPo battery?
A: Yes, you can connect a LiPo battery to the VIN pin, but ensure the voltage is within the acceptable range (7-12V).
Q: What is the maximum current the GPIO pins can source/sink?
A: Each GPIO pin can source/sink up to 12 mA safely.
This concludes the documentation for the ESP32 (30 pin).