DS3231 RTC module
Accurate real-time clock with a temperature-compensated crystal and coin-cell backup.
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.
A temperature-compensated crystal oscillator keeps accurate time, adjusted every 64 seconds for temperature.
Key specifications
| Sensor spec | Value |
|---|---|
| Measures | Time and date (plus chip temperature) |
| Accuracy | ±2 ppm (about 1 minute a year) 0 to 40 °C |
| Interface | I2C |
| I2C address | 0x68 (EEPROM at 0x57 on most modules) |
| Supply voltage | 2.3 to 5.5 V |
Pinout
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
Builds that use it
Medicine reminder pill box
Power cut logger
Room temperature and humidity logger with SD card
Automatic poultry feeder
Vertical farm LED light scheduler
Seedling height tracker
Custom tune doorbell
Hall sensor door position logger
Alternatives
- DS1307 RTC ICCheaper but drifts several seconds a day
- PCF8563 RTCLow-power RTC for battery projects
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.
