Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit Metro M4 Express: Examples, Pinouts, and Specs

Image of Adafruit Metro M4 Express
Cirkit Designer LogoDesign with Adafruit Metro M4 Express in Cirkit Designer

Introduction

The Adafruit Metro M4 Express (Manufacturer Part ID: 3382) is a powerful microcontroller board designed for advanced electronics projects. It is based on the Atmel SAMD51 microcontroller, featuring a 120 MHz ARM Cortex-M4 processor with floating-point support, 512 KB of RAM, and 4 MB of onboard flash storage. This board is compatible with both CircuitPython and Arduino IDE, making it versatile for a wide range of applications.

Explore Projects Built with Adafruit Metro M4 Express

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Solar-Powered Environmental Data Logger with Adafruit Feather M0 Express
Image of Lake Thoreau Monitoring Station: A project utilizing Adafruit Metro M4 Express in a practical application
This circuit is designed for environmental data collection and logging, utilizing an Adafruit Feather M0 Express microcontroller as the central processing unit. It interfaces with a BME280 sensor for atmospheric temperature, humidity, and pressure measurements, an SGP30 sensor for monitoring air quality (eCO2 and TVOC), and a STEMMA soil sensor for detecting soil moisture and temperature. The system is powered by a solar panel and a 3.7v LiPo battery, managed by an Adafruit BQ24074 Solar-DC-USB Lipo Charger, and provides easy access to the microcontroller's connections through an Adafruit Terminal Breakout FeatherWing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi 4B-Based Multi-Sensor Interface Hub with GPS and GSM
Image of Rocket: A project utilizing Adafruit Metro M4 Express in a practical application
This circuit features a Raspberry Pi 4B interfaced with an IMX296 color global shutter camera, a Neo 6M GPS module, an Adafruit BMP388 barometric pressure sensor, an MPU-6050 accelerometer/gyroscope, and a Sim800l GSM module for cellular connectivity. Power management is handled by an MT3608 boost converter, which steps up the voltage from a Lipo battery, with a resettable fuse PTC and a 1N4007 diode for protection. The Adafruit Perma-Proto HAT is used for organizing connections and interfacing the sensors and modules with the Raspberry Pi via I2C and GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
ATmega328P-Based Sensor Hub with OLED Display and LIDAR
Image of TILTPCB: A project utilizing Adafruit Metro M4 Express in a practical application
This circuit features an Mtiny Uno ATmega328P microcontroller as its central processing unit, interfacing with a variety of sensors and peripherals. It includes a 0.96" OLED display and an MPU6050 accelerometer/gyroscope for user interface and motion sensing, respectively. The circuit also integrates a TF LUNA LIDAR for distance measurement, a DHT11 sensor for temperature and humidity readings, and uses a 9V battery with a 7805 voltage regulator for power management. Communication with a computer for programming and data exchange is facilitated by an Adafruit FTDI Friend module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Multi-Functional Tracking Device with GPS, GSM, and Wi-Fi Capabilities
Image of Accident Detection: A project utilizing Adafruit Metro M4 Express in a practical application
This circuit features an Arduino UNO as the central microcontroller, interfaced with a GPS NEO 6M module for location tracking, an esp8266 nodemcu for WiFi connectivity, and a SIM900A Mini module for GSM communication capabilities. Additionally, it includes an Adafruit ADXL335 accelerometer for motion sensing, and an LCD display for user interface, whose contrast is controlled by a potentiometer. The Arduino is programmed to coordinate these components, likely for a device that requires location tracking, wireless communication, and motion detection with a user-friendly display.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit Metro M4 Express

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 Lake Thoreau Monitoring Station: A project utilizing Adafruit Metro M4 Express in a practical application
Solar-Powered Environmental Data Logger with Adafruit Feather M0 Express
This circuit is designed for environmental data collection and logging, utilizing an Adafruit Feather M0 Express microcontroller as the central processing unit. It interfaces with a BME280 sensor for atmospheric temperature, humidity, and pressure measurements, an SGP30 sensor for monitoring air quality (eCO2 and TVOC), and a STEMMA soil sensor for detecting soil moisture and temperature. The system is powered by a solar panel and a 3.7v LiPo battery, managed by an Adafruit BQ24074 Solar-DC-USB Lipo Charger, and provides easy access to the microcontroller's connections through an Adafruit Terminal Breakout FeatherWing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Rocket: A project utilizing Adafruit Metro M4 Express in a practical application
Raspberry Pi 4B-Based Multi-Sensor Interface Hub with GPS and GSM
This circuit features a Raspberry Pi 4B interfaced with an IMX296 color global shutter camera, a Neo 6M GPS module, an Adafruit BMP388 barometric pressure sensor, an MPU-6050 accelerometer/gyroscope, and a Sim800l GSM module for cellular connectivity. Power management is handled by an MT3608 boost converter, which steps up the voltage from a Lipo battery, with a resettable fuse PTC and a 1N4007 diode for protection. The Adafruit Perma-Proto HAT is used for organizing connections and interfacing the sensors and modules with the Raspberry Pi via I2C and GPIO pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TILTPCB: A project utilizing Adafruit Metro M4 Express in a practical application
ATmega328P-Based Sensor Hub with OLED Display and LIDAR
This circuit features an Mtiny Uno ATmega328P microcontroller as its central processing unit, interfacing with a variety of sensors and peripherals. It includes a 0.96" OLED display and an MPU6050 accelerometer/gyroscope for user interface and motion sensing, respectively. The circuit also integrates a TF LUNA LIDAR for distance measurement, a DHT11 sensor for temperature and humidity readings, and uses a 9V battery with a 7805 voltage regulator for power management. Communication with a computer for programming and data exchange is facilitated by an Adafruit FTDI Friend module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Accident Detection: A project utilizing Adafruit Metro M4 Express in a practical application
Arduino UNO Based Multi-Functional Tracking Device with GPS, GSM, and Wi-Fi Capabilities
This circuit features an Arduino UNO as the central microcontroller, interfaced with a GPS NEO 6M module for location tracking, an esp8266 nodemcu for WiFi connectivity, and a SIM900A Mini module for GSM communication capabilities. Additionally, it includes an Adafruit ADXL335 accelerometer for motion sensing, and an LCD display for user interface, whose contrast is controlled by a potentiometer. The Arduino is programmed to coordinate these components, likely for a device that requires location tracking, wireless communication, and motion detection with a user-friendly display.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Robotics and automation systems
  • Data logging and IoT (Internet of Things) devices
  • Audio processing and DSP (Digital Signal Processing)
  • Educational projects and prototyping
  • High-performance embedded systems

