The ESP32 - Expansion Board is a versatile add-on module designed to augment the capabilities of the ESP32 microcontroller. It provides additional hardware interfaces and power management features, enabling users to connect a wide range of peripherals and sensors. Common applications include IoT devices, home automation systems, and prototyping for embedded systems.
Pin Number | Function | Description |
---|---|---|
1 | GND | Ground |
2 | 3V3 | 3.3V power supply |
3 | EN | Reset pin (active low) |
4-9 | GPIO 1-6 | General-purpose input/output pins |
10-15 | ADC1_CH0-5 | Analog-to-digital converter 1, channels 0 to 5 |
16-17 | DAC1, DAC2 | Digital-to-analog converter outputs |
18-19 | VP, VN | ADC pre-amplifier positive and negative inputs |
20-21 | TX0, RX0 | UART0 transmit and receive pins |
22-23 | TX1, RX1 | UART1 transmit and receive pins |
24 | 5V | 5V power supply input |
25 | VIN | Raw input voltage supply for the board |
Powering the Board:
Interfacing with Peripherals:
Programming the ESP32:
Q: Can I power the board using the 3V3 pin? A: It is not recommended to power the board through the 3V3 pin as it bypasses the onboard voltage regulator.
Q: How many GPIO pins can be used simultaneously? A: All 22 GPIO pins can be used, but be mindful of the total current draw.
Q: What is the maximum analog input voltage for the ADC pins? A: The maximum voltage for the ADC pins is 3.3V.
Below is an example code snippet for blinking an LED connected to a GPIO pin on the ESP32 - Expansion Board using the Arduino IDE.
// Define the LED pin
const int ledPin = 2; // Use GPIO 2 for the LED
// Setup function runs once when you press reset or power the board
void setup() {
// Initialize the LED pin as an output
pinMode(ledPin, OUTPUT);
}
// Loop function runs over and over again forever
void loop() {
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(1000); // Wait for a second
digitalWrite(ledPin, LOW); // Turn the LED off
delay(1000); // Wait for a second
}
Remember to adjust the ledPin
variable to match the GPIO pin you have connected your LED to. This code will blink the LED on and off every second.