The ESP32 is a powerful microcontroller developed by Espressif Systems, featuring built-in Wi-Fi and Bluetooth capabilities. With its 30-pin configuration, the ESP32 offers a wide range of GPIO (General Purpose Input/Output) pins, ADC (Analog-to-Digital Converter) channels, PWM (Pulse Width Modulation) outputs, and communication protocols such as UART, SPI, and I2C. This makes it an ideal choice for IoT (Internet of Things) applications, smart devices, and embedded systems.
Explore Projects Built with ESP32 (30 pin)
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit features two ESP32 microcontrollers, one standard 30-pin version and one ESP32-CAM module, both sharing a common ground and power supply. The 30-pin ESP32 is interfaced with an I2C LCD 16x2 Screen for display purposes, using its I2C pins (D21 for SDA and D22 for SCL), and controls a buzzer connected to pin D23. Additionally, the ESP32-CAM is connected to the 30-pin ESP32 via serial communication through pins TX2 and RX2 for potential image data transfer.
This circuit features an ESP32 Devkit V1 microcontroller connected to a DHT22 temperature and humidity sensor and a water flow sensor. The ESP32 reads environmental data from the DHT22 via a digital input pin (D33) and monitors water flow through the water flow sensor connected to another digital input pin (D23). The ESP32 is powered through its VIN pin, and both sensors are powered by the ESP32's 3V3 output, with common ground connections.
This circuit features an ESP32 microcontroller connected to an OLED 1.3" display. The ESP32's GPIO pins 21 and 22 are used for I2C communication (SDA and SCL respectively) with the OLED display. The display is powered by the 5V output from the ESP32, and both devices share a common ground.
This circuit features an ESP32 microcontroller as the central processing unit, interfacing with a DHT11 temperature and humidity sensor, an MPU-6050 accelerometer and gyroscope, an OLED display, and a separate temperature sensor. The ESP32 communicates with the MPU-6050 and the OLED display via I2C (using pins D22 and D21 for SCL and SDA, respectively), reads temperature data from the DHT11 sensor through pin D18, and interfaces with the additional temperature sensor via pin D5. All components share a common power supply connected to the ESP32's Vin pin and a common ground.
The ESP32 (30-pin variant) has the following pinout:
Pin Number
Pin Name
Functionality
1
EN
Enable pin (active high)
2
IO1
GPIO1, UART TX
3
IO3
GPIO3, UART RX
4
IO4
GPIO4, ADC, PWM
5
IO5
GPIO5, ADC, PWM
6
GND
Ground
7
IO6
GPIO6 (used for flash memory)
8
IO7
GPIO7 (used for flash memory)
9
IO8
GPIO8 (used for flash memory)
10
IO9
GPIO9 (used for flash memory)
11
IO10
GPIO10 (used for flash memory)
12
IO11
GPIO11 (used for flash memory)
13
IO12
GPIO12, ADC, PWM
14
IO13
GPIO13, ADC, PWM
15
IO14
GPIO14, ADC, PWM
16
IO15
GPIO15, ADC, PWM
17
IO16
GPIO16, ADC, PWM
18
IO17
GPIO17, ADC, PWM
19
IO18
GPIO18, SPI CLK
20
IO19
GPIO19, SPI MISO
21
IO21
GPIO21, I2C SDA
22
IO22
GPIO22, I2C SCL
23
IO23
GPIO23, SPI MOSI
24
VIN
Power input (3.3V)
25
3V3
3.3V output
26
GND
Ground
27
IO25
GPIO25, ADC, PWM
28
IO26
GPIO26, ADC, PWM
29
IO27
GPIO27, ADC, PWM
30
IO32
GPIO32, ADC, PWM
Usage Instructions
How to Use the ESP32 in a Circuit
Powering the ESP32:
Use a USB cable to power the ESP32 via the micro-USB port (5V input).
Alternatively, supply 3.3V directly to the VIN pin. Ensure the power source is stable.
Connecting GPIO Pins:
Use GPIO pins for digital input/output, PWM, or ADC as required.
Avoid exceeding the 3.3V logic level on GPIO pins to prevent damage.
Programming the ESP32:
Install the ESP32 board package in the Arduino IDE or use the ESP-IDF framework.
Connect the ESP32 to your computer via USB and select the correct COM port.
Uploading Code:
Write your code in the Arduino IDE or ESP-IDF.
Click the upload button to flash the code to the ESP32.
Example Code for Arduino UNO Integration
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() {
// Set the LED pin as an output
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// Turn the LED on
digitalWrite(LED_PIN, HIGH);
delay(1000); // Wait for 1 second
// Turn the LED off
digitalWrite(LED_PIN, LOW);
delay(1000); // Wait for 1 second
}
Important Considerations and Best Practices
Use a level shifter if interfacing with 5V logic devices.
Avoid using GPIO6–GPIO11 for general purposes as they are connected to the flash memory.
Use decoupling capacitors near the power pins to ensure stable operation.
When using Wi-Fi or Bluetooth, ensure proper antenna placement to avoid interference.
Troubleshooting and FAQs
Common Issues and Solutions
ESP32 Not Detected by Computer:
Ensure the USB cable is functional and supports data transfer.
Install the correct USB-to-serial driver for your operating system.
Code Upload Fails:
Check the COM port and board settings in the Arduino IDE.
Press and hold the "BOOT" button on the ESP32 while uploading the code.
Wi-Fi Connection Issues:
Verify the SSID and password in your code.
Ensure the router is within range and supports 2.4 GHz Wi-Fi.
Overheating:
Check for short circuits or excessive current draw.
Ensure proper ventilation and avoid overclocking.
FAQs
Q: Can the ESP32 operate on battery power?
A: Yes, the ESP32 can be powered by a LiPo battery connected to the VIN pin. Use a voltage regulator if necessary.
Q: How do I reset the ESP32?
A: Press the "EN" button on the board to reset the ESP32.
Q: Can I use the ESP32 with 5V sensors?
A: Yes, but you must use a level shifter to convert 5V signals to 3.3V.
Q: What is the maximum current output of the GPIO pins?
A: Each GPIO pin can source or sink up to 12 mA safely.