Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit Metro ESP32-S2: Examples, Pinouts, and Specs

Image of Adafruit Metro ESP32-S2Design with Adafruit Metro ESP32-S2 in Cirkit Designer

Introduction

The Adafruit Metro ESP32-S2 is a versatile and powerful development board that harnesses the capabilities of the ESP32-S2 chip. This board is designed for a wide range of applications, from Internet of Things (IoT) projects to complex wireless communication systems. With built-in Wi-Fi, USB connectivity, and an extensive array of General Purpose Input/Output (GPIO) pins, the Metro ESP32-S2 is a go-to choice for hobbyists and professionals alike.

Explore Projects Built with Adafruit Metro ESP32-S2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ESP32-Based Environmental Monitoring System with Motion Detection: A project utilizing Adafruit Metro ESP32-S2 in a practical application
ESP32-Based Environmental Monitoring System with Motion Detection

This circuit features an ESP32 microcontroller on a baseboard that interfaces with a PIR sensor for motion detection, a DHT22 sensor for measuring temperature and humidity, and a BH1750 sensor for detecting ambient light levels. The ESP32 is configured to communicate with the BH1750 using I2C protocol, with GPIO22 and GPIO21 serving as the SCL and SDA lines, respectively. Power is supplied to the sensors from the ESP32's voltage output pins, and sensor outputs are connected to designated GPIO pins for data acquisition.

Open Project in Cirkit Designer
Image of ESP32-Based Environmental Monitoring and Alert System with Solar Charging: A project utilizing Adafruit Metro ESP32-S2 in a practical application
ESP32-Based Environmental Monitoring and Alert System with Solar Charging

This circuit features an ESP32 Devkit V1 microcontroller connected to various sensors and modules for monitoring and communication purposes. It includes an MQ-2 gas sensor and a DHT11 temperature and humidity sensor, both interfaced with the ESP32 for environmental data collection. The circuit is powered by a 12V battery, regulated to 5V by step-down converters, and includes a solar charge controller connected to a solar panel for battery charging, a UPS module for power management, and a SIM900A module for GSM communication. Additionally, there is a WS2812 RGB LED strip for visual feedback and a piezo buzzer for audio alerts, both controlled by the ESP32.

Open Project in Cirkit Designer
Image of ESP32-Based Environmental Monitoring System with NeoPixel Feedback and I2C Sensor Integration: A project utilizing Adafruit Metro ESP32-S2 in a practical application
ESP32-Based Environmental Monitoring System with NeoPixel Feedback and I2C Sensor Integration

This circuit features an ESP32 microcontroller as the central processing unit, interfacing with a variety of sensors and peripherals. It includes an MQ-2 gas sensor, a BH1750 light sensor, multiple Adafruit NeoPixel LED sticks, a DHT22 temperature and humidity sensor, an IR transmitter, and piezo sensors. The ESP32 manages an I2C bus connecting the BH1750 and two LCD displays, controls a stepper motor via a driver module, reads analog signals from the MQ-2 sensor, and drives NeoPixel LEDs and the IR transmitter. The circuit appears to be designed for environmental monitoring and response with visual feedback and actuation capabilities.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Function Description
1 3V3 3.3V power supply pin
2 GND Ground
3-5 GPIO 1, 2, 3 General Purpose Input/Output
6 TX0 UART transmit
7 RX0 UART receive
8-10 GPIO 4, 5, 6 General Purpose Input/Output
11 SDA I2C data line
12 SCL I2C clock line
13-17 GPIO 7-11 General Purpose Input/Output
18 A0 Analog input channel 0
19-34 A1-A16 Analog input channels 1-16
35 VIN Input voltage for battery or unregulated power

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Board: Connect the USB-C cable to the board and a power source, or attach a battery to the VIN pin.
  2. Connecting I/O: Utilize the GPIO pins for digital input/output or PWM. Analog pins can be used for reading analog sensors.
  3. Programming: Use the USB-C connection to program the board with the Arduino IDE or other compatible development environments.

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

Example Code for Arduino UNO

Below is a simple example of how to blink an LED connected to a GPIO pin on the Adafruit Metro ESP32-S2 using the Arduino IDE.

// Define the LED pin
const int LED_PIN = 13; // Use the onboard LED pin

// Setup function runs once at the start
void setup() {
  // Initialize the LED pin as an output
  pinMode(LED_PIN, OUTPUT);
}

// Loop function runs over and over again forever
void loop() {
  digitalWrite(LED_PIN, HIGH);   // Turn the LED on
  delay(1000);                   // Wait for a second
  digitalWrite(LED_PIN, LOW);    // Turn the LED off
  delay(1000);                   // Wait for a second
}

Remember to select the correct board and port in the Arduino IDE before uploading the code to the Adafruit Metro ESP32-S2.

For more complex applications involving Wi-Fi and IoT, refer to the ESP32-S2 specific libraries and examples provided by Adafruit and the ESP32 community.