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

How to Use Xiao Samd21: Examples, Pinouts, and Specs

Image of Xiao Samd21
Cirkit Designer LogoDesign with Xiao Samd21 in Cirkit Designer

Introduction

The Xiao SAMD21, manufactured by Seeed, is a compact microcontroller board based on the SAM D21 ARM Cortex-M0+ processor. Designed for low-power applications, it offers a versatile range of I/O options, including digital and analog pins, making it ideal for a variety of embedded systems and IoT projects. Its small form factor and powerful processing capabilities make it a popular choice for developers seeking a balance between performance and size.

Explore Projects Built with Xiao Samd21

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 GSM/GPRS+GPS Tracker with Seeeduino XIAO
Image of SOS System : A project utilizing Xiao Samd21 in a practical application
This circuit features an Ai Thinker A9G development board for GSM/GPRS and GPS/BDS connectivity, interfaced with a Seeeduino XIAO microcontroller for control and data processing. A solar cell, coupled with a TP4056 charging module, charges a 3.3V battery, which powers the system through a 3.3V regulator ensuring stable operation. The circuit likely serves for remote data communication and location tracking, with the capability to be powered by renewable energy and interfaced with additional sensors or input devices via the Seeeduino XIAO.
Cirkit Designer LogoOpen Project in Cirkit Designer
Xiao ESP32 C3 Based Temperature and Humidity Monitoring System
Image of DHT-11: A project utilizing Xiao Samd21 in a practical application
This circuit features a Xiao ESP32 C3 microcontroller connected to a DHT11 Humidity and Temperature Sensor. The ESP32 C3 provides power to the DHT11 sensor through its VUSB pin and receives data from the sensor's DATA pin via the ESP32's D2 pin. The circuit is designed to measure environmental temperature and humidity, with the microcontroller processing and potentially communicating the sensor data.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32C3-Based Environmental and Health Monitoring System with BME280 and MAX30102 Sensors
Image of Petora_protoboard_v1: A project utilizing Xiao Samd21 in a practical application
This circuit features an XIAO ESP32C3 microcontroller interfaced with a BME/BMP280 sensor for environmental data and a MAX30102 sensor for heart rate and oxygen level monitoring. The microcontroller reads data from these sensors via I2C communication and includes a simple program to blink an LED and print a test message to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wi-Fi Controlled Weather Station with Wemos D1 Mini and OLED Display
Image of izdelie_3: A project utilizing Xiao Samd21 in a practical application
This circuit is a weather monitoring system that uses a Wemos D1 Mini microcontroller to read temperature and humidity data from four DHT22 sensors and display the information on an Adafruit OLED screen. The data is also transmitted via WiFi to an MQTT server for remote monitoring. The system is powered by a 2000mAh battery, which is managed by a TP4056 charging module and a Mtiny Power module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Xiao Samd21

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 SOS System : A project utilizing Xiao Samd21 in a practical application
Solar-Powered GSM/GPRS+GPS Tracker with Seeeduino XIAO
This circuit features an Ai Thinker A9G development board for GSM/GPRS and GPS/BDS connectivity, interfaced with a Seeeduino XIAO microcontroller for control and data processing. A solar cell, coupled with a TP4056 charging module, charges a 3.3V battery, which powers the system through a 3.3V regulator ensuring stable operation. The circuit likely serves for remote data communication and location tracking, with the capability to be powered by renewable energy and interfaced with additional sensors or input devices via the Seeeduino XIAO.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of DHT-11: A project utilizing Xiao Samd21 in a practical application
Xiao ESP32 C3 Based Temperature and Humidity Monitoring System
This circuit features a Xiao ESP32 C3 microcontroller connected to a DHT11 Humidity and Temperature Sensor. The ESP32 C3 provides power to the DHT11 sensor through its VUSB pin and receives data from the sensor's DATA pin via the ESP32's D2 pin. The circuit is designed to measure environmental temperature and humidity, with the microcontroller processing and potentially communicating the sensor data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Petora_protoboard_v1: A project utilizing Xiao Samd21 in a practical application
ESP32C3-Based Environmental and Health Monitoring System with BME280 and MAX30102 Sensors
This circuit features an XIAO ESP32C3 microcontroller interfaced with a BME/BMP280 sensor for environmental data and a MAX30102 sensor for heart rate and oxygen level monitoring. The microcontroller reads data from these sensors via I2C communication and includes a simple program to blink an LED and print a test message to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of izdelie_3: A project utilizing Xiao Samd21 in a practical application
Wi-Fi Controlled Weather Station with Wemos D1 Mini and OLED Display
This circuit is a weather monitoring system that uses a Wemos D1 Mini microcontroller to read temperature and humidity data from four DHT22 sensors and display the information on an Adafruit OLED screen. The data is also transmitted via WiFi to an MQTT server for remote monitoring. The system is powered by a 2000mAh battery, which is managed by a TP4056 charging module and a Mtiny Power module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Wearable devices and portable electronics
  • IoT (Internet of Things) applications
  • Robotics and automation systems
  • Data logging and environmental monitoring
  • Prototyping and educational projects

