Mini DS3231 RTC Real-Time Clock Module – I2C with Battery Backup
The Mini DS3231 Real-Time Clock (RTC) Module is a compact, high-precision timekeeping module designed for Arduino, ESP32, Raspberry Pi, and other microcontroller-based projects.
Featuring the DS3231 temperature-compensated real-time clock chip, the module provides accurate tracking of seconds, minutes, hours, days, dates, months, and years. With a suitable backup battery installed, it continues keeping time even when the main power supply is disconnected.
The module communicates through the I2C interface and includes an AT24C32 EEPROM with 32Kbit (4KB) of non-volatile memory for storing configuration data and other small amounts of information.
Its compact design makes it suitable for data logging, automation, digital clocks, and embedded electronic systems requiring reliable timekeeping.
Key Features
-
High-Precision RTC: DS3231 temperature-compensated real-time clock.
-
I2C Communication: Simple two-wire interface for microcontrollers.
-
Battery Backup: Maintains timekeeping during power interruptions when a suitable battery is installed.
-
Calendar Function: Tracks seconds, minutes, hours, day, date, month, and year.
-
Leap-Year Compensation: Automatic calendar adjustment through 2100.
-
Dual Alarms: Two programmable time-based alarms.
-
Square-Wave Output: Programmable frequency output.
-
Integrated Temperature Sensor: Temperature measurement functionality.
-
AT24C32 EEPROM: 32Kbit (4KB) non-volatile memory.
-
Compact Dimensions: 38 × 22 × 14mm.
-
Arduino Compatible: Supports Arduino boards with I2C communication.
-
ESP32 and Raspberry Pi Compatible: Can be used with suitable 3.3V I2C connections.
Technical Specifications
| Parameter |
Specification |
| Product Type |
Real-Time Clock Module |
| RTC Chip |
DS3231 |
| Operating Voltage |
3.3–5.5V DC (listed) |
| Communication Interface |
I2C |
| RTC I2C Address |
0x68 |
| EEPROM Chip |
AT24C32 |
| EEPROM Capacity |
32Kbit (4KB) |
| EEPROM I2C Address |
Typically 0x57, configurable |
| Maximum I2C Speed |
400kHz |
| Clock Accuracy |
±2ppm at 0–40°C |
| Time Format |
12-Hour / 24-Hour |
| Calendar |
Seconds, Minutes, Hours, Day, Date, Month, Year |
| Alarm Functions |
2 Programmable Alarms |
| Square-Wave Frequencies |
1Hz, 1.024kHz, 4.096kHz, 8.192kHz |
| Temperature Sensor |
Integrated |
| Temperature Accuracy |
±3°C |
| Backup Battery Type |
LIR2032 Rechargeable Battery (listed) |
| Module Dimensions |
38 × 22 × 14mm |
| Compatible Platforms |
Arduino, ESP32, Raspberry Pi and Other I2C Controllers |
Note: The DS3231 provides approximately ±2ppm accuracy within the specified temperature range, corresponding to approximately one minute of clock drift per year.
Pin Configuration
| Pin |
Function |
| VCC |
Power Supply Input |
| GND |
Ground |
| SDA |
I2C Serial Data |
| SCL |
I2C Serial Clock |
Arduino UNO Connection Example
| Mini DS3231 Module |
Arduino UNO |
| VCC |
5V |
| GND |
GND |
| SDA |
A4 |
| SCL |
A5 |
ESP32 Connection Example
| Mini DS3231 Module |
ESP32 |
| VCC |
3.3V (if supported by module) |
| GND |
GND |
| SDA |
GPIO21 |
| SCL |
GPIO22 |
Note: GPIO21 and GPIO22 are commonly used I2C pins on classic ESP32 development boards. Pin assignments may differ on other ESP32 variants.
Raspberry Pi Connection Example
| Mini DS3231 Module |
Raspberry Pi |
| VCC |
3.3V (if supported by module) |
| GND |
GND |
| SDA |
GPIO2 / Physical Pin 3 |
| SCL |
GPIO3 / Physical Pin 5 |
Important: Raspberry Pi GPIO pins operate at 3.3V. Ensure the module's I2C pull-up resistors do not pull SDA or SCL to 5V.
Applications
- Arduino and ESP32 clock projects
- Raspberry Pi RTC backup
- Data logging and timestamp recording
- Environmental monitoring systems
- Industrial automation
- Time-based relay control
- Electronic timers
- Digital clocks and alarm systems
- Scheduled equipment operation
- Smart home automation
- Robotics projects
- Battery-powered electronic devices
- Embedded systems development
- Educational electronics projects
Important Notes
- The DS3231 communicates through the I2C interface at address 0x68.
- The AT24C32 EEPROM commonly uses address 0x57, depending on its address configuration.
- The module requires initial date and time configuration.
- A suitable backup battery is required to maintain timekeeping during power loss.
- The original specifications identify an LIR2032 rechargeable battery.
- Some DS3231 modules contain battery-charging circuits. Verify the actual PCB design before installing a battery.
- Do not install a non-rechargeable CR2032 battery in a module with an active charging circuit.
- Check the module's I2C voltage levels before connecting to ESP32 or Raspberry Pi.
- Do not apply 5V directly to Raspberry Pi or ESP32 GPIO pins.
- The integrated temperature sensor is primarily intended for RTC temperature compensation.
- The EEPROM provides non-volatile storage but is not intended for high-capacity data logging.
- The module is not waterproof.
- Disconnect power before modifying connections.
Package Includes