Digital clock using dot matrix and Arduino

Spread the love

I made this digital clock using RTC DS1302, Arduino and dot matrix. I got a huge request on my Instagram for the tutorial. so, on your demand, I am publishing this article. This post will help you to make your own desk clock.

Material list

  • Arduino nano
  • max7219 dot matrix module
  • RTC DS3231
  • Buck pin
  • Soldering iron
  • Soldering wire
  • Universal PCB
  • Wires

Configure RTC DS3231

RTC (real-time clock) DS3231 is an I2C (Inter-Integrated Circuit) protocol Based clock. It has an integrated temperature-compensated crystal oscillator and crystal. Which makes is extremely accurate.

To work with this module you RTClib library. Download it and add it to your Arduino IDE. For add library open your Arduino ide go to sketch> Include library>Add .zip library. navigate to your downloaded location and click open. After doing this restart Arduino IDE software.

Connect module with your Arduino as show in schismatics. Connection is same for Arduino nano and UNO I2C pins are same in both boards. if you have any other board follow the following table for connection.

I2c Connections

Connect Arduino 5v to RTC DS3231, Gnd to Gnd, A4 to SDA , and A5 to SCL.

Let’s upload an example code which gives you date and time on the serial monitor. Go to File>Example>RTClib>timestamp.

RTC DS3231 example code

Open serial monitor by click on top-right magnifying lens icon or ctrl+shift+M or go to tools>serial monitor. Make sure Arduino is connected and baud rate is 57600.

digital clock
Output serial monitor

The output is current date and time. The time is in 24 hours clock. you can convert it into 12hrs clock by simply subtracting 12, when the actual time is greater then 12.

MAX7219 dot matrix module

we are using an 8*8 matrix for the digital time clock. This module has a set of 64 LEDs arranged in the 8*8 matrix. I am using the max7219 dot matrix module. Connection of this module with arduino is very simple that’s why i am using this module.

digital wall clock
max7219 with Arduino

You will need maxMatrix library download it and install it on your Arduino IDE software. We are using 2 matrix modules, one is for hours and the second is for minutes.

ArduinoMatrix1 inMatrix1 outMatrix2 In
D7DINDoutDin
D6CLKCLKCLK
D5CSCSCS

Download this code and upload to your Arduino. Few digital clock font will apear on your matrix screen.

Assembly on breadboard

I prefer to verify circuit first on breadboard. Mount every component on breadboard, and connect according to schematics.

digital time clock
Final schematics

Download main code Click Here…

If every thing is correct then Final output like this.

digital clock display
Digital clock display

Assembly on PCB

Make same connection on PCB.

digital wall clock

Power up the circuit and your current time will display something like this.

Add a Comment

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