Technical Specifications

The Adafruit Metro M4 Express is packed with features that make it suitable for demanding applications. Below are its key technical details:

Key Technical Details

Specification Value
Microcontroller Atmel SAMD51 (ARM Cortex-M4, 120 MHz)
RAM 512 KB
Flash Storage 4 MB onboard QSPI
Operating Voltage 3.3 V
Input Voltage (VIN) 6-12 V
Digital I/O Pins 25 (with 12 PWM outputs)
Analog Input Pins 6 (12-bit ADC)
Analog Output Pins 1 (10-bit DAC)
Communication Interfaces UART, I2C, SPI, CAN, USB
USB Support USB-C (with native USB support)
CircuitPython Compatibility Yes
Arduino IDE Compatibility Yes
Dimensions 71.1 mm x 53.3 mm

Pin Configuration and Descriptions

The Adafruit Metro M4 Express features a standard Arduino-compatible pinout. Below is a detailed description of its pins:

Pin Name Type Description
VIN Power Input External power input (6-12 V)
3.3V Power Output Regulated 3.3 V output
GND Ground Ground connection
A0-A5 Analog Input 12-bit ADC pins for analog signals
D0-D13 Digital I/O General-purpose digital I/O pins
PWM Pins Digital I/O D2, D3, D5, D6, D9, D10, D11 (PWM capable)
SDA I2C Data I2C data line
SCL I2C Clock I2C clock line
TX UART TX UART transmit line
RX UART RX UART receive line
DAC0 Analog Output 10-bit DAC for analog signal generation
USB-C USB Interface USB-C port for programming and power
RESET Reset Resets the microcontroller

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Board:

    • Connect the board to a computer or USB power source using the USB-C port.
    • Alternatively, supply 6-12 V to the VIN pin for external power.
  2. Programming the Board:

    • Install the required drivers and software for CircuitPython or Arduino IDE.
    • For Arduino IDE, install the Adafruit SAMD Boards package via the Board Manager.
    • For CircuitPython, copy the CircuitPython firmware to the board's USB drive.
  3. Connecting Peripherals:

    • Use the digital and analog pins to connect sensors, actuators, and other peripherals.
    • For I2C devices, connect to the SDA and SCL pins.
    • For SPI devices, use the MOSI, MISO, and SCK pins.
  4. Uploading Code:

    • In Arduino IDE, select "Adafruit Metro M4 Express" as the board and upload your sketch.
    • For CircuitPython, save your Python script as code.py on the board's USB drive.

