DS3231 on Adafruit breakout board

Maxim's Integrated I²C Extremely Accurate Real Time Clock with an integrated temperature-compensated crystal oscillator (TCXO) and crystal.


Some quick specs

  • Highly Accurate RTC Completely Manages All Timekeeping Functions
    • Real-Time Clock Counts Seconds, Minutes, Hours, Date of the Month, Month, Day of the Week, and Year, with Leap-Year Compensation Valid Up to 2100
    • Accuracy ±2ppm from 0°C to +40°C
    • Accuracy ±3.5ppm from -40°C to +85°C
    • Digital Temp Sensor Output: ±3°C Accuracy
    • Register for Aging Trim
    • RST Output/Pushbutton Reset Debounce Input
    • Two Time-of-Day Alarms
    • Programmable Square-Wave Output Signal
  • Simple Serial Interface Connects to Most Microcontrollers, Fast (400kHz) I²C Interface
  • Battery-Backup Input for Continuous Timekeeping
    • Low Power Operation Extends Battery-Backup Run Time
    • 3.3V Operation
  • Operating Temperature Ranges: Commercial (0°C to +70°C) and Industrial (-40°C to +85°C
  • Datasheet


Breakout board pinout

    Power pins
  • VDD - This is the positive power and logic level pin. It can be 2.3V to 5.5VVDC, so fine for use with 3 or 5V logic. Power VDD with whatever logic level you plan to use on the i²c lines
  • GND - this is the ground power and logic reference pin

  • I²C Data pins
  • SCL - I²C clock pin. There's a 10K pull-up already on the board, so connect this directly to the i²c master clock pin on your microcontroller
  • SDA - I²C data pin. There's a 10K pull-up already on the board, so connect this directly to the i²c master data pin on your microcontroller

  • Other pins
  • BAT - this is the same connection as the positive pad of the battery. You can use this if you want to power something else from the coin cell, or provide battery backup from a different separate batery. VBat can be between 2.3V and 5.5V and the DS3231 will switch over when main Vin power is lost
  • 32K - 32KHz oscillator output. Open drain, you need to attach a pullup to read this signal from a microcontroller pin
  • SQW - optional square wave or interrupt output. Open drain, you need to attach a pullup to read this signal from a microcontroller pin
  • RST - This one is a little different than most RST pins, rather than being just an input, it is designed to be used to reset an external device or indicate when main power is lost. Open drain, but has an internal 50K pullup. The pullup keeps this pin voltage high as long as Vin is present. When Vin drops and the chip switches to battery backup, the pin goes low


I²C Addressing

The DS3231 has a default I²C address of 0x68 and cannot be changed!


Python

External addresses to Adafruit:
CircuitPython
Python Docs (Adafruit's DS3231 RTC Library)


Schematic