The Adafruit Metro ESP32-S2 packages the best features of Adafruit’s recent microcontroller boards in a traditional Arduino Uno form factor. The heart of the board, the Espressif ESP32-S2, improves on the ESP line of Wi-Fi-enabled microcontrollers by adding native USB support. The addition of USB mass storage to the platform allows drag-and-drop deployment of Adafruit’s CircuitPython, making the board very easy to program. It also allows the board to act as a USB input device (HID). The form factor allows shields to be added to the Metro, but be aware that all I/O runs at 3.3V. Thus shields designed for the Arduino Uno’s 5V system may not work.
Although the board generally follows the Uno form factor, it sports a number of improvements borrowed from Adafruit’s other boards. For example, there is a LiPoly connector and charge controller, like you’d find on a Feather. Given that Wi-Fi is a major selling point of the board, untethering it further by providing easy battery support is welcome. The board also features a STEMMA QT I2C connector. This 4-pin connector provides power and an I2C interface to sensors and I/O devices available from Adafruit that feature the same connector. The devices are designed to be daisy-chained so you can connect several to the one port on the board (STEMMA QT is compatible with SparkFun’s QWIIC). Adafruit has also placed a NeoPixel RGB LED about where the amber LED on the Arduino Uno would be.
Pin assignments on the ESP32-S2 are much more flexible than you would find on Atmel AVR-based boards like the Uno. Almost any of the general-purpose I/O pins can be connected to a PWM timer, or be made part of an I2C or UART port. Most of the pins can be connected to an ADC channel as well.
To test the board out, I first got it running under Arduino IDE by following the steps in the guide from Adafruit. So long as you’re running at least version 1.8 of Arduino IDE, this is a very easy way to get up and running with the board. You will have to add an Additional Boards Manager URL to your preferences, after which you can download the ESP32 board definitions via the Boards Manager. The first time you upload a sketch to the board you will need to hold the DFU button and press the reset button to get the board ready to receive a sketch. After uploading, you have to press the reset button again to get the sketch to run. Once you’ve successfully uploaded one sketch, however, you can upload and run sketches as normal.
As we’ve come to expect, Adafruit’s documentation for the board is excellent. They have included a long list of example sketches that will install under the File–>Examples menu when you install the board definitions. Many of these sketches run on any ESP32, and any code you have written for prior ESP32 projects will likely run on this board as well. For the novelty of it, I connected a potentiometer to a digital pin and then called analogRead() on it. For good measure I connected an LED to an analog input pin and called analogWrite() on it. Sure enough, it all just worked, with the Arduino IDE redefining pins as necessary so I could dim the LED with the potentiometer.
Installing CircuitPython is a little more work than using the Arduino IDE, but Adafruit provides you with a helpful guide. To start with, you need to install esptool (as an Administrator) so you can upload the UF2 bootloader to the board. The UF2 bootloader will allow you to mount the ESP32-S2 as a USB drive so you can drag and drop firmware onto it. In particular, you can drag and drop CircuitPython (.uf2) and then your code.py files onto it to run them. At the time of writing, Adafruit has put “Welcome to CircuitPython” ahead of “Install CircuitPython” in their step-by-step guide;to avoid a long detour, click ahead and install CircuitPython before learning about it. The installation guide contains code for a test of the Wi-Fi connectivity that is worth running to make sure everything is working as expected.
I expect this board and the other ESP32-S2 boards are going to be very popular (and well supported) for a while. They are easy to use, flexible in their applications, and remarkably inexpensive.
Standout features:
- Runs the UF2 bootloader and CircuitPython natively
- LiPo battery charger is integrated
- Arduino Shield-compatible form factor