Tutorials

How to use Chronodot V2.0 DS3231 RTC module with Arduino

Hello everyone! In this tutorial I will be showing how you can easily use Chronodot RTC module with arduino to make a digital clock.

About Chronodot

Chronodot is a module which has a DS3231 RTC chip on it. There is also a coin cell holder soldered into the module. In order to keep the time with the internal ultra-low power oscillator of DS3231, this cell is required to install. You can run the module without the cell also but remember that it will loose the time as soon as you remove power to the chip. DS3231 is extremely high precision RTC chip which also has a temperature sensor inside. The temperature reading is fairly accurate but it take around 2-3 seconds to sense and update the temperature.

You can download the datasheet here.

Circuit Diagram

circuit diagram of Chronodot V2.0 DS3231 RTC module with Arduino atmega328 schematic

Make the connections as shown in the schematic.

Arduino RTC lib

In order to use this module in a more convenient way, thankfully we have the Adafruit RTC library. To install this library, open Arduino IDE and then go to tools>manage libraries and then search for adafruit rtclib. And the install the library.

Arduino Code

Copy this code to arduino IDE and the compile to upload. Once compiled successfully click upload.

#include "RTClib.h"

RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {
  Serial.begin(57600);

  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    Serial.flush();
    abort();
  }
  rtc.adjust(DateTime(2021, 5, 1, 3, 25, 10)); //rtc.adjust(DateTime(YYYY, MM, DD, hh, mm, ss))
}

void loop () {
  DateTime now = rtc.now();

  Serial.print(now.year(), DEC);
  Serial.print('/');
  Serial.print(now.month(), DEC);
  Serial.print('/');
  Serial.print(now.day(), DEC);
  Serial.print(" (");
  Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
  Serial.print(") ");
  Serial.print(now.hour(), DEC);
  Serial.print(':');
  Serial.print(now.minute(), DEC);
  Serial.print(':');
  Serial.print(now.second(), DEC);
  Serial.println();

  Serial.print("Temperature: ");
  Serial.print(rtc.getTemperature());
  Serial.println(" C");

  Serial.println();
  delay(3000);
}

Checkout the video tutorial on my youtube channel

One thought on “How to use Chronodot V2.0 DS3231 RTC module with Arduino

  1. Please make a digital clock using this chip. Your posts are really easy to understand

Leave a Reply

Your email address will not be published. Required fields are marked *