

The Adafruit DS3231 STEMMA QT (Part ID: 5188) is a high-precision real-time clock (RTC) module designed for accurate timekeeping. It is based on the DS3231 chip, which features an integrated temperature-compensated crystal oscillator (TCXO) to maintain precise time even under varying environmental conditions. The module communicates via an I2C interface, making it easy to integrate with microcontrollers such as Arduino, Raspberry Pi, and others. Additionally, it includes a built-in temperature sensor for added functionality.








Below are the key technical details of the Adafruit DS3231 STEMMA QT module:
| Parameter | Value |
|---|---|
| Chip | DS3231 |
| Interface | I2C (2-wire) |
| Operating Voltage | 3.3V to 5V |
| Current Consumption | ~200 µA (active), ~3 µA (battery backup) |
| Timekeeping Accuracy | ±2 ppm (0°C to +40°C), ±3.5 ppm (-40°C to +85°C) |
| Temperature Sensor Range | -40°C to +85°C |
| Temperature Sensor Accuracy | ±3°C |
| Backup Battery Support | CR1220 coin cell (not included) |
| Dimensions | 25mm x 25mm x 5mm |
The Adafruit DS3231 STEMMA QT module has the following pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | VIN | Power input (3.3V to 5V) |
| 2 | GND | Ground connection |
| 3 | SDA | I2C data line |
| 4 | SCL | I2C clock line |
| 5 | STEMMA QT | I2C quick-connect ports for daisy-chaining multiple I2C devices (2 connectors) |
0x68 by default. Ensure no other devices on the I2C bus share this address.Below is an example of how to use the Adafruit DS3231 STEMMA QT module with an Arduino UNO. This code reads the current time and temperature from the module.
#include <Wire.h>
#include "RTClib.h" // Adafruit RTC library
RTC_DS3231 rtc; // Create an RTC object
void setup() {
Serial.begin(9600); // Initialize serial communication
Wire.begin(); // Initialize I2C communication
if (!rtc.begin()) {
Serial.println("Couldn't find RTC. Check connections!");
while (1); // Halt execution if RTC is not found
}
if (rtc.lostPower()) {
Serial.println("RTC lost power, setting the time!");
// Set the RTC to the current date and time
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
}
void loop() {
DateTime now = rtc.now(); // Get the current date and time
// Print the current date and time
Serial.print("Date: ");
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(" Time: ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.println(now.second(), DEC);
// Read and print the temperature
float temperature = rtc.getTemperature();
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
delay(1000); // Wait 1 second before repeating
}
RTC Not Detected
0x68 address.Incorrect Time
rtc.adjust() function to set the correct time.Temperature Readings Seem Inaccurate
Module Not Responding
Can I use the module with a 3.3V microcontroller? Yes, the module supports both 3.3V and 5V logic levels.
What happens if the backup battery is not installed? The RTC will lose timekeeping during power outages but will function normally when powered.
Can I use multiple DS3231 modules on the same I2C bus?
No, the DS3231 has a fixed I2C address (0x68), so only one module can be used per I2C bus.
How accurate is the timekeeping? The DS3231 maintains an accuracy of ±2 ppm from 0°C to +40°C, equivalent to about ±1 minute per year.