The ESP32 is a powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities, making it an excellent choice for IoT (Internet of Things) applications and embedded systems. 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 interfaces such as UART, SPI, and I2C. Its versatility and high performance make it suitable for projects ranging from home automation to industrial control 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, resets the chip when pulled low)
2
IO1
GPIO1, UART TXD0
3
IO3
GPIO3, UART RXD0
4
IO4
GPIO4, ADC2_CH0, Touch 0
5
IO5
GPIO5, ADC2_CH1, Touch 1
6
IO12
GPIO12, ADC2_CH5, Touch 5, HSPI MISO
7
IO13
GPIO13, ADC2_CH4, Touch 4, HSPI MOSI
8
IO14
GPIO14, ADC2_CH6, Touch 6, HSPI CLK
9
IO15
GPIO15, ADC2_CH3, Touch 3, HSPI CS
10
IO16
GPIO16, UART RXD2
11
IO17
GPIO17, UART TXD2
12
IO18
GPIO18, VSPI CLK
13
IO19
GPIO19, VSPI MISO
14
IO21
GPIO21, I2C SDA
15
IO22
GPIO22, I2C SCL
16
IO23
GPIO23, VSPI MOSI
17
IO25
GPIO25, ADC2_CH8, DAC1
18
IO26
GPIO26, ADC2_CH9, DAC2
19
IO27
GPIO27, ADC2_CH7, Touch 7
20
IO32
GPIO32, ADC1_CH4, Touch 9
21
IO33
GPIO33, ADC1_CH5, Touch 8
22
IO34
GPIO34, ADC1_CH6 (input only)
23
IO35
GPIO35, ADC1_CH7 (input only)
24
GND
Ground
25
3V3
3.3V power output
26
VIN
Input voltage (5V via USB or external power supply)
27
TX0
UART TXD0 (connected to GPIO1)
28
RX0
UART RXD0 (connected to GPIO3)
29
BOOT
Boot mode selection (hold low during reset to enter bootloader mode)
30
GND
Ground
Usage Instructions
How to Use the ESP32 in a Circuit
Powering the ESP32:
Use a 5V USB connection or supply 3.3V directly to the VIN pin. Ensure the power source can provide sufficient current (at least 500 mA).
Connect the GND pin to the ground of your circuit.
Programming the ESP32:
Install the ESP32 board package in the Arduino IDE or use the ESP-IDF (Espressif IoT Development Framework) for advanced development.
Connect the ESP32 to your computer via a USB cable.
Select the correct board and port in the Arduino IDE, then upload your code.
Connecting Peripherals:
Use GPIO pins for digital input/output.
Connect sensors to ADC pins for analog input.
Use I2C (SDA and SCL) or SPI pins for communication with external devices.
Wi-Fi and Bluetooth Setup:
Use the built-in libraries (WiFi.h and BluetoothSerial.h) to configure wireless communication.
Example Code: Blinking an LED
The following example demonstrates how to blink an LED connected to GPIO2:
// Define the GPIO pin where the LED is connected
const int ledPin = 2;
void setup() {
// Set the LED pin as an output
pinMode(ledPin, OUTPUT);
}
void loop() {
// Turn the LED on
digitalWrite(ledPin, HIGH);
delay(1000); // Wait for 1 second
// Turn the LED off
digitalWrite(ledPin, LOW);
delay(1000); // Wait for 1 second
}
Important Considerations
Avoid applying more than 3.3V to GPIO pins to prevent damage.
Use level shifters when interfacing with 5V devices.
Ensure proper grounding to avoid noise and instability in your circuit.
Use pull-up or pull-down resistors for input pins as needed.
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:
Hold the BOOT button while uploading the code to enter bootloader mode.
Check that the correct board and port are selected in the Arduino IDE.
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 (ESP32 does not support 5 GHz).
GPIO Pin Not Working:
Check if the pin is being used for another function (e.g., ADC, UART).
Avoid using pins reserved for internal functions (e.g., GPIO6–GPIO11 for flash memory).
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 (Enable) button to reset the microcontroller.
Q: Can I use the ESP32 with 5V logic devices?
A: No, the ESP32 operates at 3.3V logic. Use level shifters to interface with 5V devices.
Q: What is the maximum current draw of the ESP32?
A: The ESP32 can draw up to 500 mA during peak operation, especially when using Wi-Fi or Bluetooth.