How to Make a Digital Clock Showing Time, Day, Date & Temperature Using MAX7219 Display and DS3231 RTC Module

Introduction

In this project tutorial, we will learn how to make a professional digital clock using Arduino Nano, MAX7219 LED matrix display, and DS3231 RTC module.
This is not an ordinary clock. It displays Time, Day, Date, and Temperature continuously in a scrolling format, making it perfect for office desks, study tables, workshops, and home setups.

The DS3231 RTC module ensures extremely accurate timekeeping, even during power failure, while the MAX7219 8×32 LED display provides bright and clear visibility.
To give this project a premium look, we will also use a 3D printed enclosure.

This tutorial is written in a simple, step-by-step manner, so even beginners can easily build this clock without confusion.


Components Required

To build this digital clock project, you will need the following components:

  • Arduino Nano
  • DS3231 RTC Module
  • 8×32 MAX7219 LED Matrix Display
  • Connecting Wires
  • 3V Coin Cell (for RTC backup)
  • 3D Printed Enclosure


About DS3231 RTC Module (Pin Description)

The DS3231 RTC module has a total of 6 pins, but in this project, we will use only 4 pins.

DS3231 Pin Details

  1. VCC – Power supply (5V)
  2. GND – Ground
  3. SDA – Serial Data (I2C communication)
  4. SCL – Serial Clock (I2C communication)
  5. 32K – 32kHz output (not used)
  6. SQW – Square wave output (not used)

⚠️ Important:
Make sure a 3V coin cell is inserted into the RTC module. This battery helps the RTC remember time even when power is disconnected.


Step 1: Connecting DS3231 RTC Module to Arduino Nano

Now let’s start with the wiring.

RTC to Arduino Connections

  • VCC → Arduino 5V
  • GND → Arduino GND
  • SDA → Arduino A4
  • SCL → Arduino A5

We will use only these 4 pins of the RTC module.


Step 2: Connecting MAX7219 Display to Arduino Nano

The MAX7219 8×32 display has 5 input pins.

MAX7219 Pin Details

  • VCC
  • GND
  • DIN
  • CS
  • CLK

Display to Arduino Connections

  • VCC → Arduino 5V
  • GND → Arduino GND
  • DIN → Arduino D11
  • CS → Arduino D10
  • CLK → Arduino D13

Double-check all connections before moving to the next step.


Step 3: Uploading Code to Arduino Nano

Now we will upload the code to the Arduino Nano.

Preparing the Code

  1. Download the provided zipped code file
  2. Right-click on the file and select “Extract All”
  3. Do not move any file from the extracted folder

You will find three files:

  • DS3231_Time_set.ino – Used to set time in RTC
  • Timperature_and_Time.ino – Main display code
  • font_Data.h – Font data file (required)

⚠️ Do not rename or move these files, otherwise the code will not work.


Step 4: Setting Time in DS3231 RTC Module

If you are using a new RTC module, you must first upload time to it.

Steps to Upload RTC Time

  1. Open Arduino IDE
  2. Go to File → Open
  3. Select DS3231_Time_set.ino
  4. Click Open


Step 5: Installing Required RTC Library

To upload this code, we need a library.

Install RTCLib

  1. Go to Sketch → Include Library → Manage Libraries
  2. Search for RTCLib
  3. Select the latest version
  4. Click Install

⚠️ Make sure your PC is connected to the internet.


Step 6: Uploading Time to RTC

  1. Go to Tools
  2. Select Board → Arduino Nano
  3. Choose the correct COM Port
  4. Keep all other settings default
  5. Click Upload

Within a few seconds, the time will be uploaded successfully.

Verify Time

  • Open Serial Monitor
  • You will see accurate time, day, and date
  • Time is taken automatically from your laptop


Step 7: Uploading Final Display Code

Now we will upload the main program.

  1. Go to File → Open
  2. Select Timperature_and_Time.ino
  3. Click Open
  4. Re-check Board type and COM Port


Step 8: Installing Required Display Libraries

Now install the remaining libraries.

Libraries Required

  • MD_Parola
  • MD_MAX72xx
  • DS3231

Installation Process

  1. Go to Sketch → Include Library → Manage Libraries
  2. Search each library one by one
  3. Install the latest version


Step 9: Upload Final Code

After installing all libraries:

  1. Click Upload
  2. Wait a few seconds

Once uploaded successfully:

  • Time, Day, Date, and Temperature will start scrolling on the display
  • Temperature is shown in Degree Celsius and Fahrenheit
  • Every one minute, the display cycles between:

  1. Time
  2. Day
  3. Date
  4. Temperature

⚠️ Make sure hardware type and board settings are correct.

If you still face upload errors, watch the complete project video on YouTube.


Step 10: Final Assembly

Now assemble all components inside the 3D printed enclosure.

You can order this enclosure from the given email ID (ergreat2018@gmail.com).
After assembly, the clock looks clean, professional, and ready for daily use.


Where You Can Use This Clock

  • Office desk
  • Study table
  • Workshop
  • Home decor
  • Electronics lab

This project is highly impressive and professional.


Conclusion

In this tutorial, we successfully built a Digital Clock using Arduino Nano, DS3231 RTC, and MAX7219 display that shows Time, Day, Date, and Temperature accurately.
With proper enclosure and reliable RTC backup, this clock can run for years without losing time.

If you have any questions regarding this project, let me know in the comment section.
Don’t forget to share this tutorial with your family and colleagues.

Happy Making!

Post a Comment

0 Comments