Components / Sensors / DS3231 RTC module

DS3231 RTC module

Accurate real-time clock with a temperature-compensated crystal and coin-cell backup.

MeasuresTime and date (plus chip temperature)
Accuracy±2 ppm (about 1 minute a year) 0 to 40 °C
InterfaceI2C
I2C address0x68 (EEPROM at 0x57 on most modules)
SensorsReviewedMPN DS3231Used in 149 projects
DS3231
In short

What is the DS3231 RTC module and what is it used for?

Accurate real-time clock with a temperature-compensated crystal and coin-cell backup. Makers use it for clocks, timed watering, data logging.

How it works

A temperature-compensated crystal oscillator keeps accurate time, adjusted every 64 seconds for temperature.

Key specifications

Sensor specValue
MeasuresTime and date (plus chip temperature)
Accuracy±2 ppm (about 1 minute a year) 0 to 40 °C
InterfaceI2C
I2C address0x68 (EEPROM at 0x57 on most modules)
Supply voltage2.3 to 5.5 V

Pinout

32K32 kHz output
SQWSquare wave or alarm interrupt
SCLI2C clock
SDAI2C data
VCC2.3 to 5.5 V
GNDGround

How to use it

Use the RTClib library at address 0x68. Set the time once from your computer, then the coin cell keeps it running. Many modules try to charge the cell through a diode and resistor, which is unsafe for a non-rechargeable CR2032: remove the resistor or use an LIR2032.

Applications

Alternatives

Buy at

Common questions

What is the DS3231 RTC module used for?

In maker projects: clocks, timed watering, data logging.

How does the DS3231 RTC module work?

A temperature-compensated crystal oscillator keeps accurate time, adjusted every 64 seconds for temperature.

What voltage does the DS3231 RTC module need?

2.3 to 5.5 V.

How do I connect the DS3231 RTC module to an Arduino or ESP32?

I2C. Pins: 32K (32 kHz output), SQW (Square wave or alarm interrupt), SCL (I2C clock), SDA (I2C data), VCC (2.3 to 5.5 V), GND (Ground).

What can I use instead of the DS3231 RTC module?

DS1307 RTC IC and PCF8563 RTC.