The Metro ESP32-S2 is loaded with all kinds of features. There's lots of pins and ports. Time to take a tour!
There's a lot of power options available on the Metro ESP32-S2, and they're a little different than most Metro/Arduinos
Power Inputs
You have three power input options:
-
USB C port - This is used for both powering and programming the board. You can power it with any USB C cable and will request 5V from a USB C PD.
When USB is plugged in it will charge the Lipoly battery. If there is no battery attached, the yellow LED will flicker (it's looking for a battery!) -
DC barrel jack - The DC Jack is a 5.5mm/2.1mm center-positive DC connector, which is the most common available. Provide about 6V-12V here to power the Metro. Great for when you have a wall adapter power supply. Don't use a center-negative adapter, it won't work (the OK green LED will not light)
When DC power is plugged in it will charge the Lipoly battery. If there is no battery attached, the yellow LED will flicker (it's looking for a battery!)
If both DC and USB are plugged in, the metro will power itself & recharge the battery from whichever is highest -
LiPoly connector/charger - You can plug in any 250mAh or larger 3.7/4.2V Lipoly battery into this JST 2-PH port to both power your Metro and charge the battery. The battery will charge from the USB or DC power (whichever is plugged in and higher voltage), even if the board is powered off via the switch.
If the battery is plugged in and USB or DC is plugged in, the Metro will power itself from USB or DC and it will charge the battery up.
When the battery is charging, the yellow CHG LED will be lit. When charging is complete, the LED will turn off.
Power Control
-
On/Off switch - This switch controls power to the board. If you plug in your board and nothing happens, make sure the switch is flipped to "ON"!
When switched off it will disable the 3.3V power which turns off the ESP32S2 and NeoPixel, but it does not turn off the VHI or VIN pins (see below) and will leave the battery charging.
Power Outputs
- 3.3V - This is the output pin from the 3.3V regulator, you can grab up to 400mA from this regulator for accessories, it's also used by the ESP32S2 which can have spiky current draw.
-
VHI - This pin is usually marked 5V on Arduinos, and when USB or DC is plugged in, it will in fact provide 5V. However, if you have the Metro on LiPo battery power, it will be powered from the battery and thus between 3.7V to 4.2V
When powered from USB or DC it is regulated to 5V, when powered from battery only, it's not regulated, but it is high-current, great for driving servos and NeoPixels. - GND - This is the common ground for all power and logic.
- VIN - This is the higher of the DC jack or USB voltage. So if the DC jack is plugged in and 9V, VIN is 9V. If only USB connected, this will be 5V.
The ESP32-S2 WROVER module.
The ESP32-S2 is a highly-integrated, low-power, 2.4 GHz Wi-Fi System-on-Chip (SoC) solution that now has built-in native USB as well as some other interesting new technologies like Time of Flight distance measurements. With its state-of-the-art power and RF performance, this SoC is an ideal choice for a wide variety of application scenarios relating to the Internet of Things (IoT), wearable electronics, and smart homes.
Please note, this is a single-core 240 MHz chip so it won't be as fast as ESP32's with dual-core. Also, there is no Bluetooth support. However, we are super excited about the ESP32-S2's native USB which unlocks a lot of capabilities for advanced interfacing! This WROVER module comes with 4 MB flash and 2 MB PSRAM.
The 4 MB of flash is inside the module and is used for both program firmware and filesystem storage. For example, in CircuitPython, we have 3 MB set aside for program firmware (this includes two OTA option spots as well) and a 1MB section for CircuitPython scripts and files.
These are the logic pins that can be used to connect shields, sensors, servos, LEDs and more!
No pins are shared, and no pins are 'special' bootstrapping pins, so you can use any of them for input, or output, will pullups or pulldowns, without worry.
ESP32 chips allow for 'multiplexing' of almost all signals so it isn't like some pins can do PWM and others can. You can connect any of the available PWM channels, I2S channels, UART, I2C or SPI ports to any pin. There are some exceptions....
- A0 and A1 are the only DAC output pins. These can be used as 8-bit true analog outputs. No other pins can do so.
-
A0 thru A5, IO5 to IO16 - can also be analog inputs. The labeled SPI port, I2C port and pins 21 and 42 cannot.
IO11 thru IO16 and A0 plus A1 are on ADC2
A2 thru A5 plus IO5 thru IO10 are on ADC1
Check the ESP32-S2 datasheet for the ADC channel names for each pin if you need em! - The 2x3 SPI pins on the right side of the board is on the ESP32 high speed SPI peripheral - you can set any pins to be the low-speed peripheral but you won't get the speedy interface!
- The SDA/SCL I2C pins have 3.3V pullups on them, and are shared with the STEMMA QT port
- Pin 42 is connected to a red LED and is also shared with the JTAG TMS pin. If you happen to be JTAG debugging, this pin will not be available to you.
- Pin 45 is connected to the NeoPixel and is a special bootrstap pin but we only use it as an output so it doesn't matter that there's a pullup/down on it.
- NeoPixel LED - This addressable RGB NeoPixel LED is both a status LED and user controllable on IO45
- LED - This red LED on IO42 is user controllable for blinky needs, it is shared with JTAG TMS and cannot be used if you happen to be JTAG decoding.
- OK LED - This green LED indicates the board is powered on, it is connected to the 3.3V power supply.
- CHG LED - This yellow LED lets you know when the plugged in battery is charging and when it's fully charged. It's normal for this LED to flicker when no battery is in place, that's the charge circuitry trying to detect whether a battery is there or not.
STEMMA QT - This JST SH 4-pin connector breaks out I2C (SCL, SDA, 3.3V, GND). It allows you to connect to various breakouts and sensors with STEMMA QT connectors or to other things using assorted associated accessories.
In CircuitPython, you can use the STEMMA connector with board.SCL
and board.SDA
, or board.STEMMA_I2C()
.
Works great with any STEMMA QT or Qwiic sensor/device
You can also use it with Grove I2C devices thanks to this handy cable
The hardware UART debug port has two broken out pins. You can connect these to a USB console cable in order to read the debug output from the ESP32 IDF. This is useful if you are writing software and need to see the low level debug output without using JTAG debugging.
This is not where default Serial.print()
or CircuitPython print()
outputs go, because those will go through the USB port instead!
- Reset button - The reset button in the top left corner is used to reset the board.
-
DFU button - This is connected to BOOT0 and can be used to put the board into ROM bootloader mode. To enter ROM bootloader mode, hold down DFU button while clicking reset button mentioned above. When in the ROM bootloader, you can upload code and query the chip using
esptool
If you'd like to do more advanced development, trace-debugging, or not use the bootloader, we have the JTAG interface exposed. You'll need to solder an 2x5 1.27mm pitch connector or Mini 2x5 connector to your board. A JLink or similar is needed to perform debugging.
Text editor powered by tinymce.