

The Adafruit Adalogger FeatherWing (Manufacturer Part ID: 2922) is a versatile add-on board designed for use with Adafruit Feather microcontrollers. It combines a real-time clock (RTC) and microSD card slot, enabling users to log data with precise timestamps. This makes it an ideal solution for applications requiring data storage and timekeeping, such as environmental monitoring, IoT projects, and sensor data logging.








The Adalogger FeatherWing connects directly to Feather microcontrollers via its headers. Below is the pinout description:
| Pin Name | Description |
|---|---|
| 3V | 3.3V power input/output |
| GND | Ground connection |
| SCL | I2C clock line for RTC communication |
| SDA | I2C data line for RTC communication |
| SDCS | Chip Select (CS) pin for the microSD card interface |
| MOSI | SPI Master Out Slave In (data line for microSD card) |
| MISO | SPI Master In Slave Out (data line for microSD card) |
| SCK | SPI clock line for microSD card communication |
| BAT | Connection for CR1220 coin cell battery to maintain RTC functionality |
Attach the FeatherWing to a Feather Board:
Insert a microSD Card:
Connect a CR1220 Battery (Optional):
Connect to Power:
Program the Feather Board:
Below is an example sketch to log data with timestamps to the microSD card:
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <RTClib.h> // Library for the DS3231 RTC
#include <SD.h> // Library for microSD card
RTC_DS3231 rtc; // Create an RTC object
const int chipSelect = 10; // SD card chip select pin
void setup() {
Serial.begin(9600);
while (!Serial); // Wait for Serial Monitor to open
// Initialize RTC
if (!rtc.begin()) {
Serial.println("Couldn't find RTC");
while (1);
}
// Check if RTC lost power and set the time if needed
if (rtc.lostPower()) {
Serial.println("RTC lost power, setting the time!");
rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); // Set to compile time
}
// Initialize SD card
if (!SD.begin(chipSelect)) {
Serial.println("SD card initialization failed!");
while (1);
}
Serial.println("SD card initialized.");
}
void loop() {
// Get current time from RTC
DateTime now = rtc.now();
// Open a file on the SD card
File dataFile = SD.open("datalog.txt", FILE_WRITE);
// If the file is available, write data to it
if (dataFile) {
dataFile.print("Timestamp: ");
dataFile.print(now.year(), DEC);
dataFile.print('/');
dataFile.print(now.month(), DEC);
dataFile.print('/');
dataFile.print(now.day(), DEC);
dataFile.print(" ");
dataFile.print(now.hour(), DEC);
dataFile.print(':');
dataFile.print(now.minute(), DEC);
dataFile.print(':');
dataFile.println(now.second(), DEC);
dataFile.close(); // Close the file
Serial.println("Data logged.");
} else {
Serial.println("Error opening datalog.txt");
}
delay(1000); // Log data every second
}
RTC Not Detected:
SD Card Initialization Fails:
Data Logging Stops Unexpectedly:
RTC Loses Time After Power Loss:
Can I use this FeatherWing with non-Adafruit Feather boards?
What is the maximum capacity of the microSD card supported?
Do I need to install additional libraries?
RTClib and SD libraries in the Arduino IDE for RTC and SD card functionality.Can I use the RTC without a battery?
This documentation provides a comprehensive guide to using the Adafruit Adalogger FeatherWing for data logging and timekeeping applications.