Important Considerations and Best Practices

  • Voltage Levels: The board operates at 3.3 V logic levels. Ensure connected peripherals are compatible with 3.3 V to avoid damage.
  • Power Supply: When using VIN, ensure the input voltage is within the 6-12 V range.
  • Heat Management: The SAMD51 processor can get warm during intensive tasks. Ensure proper ventilation if running the board at high loads.
  • Firmware Updates: Regularly check for firmware updates from Adafruit to ensure compatibility and access to new features.

Example Code for Arduino IDE

Below is an example of how to blink an LED connected to pin D13:

// Blink an LED on pin D13
void setup() {
  pinMode(13, OUTPUT); // Set pin D13 as an output
}

void loop() {
  digitalWrite(13, HIGH); // Turn the LED on
  delay(1000);            // Wait for 1 second
  digitalWrite(13, LOW);  // Turn the LED off
  delay(1000);            // Wait for 1 second
}

Example Code for CircuitPython

Below is an example of how to blink the onboard LED using CircuitPython:

import board
import digitalio
import time

Configure the onboard LED (connected to D13)

led = digitalio.DigitalInOut(board.D13) led.direction = digitalio.Direction.OUTPUT

while True: led.value = True # Turn the LED on time.sleep(1) # Wait for 1 second led.value = False # Turn the LED off time.sleep(1) # Wait for 1 second


Troubleshooting and FAQs

Common Issues and Solutions

  1. Board Not Recognized by Computer:

    • Ensure the USB-C cable is data-capable (not just for charging).
    • Check that the board is in bootloader mode by double-pressing the reset button.
  2. Code Not Running:

    • Verify that the correct board is selected in the Arduino IDE.
    • For CircuitPython, ensure the script is named code.py and placed in the root directory.
  3. Peripheral Not Responding:

    • Double-check wiring and ensure the peripheral operates at 3.3 V logic levels.
    • Verify that the correct pins are used in the code.
  4. Overheating:

    • Avoid running the board at maximum load for extended periods without proper ventilation.
    • Check for short circuits or excessive current draw from connected peripherals.

FAQs

Q: Can I use 5 V peripherals with the Metro M4 Express?
A: No, the Metro M4 Express operates at 3.3 V logic levels. Use a level shifter for 5 V peripherals.

Q: How do I reset the board to factory settings?
A: Double-press the reset button to enter bootloader mode, then reflash the firmware.

Q: Is the Metro M4 Express compatible with Arduino shields?
A: Yes, it has an Arduino-compatible pinout, but ensure the shield operates at 3.3 V.

Q: Can I use the Metro M4 Express for machine learning applications?
A: Yes, the SAMD51's powerful processor and floating-point support make it suitable for lightweight ML tasks.

Q: Where can I find additional libraries and examples?
A: Visit the Adafruit Metro M4 Express product page for libraries, tutorials, and resources.