The Seeed Studio XIAO Logger HAT is a compact and versatile data logging module designed specifically for the Seeed Studio XIAO series of microcontrollers. It features an onboard SD card slot for data storage, a real-time clock (RTC) for precise timekeeping, and multiple sensor interfaces to facilitate environmental data collection. This HAT is ideal for applications requiring reliable data logging, such as environmental monitoring, IoT projects, and scientific experiments.
Explore Projects Built with Seeed Studio XIAO Logger HAT
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
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.
This circuit is a data logging and transmission system that collects environmental and positional data from various sensors (BME/BMP280, HMC5883L, MAX30102, GPS NEO 6M) and records it to an SD card. The data is also sent over WiFi to a specified server using an ESP32 microcontroller.
This circuit is a data logging and communication system powered by a Li-ion battery, featuring an ESP32 microcontroller. It includes sensors (BME280 and MPU-6050) for environmental and motion data, a GPS module for location tracking, and a LoRa radio for long-range communication. The system logs data to a SparkFun OpenLog and is managed by a TP4056 battery charger with power regulation components.
This circuit is a data logging and communication system powered by a Li-ion 18650 battery, featuring an ESP32 microcontroller. It includes sensors (BME280 and MPU-6050) for environmental and motion data, a GPS module for location tracking, and a LoRa radio for long-range communication. The SparkFun OpenLog module is used for data logging, and the TP4056 module manages battery charging.
Environmental data logging (e.g., temperature, humidity, air quality)
IoT-based data collection and storage
Scientific experiments requiring time-stamped data
Prototyping and development of data-driven applications
Educational projects involving real-time data acquisition
Technical Specifications
The following table outlines the key technical details of the Seeed Studio XIAO Logger HAT:
Parameter
Specification
Manufacturer
Seeed Studio
Part Number
XIAO Logger HAT
Dimensions
21 x 17.5 mm
Power Supply Voltage
3.3V (via XIAO microcontroller)
SD Card Slot
MicroSD (up to 32GB, FAT32 format)
RTC
DS3231 (battery-backed real-time clock)
Sensor Interfaces
I2C, UART, and GPIO
Battery Backup
CR1220 coin cell (for RTC, not included)
Operating Temperature
-40°C to 85°C
Pin Configuration and Descriptions
The XIAO Logger HAT connects directly to the Seeed Studio XIAO microcontroller via its pin headers. Below is the pin configuration:
Pin
Name
Description
1
3.3V
Power supply input (from XIAO microcontroller)
2
GND
Ground connection
3
SDA
I2C data line (for RTC and sensors)
4
SCL
I2C clock line (for RTC and sensors)
5
TX
UART transmit line (for external devices)
6
RX
UART receive line (for external devices)
7
GPIO
General-purpose input/output
8
SD_CS
Chip select for the SD card module
Usage Instructions
How to Use the Component in a Circuit
Attach the HAT to the XIAO Microcontroller: Align the pins of the XIAO Logger HAT with the corresponding headers on the Seeed Studio XIAO microcontroller and press them together gently.
Connect Power: Ensure the XIAO microcontroller is powered via USB or an external power source.
Insert an SD Card: Use a FAT32-formatted microSD card (up to 32GB) and insert it into the SD card slot on the HAT.
Connect Sensors: Attach external sensors to the I2C, UART, or GPIO interfaces as needed.
Set Up RTC: Insert a CR1220 coin cell battery into the RTC battery holder to enable timekeeping even when the main power is off.
Important Considerations and Best Practices
SD Card Formatting: Ensure the SD card is formatted to FAT32 before use. Unformatted or incompatible cards may cause errors.
RTC Battery: Use a CR1220 coin cell battery to maintain RTC functionality during power loss.
Sensor Compatibility: Verify that connected sensors are compatible with the I2C or UART interfaces of the XIAO Logger HAT.
Power Supply: Avoid exceeding the 3.3V power supply limit to prevent damage to the HAT or microcontroller.
Code Libraries: Use the appropriate Arduino libraries for SD card and RTC functionality (e.g., SD and RTClib).
Example Code for Arduino UNO
Below is an example Arduino sketch to log temperature data from a sensor to the SD card with a timestamp from the RTC:
#include <Wire.h>
#include <RTClib.h>
#include <SD.h>
// Define SD card chip select pin
const int chipSelect = 10;
// Initialize RTC and SD card objects
RTC_DS3231 rtc;
void setup() {
Serial.begin(9600);
// Initialize SD card
if (!SD.begin(chipSelect)) {
Serial.println("SD card initialization failed!");
while (1);
}
Serial.println("SD card initialized.");
// Initialize RTC
if (!rtc.begin()) {
Serial.println("RTC initialization failed!");
while (1);
}
if (rtc.lostPower()) {
Serial.println("RTC lost power, setting time...");
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
}
void loop() {
// Get current time from RTC
DateTime now = rtc.now();
// Simulate reading temperature from a sensor
float temperature = 25.0; // Replace with actual sensor reading
// Open file on SD card
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
// Write timestamp and temperature to file
dataFile.print(now.timestamp());
dataFile.print(", ");
dataFile.println(temperature);
dataFile.close();
Serial.println("Data logged.");
} else {
Serial.println("Error opening datalog.txt");
}
delay(1000); // Log data every second
}
Troubleshooting and FAQs
Common Issues and Solutions
SD Card Not Detected
Ensure the SD card is properly inserted and formatted to FAT32.
Verify the SD card is compatible (up to 32GB).
Check the SD_CS pin connection and ensure the correct pin is defined in the code.
RTC Not Keeping Time
Confirm that a CR1220 coin cell battery is installed in the RTC battery holder.
Use the rtc.adjust() function to set the correct time if the RTC lost power.
Sensor Data Not Logging
Verify the sensor connections to the I2C or UART pins.
Check that the correct libraries and initialization code for the sensor are included.
Power Issues
Ensure the XIAO microcontroller is receiving sufficient power (via USB or external source).
Avoid exceeding the 3.3V power supply limit.
FAQs
Q: Can I use an SD card larger than 32GB?
A: No, the XIAO Logger HAT supports microSD cards up to 32GB formatted in FAT32.
Q: What happens if the RTC battery is not installed?
A: The RTC will lose timekeeping functionality when the main power is disconnected.
Q: Can I use this HAT with other microcontrollers?
A: The XIAO Logger HAT is designed for the Seeed Studio XIAO series. Compatibility with other microcontrollers may require additional modifications.