Skip to Content

Real Time Clock RTC Module AT24C32 Ds3231

The DS3231 Real-Time Clock Module is a powerful and cost-effective timekeeping solution that brings accuracy, reliability, and flexibility to a wide array of applications. Whether you're working with servers, GPS devices, data loggers, or any other time-critical system, the DS3231 is sure to elevate performance and deliver precise results every time.

Package Includes:

  • 1 x DS3231 Real-Time Clock Module

29.95 AED 29.95 AED Tax Included
29.95 AED Tax Included

Not Available For Sale

This combination does not exist.

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

 

Features:

  • Compact Size: Measures 38mm x 22mm x 14mm, suitable for applications with limited space.
  • Lightweight: Weighs only 8g, adding minimal burden to projects.
  • Wide Operating Voltage Range: Operates from 3.3V to 5.5V, compatible with many devices.
  • High-Precision Clock Chip: Uses the DS3231 chip for accurate timekeeping.
  • Clock Accuracy: ±2 ppm between 0–40°C (about 1-minute error per year).
  • Dual Calendar Alarm Clock: Supports two independent programmable alarms.
  • Programmable Square-Wave Output: Useful for generating periodic signals or synchronization.
  • Real-Time Clock Generator: Tracks seconds, minutes, hours, days, dates, months, and years; leap year correction up to 2100.
  • Built-in Temperature Sensor: Measures temperature with ±3°C accuracy.
  • Ample Memory Storage: Includes AT24C32 EEPROM with 32K memory.
  • IIC Bus Interface: Supports I²C for easy communication with microcontrollers.
  • Cascading Capability: Can be connected with other I²C devices; default 24C32 address: 0x57 (modifiable).

Principle of Work:

The DS3231 RTC module is built around the DS3231 chip from Maxim Integrated. It integrates a high-accuracy clock and a temperature sensor, and uses an I²C interface to communicate with microcontrollers. The on-chip TCXO ensures the oscillator remains accurate regardless of environmental changes.

The module can keep time continuously with the help of a coin cell battery, updating registers for seconds, minutes, hours, days, months, and years automatically — including leap year adjustments. The included EEPROM allows users to store additional non-volatile data directly on the module.

DS3231 Internal Components and Working with MCU

Internal Components of DS3231 IC:

  1. Crystal Oscillator: The DS3231 has a built-in temperature-compensated crystal oscillator (TCXO). The crystal generates precise clock pulses as the timekeeping base. The TCXO compensates for temperature variations, ensuring accuracy across temperature ranges.
  2. RTC Counter and Registers: Contains counters and registers to keep track of time (hours, minutes, seconds, day, date, month, year), continuously updated by the oscillator.
  3. Temperature Sensor: Built-in sensor to measure ambient temperature, accessible by the connected microcontroller (MCU).
  4. Control Logic: Manages alarms, output signals, and MCU communication.
  5. I2C Interface: Enables bi-directional serial communication with MCU using the I2C protocol. MCU reads/writes data to control functions and retrieve time & temperature.

How the Module Works with MCU:

  1. Initialization: MCU configures the DS3231 settings (set time, enable alarms, adjust parameters).
  2. Timekeeping: DS3231 updates internal time registers continuously; MCU reads current time.
  3. Temperature Monitoring: MCU reads temperature data for monitoring or compensation.
  4. Alarms: Two programmable alarms can be set by MCU for scheduled actions.
  5. Communication: MCU (master) sends commands via I2C; DS3231 (slave) responds.
  6. Battery Backup: Maintains time during power loss; MCU can monitor battery status.

Pinout of the Module:

DS3231 Module Pinout
  • VCC: Power supply voltage (3.3V to 5.5V)
  • GND: Ground
  • SDA: I2C data line
  • SCL: I2C clock line
  • SQW/OUT: Programmable square wave or output pin
  • 32kHz: 32.768 kHz clock output pin

Applications:

  • Real-Time Clock in digital clocks, timers, watches, and wall clocks
  • Data loggers with time-stamped data (environmental monitoring, event tracking)
  • Servers and network equipment for synchronization and logging
  • Automotive systems for dashboard clocks and event logging
  • GPS devices for maintaining accurate time
  • Security systems for event logging and access control
  • Home automation for scheduling and device coordination
  • Industrial automation for scheduling and event coordination
  • IoT devices for synchronization and data recording
  • Medical devices for precise timing and monitoring
  • Communication equipment for timing and synchronization
  • Weather stations and environmental monitoring systems

Circuit Diagram:

DS3231 Circuit Wiring

Library Installation for Arduino IDE:

  1. Download the library from: DS3231 RTC Module Library
  2. Open Arduino IDE → Sketch → Include Library → Add .ZIP Library → Select downloaded .zip
  3. Verify installation via Sketch → Include Library (look for "DS3231 RTC Module")

Sample Arduino Code:

#include "Wire.h"
#include "ds3231.h"

struct ts t;

void setup() {
  Serial.begin(9600);
  Wire.begin();
  DS3231_init(DS3231_CONTROL_INTCN);
  
  // Set initial date and time: Year, Month, Day, Hour, Minute, Second
  setInitialDateTime(2020, 11, 14, 3, 0, 0);
}

void loop() {
  // Read current time and date from DS3231
  DS3231_get(&t);
  
  // Print date and time to Serial Monitor
  printDateTime(t);
  
  delay(1000);
}

void setInitialDateTime(int year, int month, int day, int hour, int minute, int second) {
  t.year = year;
  t.mon = month;
  t.mday = day;
  t.hour = hour;
  t.min = minute;
  t.sec = second;
  
  DS3231_set(t);
}

void printDateTime(struct ts t) {
  Serial.print("Date: ");
  Serial.print(t.mday);
  Serial.print("/");
  Serial.print(t.mon);
  Serial.print("/");
  Serial.print(t.year);
  Serial.print("\t Hour: ");
  Serial.print(t.hour);
  Serial.print(":");
  Serial.print(t.min);
  Serial.print(".");
  Serial.println(t.sec);
}

Technical Details:

  • Size: 38mm x 22mm x 14mm
  • Weight: 8g
  • Operating Voltage: 3.3V to 5.5V
  • Clock Chip: DS3231, high precision
  • Accuracy: ±2 ppm at 0-40°C (~1 min/year)
  • Calendar: Two alarms available
  • Square-Wave Output: Programmable
  • Real-Time Clock Generator: Tracks seconds, minutes, hours, days, dates, months, years with leap-year compensation
  • Temperature Sensor: Integrated, ±3°C accuracy
  • Memory Chip: AT24C32 EEPROM, 32K storage
  • I2C Interface: Supports up to 400 kHz at 5V
  • Cascading Capability: Can connect with other I2C devices; address modifiable via A0/A1/A2 pins; default 0x57

Comparisons between DS3231 and DS1307 RTC Modules:

Feature DS3231 DS1307
Accuracy ±2 ppm (about 1 min/year) ~20 ppm (less accurate)
Temperature Compensation Integrated TCXO for temperature compensation No temperature compensation
Crystal Integrated crystal oscillator Requires external 32.768 kHz crystal
Alarms Two programmable alarms One programmable alarm
Temperature Sensor Built-in None
Voltage Range 2.3V to 5.5V 4.5V to 5.5V
Memory Includes AT24C32 EEPROM (32K) Includes AT24C32 EEPROM (32K)