Technical Specifications

The Xiao SAMD21 is packed with features that make it a versatile and efficient microcontroller board. Below are its key technical details:

Key Technical Details

  • Processor: ARM Cortex-M0+ (SAMD21G18, 32-bit, 48 MHz)
  • Flash Memory: 256 KB
  • SRAM: 32 KB
  • Operating Voltage: 3.3V
  • Input Voltage: 5V (via USB) or 3.3V (via external power supply)
  • Digital I/O Pins: 11 (including PWM support)
  • Analog Input Pins: 6 (12-bit ADC)
  • Analog Output Pins: 1 (10-bit DAC)
  • Communication Interfaces: UART, I2C, SPI
  • USB Interface: USB Type-C (supports programming and power supply)
  • Power Consumption: Ultra-low power consumption in sleep mode
  • Dimensions: 20mm x 17.5mm
  • Weight: 1g

Pin Configuration and Descriptions

The Xiao SAMD21 features a total of 14 pins, including power, digital, and analog pins. Below is the pinout description:

Pin Type Description
3V3 Power 3.3V output for powering external components.
GND Power Ground connection.
D0/RX Digital (UART) Digital I/O pin, also serves as UART RX (receive) pin.
D1/TX Digital (UART) Digital I/O pin, also serves as UART TX (transmit) pin.
D2 Digital Digital I/O pin with PWM support.
D3 Digital Digital I/O pin with PWM support.
D4 Digital Digital I/O pin with PWM support.
D5 Digital Digital I/O pin with PWM support.
A0 Analog/Digital Analog input (12-bit ADC) or digital I/O pin.
A1 Analog/Digital Analog input (12-bit ADC) or digital I/O pin.
A2 Analog/Digital Analog input (12-bit ADC) or digital I/O pin.
A3 Analog/Digital Analog input (12-bit ADC) or digital I/O pin.
A4 Analog/Digital Analog input (12-bit ADC) or digital I/O pin.
A5 Analog/Digital Analog input (12-bit ADC) or digital I/O pin.

Usage Instructions

The Xiao SAMD21 is easy to use and can be programmed using the Arduino IDE or other compatible development environments. Below are the steps to get started and some best practices for using the board.

How to Use the Xiao SAMD21 in a Circuit

  1. Powering the Board:

    • Connect the Xiao SAMD21 to your computer using a USB Type-C cable for power and programming.
    • Alternatively, supply 3.3V to the 3V3 pin and connect GND to ground.
  2. Programming the Board:

    • Install the Arduino IDE and add the Seeed SAMD Boards package via the Board Manager.
    • Select "Seeeduino XIAO" as the board in the Arduino IDE.
    • Write your code and upload it to the board using the USB connection.
  3. Connecting Peripherals:

    • Use the digital pins (D0-D5) for digital I/O operations, such as controlling LEDs or reading button states.
    • Use the analog pins (A0-A5) for reading sensor data or generating analog output signals.

Important Considerations and Best Practices

  • Voltage Levels: Ensure all connected peripherals operate at 3.3V logic levels to avoid damaging the board.
  • Pin Current Limits: Do not exceed 7mA per pin to prevent overheating or damage.
  • Sleep Mode: Utilize the low-power sleep mode for battery-powered applications to extend runtime.
  • USB Connection: Use a high-quality USB Type-C cable for reliable power and data transfer.

Example Code for Arduino UNO Compatibility

The following example demonstrates how to blink an LED connected to pin D2 of the Xiao SAMD21:

// Blink an LED connected to pin D2 on the Xiao SAMD21
const int ledPin = 2; // Define the LED pin (D2)

void setup() {
  pinMode(ledPin, OUTPUT); // Set the LED pin as an output
}

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

Troubleshooting and FAQs

Common Issues and Solutions

  1. The board is not recognized by the computer:

    • Ensure the USB cable is not a power-only cable and supports data transfer.
    • Check that the correct board and port are selected in the Arduino IDE.
    • Double-tap the reset button to enter bootloader mode and try uploading the code again.
  2. Code upload fails:

    • Verify that the Xiao SAMD21 is connected to the correct COM port.
    • Ensure the Seeed SAMD Boards package is installed in the Arduino IDE.
    • Check for syntax errors in your code.
  3. Peripherals are not working as expected:

    • Confirm that the peripherals are connected to the correct pins.
    • Check that the voltage and current requirements of the peripherals are within the board's limits.

FAQs

  • Can the Xiao SAMD21 be powered by a battery?
    Yes, you can power the board using a 3.7V LiPo battery connected to the 3V3 and GND pins.

  • Does the Xiao SAMD21 support Wi-Fi or Bluetooth?
    No, the Xiao SAMD21 does not have built-in wireless connectivity. However, you can add wireless modules via UART, I2C, or SPI.

  • What is the maximum current output of the 3V3 pin?
    The 3V3 pin can supply up to 200mA, depending on the input power source.

By following this documentation, you can effectively utilize the Xiao SAMD21 for your projects and troubleshoot common issues with ease.