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

How to Use Adafruit DS3231 STEMMA QT: Examples, Pinouts, and Specs

Image of Adafruit DS3231 STEMMA QT
Cirkit Designer LogoDesign with Adafruit DS3231 STEMMA QT in Cirkit Designer

Introduction

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.

Explore Projects Built with Adafruit DS3231 STEMMA QT

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Nano-Controlled LED Display with RTC and Humidity Sensing
Image of Alarm Clock: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
This circuit features a Nano 3.0 ATmega328P microcontroller connected to an LED dot display, a real-time clock (RTC DS3231), and a humidity and temperature sensor (SHT21). The microcontroller communicates with the RTC and SHT21 via I2C (using A4 and A5 as SDA and SCL lines, respectively), and it controls the LED display through SPI-like signals (using D10, D11, and D12 for DIN, CS, and CLK). The circuit is designed to display time and environmental data on the LED display, with all components sharing a common power supply and ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino 101 Based Bluetooth-Controlled Dot Matrix Display with RTC Integration
Image of alram clock block diagram: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
This circuit features an Arduino 101 microcontroller connected to a dot matrix LED display, a Real-Time Clock (RTC DS3231), a push switch, and an HC-05 Bluetooth module. The Arduino controls the LED display via SPI (using pins D13/SCK, D11 PWM/MOSI, and D10 PWM/SS) and interfaces with the RTC using I2C (A5/SCL and A4/SDA). The push switch is connected to a digital input (D6), and the Bluetooth module is interfaced through serial communication (D1/TX and D0/RX).
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Real-Time Clock and Dot Matrix Display System
Image of jam: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
This circuit consists of an Arduino UNO microcontroller connected to an RTC DS3231 module for real-time clock functionality and an 8x32 dot matrix display for visual output. The Arduino communicates with the RTC module via I2C protocol and controls the dot matrix display using SPI protocol.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Based Real-Time Clock Display with TM1637
Image of 7segmant: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
This circuit features an Arduino Nano interfacing with a DS3231 Real-Time Clock for timekeeping and a TM1637 display module for visual output. The Arduino facilitates I2C communication with the RTC and controls the display using digital IO, serving as the central processing unit for a digital clock or timer application.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit DS3231 STEMMA QT

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 Alarm Clock: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
Arduino Nano-Controlled LED Display with RTC and Humidity Sensing
This circuit features a Nano 3.0 ATmega328P microcontroller connected to an LED dot display, a real-time clock (RTC DS3231), and a humidity and temperature sensor (SHT21). The microcontroller communicates with the RTC and SHT21 via I2C (using A4 and A5 as SDA and SCL lines, respectively), and it controls the LED display through SPI-like signals (using D10, D11, and D12 for DIN, CS, and CLK). The circuit is designed to display time and environmental data on the LED display, with all components sharing a common power supply and ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of alram clock block diagram: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
Arduino 101 Based Bluetooth-Controlled Dot Matrix Display with RTC Integration
This circuit features an Arduino 101 microcontroller connected to a dot matrix LED display, a Real-Time Clock (RTC DS3231), a push switch, and an HC-05 Bluetooth module. The Arduino controls the LED display via SPI (using pins D13/SCK, D11 PWM/MOSI, and D10 PWM/SS) and interfaces with the RTC using I2C (A5/SCL and A4/SDA). The push switch is connected to a digital input (D6), and the Bluetooth module is interfaced through serial communication (D1/TX and D0/RX).
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of jam: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
Arduino UNO Real-Time Clock and Dot Matrix Display System
This circuit consists of an Arduino UNO microcontroller connected to an RTC DS3231 module for real-time clock functionality and an 8x32 dot matrix display for visual output. The Arduino communicates with the RTC module via I2C protocol and controls the dot matrix display using SPI protocol.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 7segmant: A project utilizing Adafruit DS3231 STEMMA QT in a practical application
Arduino Nano Based Real-Time Clock Display with TM1637
This circuit features an Arduino Nano interfacing with a DS3231 Real-Time Clock for timekeeping and a TM1637 display module for visual output. The Arduino facilitates I2C communication with the RTC and controls the display using digital IO, serving as the central processing unit for a digital clock or timer application.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Timekeeping for data logging applications
  • Scheduling and automation systems
  • Alarms and timers
  • Temperature monitoring
  • Low-power devices requiring accurate timekeeping during power outages (with battery backup)

Technical Specifications

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

Pin Configuration and Descriptions

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)

Usage Instructions

How to Use the Component in a Circuit

  1. Power the Module: Connect the VIN pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Connect I2C Lines: Connect the SDA and SCL pins to the corresponding I2C pins on your microcontroller. For Arduino UNO:
    • SDA connects to A4
    • SCL connects to A5
  3. Optional Battery Backup: Insert a CR1220 coin cell battery into the battery holder to maintain timekeeping during power loss.
  4. Daisy-Chaining: Use the STEMMA QT connectors to easily chain multiple I2C devices.

Important Considerations and Best Practices

  • Ensure the I2C pull-up resistors are present on the bus. Most microcontrollers include these by default.
  • Avoid exceeding the operating voltage range (3.3V to 5V) to prevent damage to the module.
  • Use a CR1220 battery for backup power to maintain timekeeping during power outages.
  • The I2C address of the DS3231 is 0x68 by default. Ensure no other devices on the I2C bus share this address.

Example Code for Arduino UNO

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
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. RTC Not Detected

    • Cause: Incorrect wiring or I2C address conflict.
    • Solution: Verify the SDA and SCL connections. Ensure no other devices on the I2C bus use the 0x68 address.
  2. Incorrect Time

    • Cause: RTC lost power or was not initialized properly.
    • Solution: Check the backup battery. Use the rtc.adjust() function to set the correct time.
  3. Temperature Readings Seem Inaccurate

    • Cause: Operating outside the specified temperature range or environmental interference.
    • Solution: Ensure the module is within the -40°C to +85°C range. Avoid placing the module near heat sources.
  4. Module Not Responding

    • Cause: Insufficient power supply or damaged module.
    • Solution: Verify the power supply voltage (3.3V to 5V). Check for physical damage to the module.

FAQs

  • 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.