Arduino DS3231 Real Time Clock (RTC) with Temperature Monitor

Components Required:

To design Arduino & DS3231 Based Real Time Clock (RTC) & Temperature Monitor, we need the following components.

  1. Arduino board
  2. DS3231 RTC Module
  3. 16 x 2 LCD
  4. 3V coin cell battery
  5. Breadboard
  6. Jumper wires

DS3231 RTC Module:

Introduction:

The DS3231 is a low-cost, extremely accurate I²C real-time clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. The device incorporates a battery input and maintains accurate timekeeping when main power to the device is interrupted.

Arduino & DS3231 Based Real Time Clock (RTC) & Temperature Monitor

The RTC maintains seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with an active-low AM/PM indicator. Two programmable time-of-day alarms and a programmable square-wave output are provided.

A precision temperature-compensated voltage reference and comparator circuit monitors the status of VCC to detect power failures, to provide a reset output, and to automatically switch to the backup supply when necessary. Additionally, the active-low RST pin is monitored as a pushbutton input for generating a µP reset.

Key Features:

  1. Highly Accurate RTC Completely Manages All Timekeeping Functions
  2. 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
  3. Accuracy ±2ppm from 0°C to +40°C
  4. Accuracy ±3.5ppm from -40°C to +85°C
  5. Digital Temp Sensor Output: ±3°C Accuracy
  6. Register for Aging Trim
  7. Active-Low RST Output/Pushbutton Reset Debounce Input
  8. Two Time-of-Day Alarms
  9. Programmable Square-Wave Output Signal
  10. Simple Serial Interface Connects to Most Microcontrollers
  11. Fast (400kHz) I2C Interface
  12. Battery-Backup Input for Continuous Timekeeping
  13. Low Power Operation Extends Battery-Backup Run Time
  14. 3.3V Operation
  15. Operating Temperature Ranges: Commercial (0°C to +70°C) and Industrial (-40°C to +85°C)
  16. Underwriters Laboratories® (UL) Recognized

Circuit Diagram:

Arduino & DS3231 Based Real Time Clock (RTC) & Temperature Monitor

Connect SDA and SCL pins of DS3231 with SDA & SCL pin, i.e A4 & A5 of Arduino.

To connect LCD: Connect Pin 12, 11, 5, 4, 3, 2 of Arduino with Pin 4, 6, 11, 12, 13, 14 of LCD.


Working:

To make this project work first add the library for DS3231 which is given below. After that upload the code. Once the code is uploaded the project starts working.

 

  • 1

     

    On the first row, Real-Time Clock will be displayed. But on the 2nd-row date, time day and temperature will be displayed each after the interval of 3 seconds.