DIY Arduino Digital Clock: A Fun Beginner’s Project

A digital clock is a great invention in electronics science. Nowadays, digital clocks are used everywhere. The Analog clocks are quite old-fashioned. So the digital clock takes its place day by day. The Arduino digital clock is looking very modern. It has many additional features also like temperature, alarm, timer, etc.

In this electronics project, we are going to build an Arduino digital clock with or without an RTC (Real Time Clock) module. The first circuit represents without an RTC module and the second circuit represents with an RTC module. The components we used in this project are quite basic and a little expensive. The circuit connection is very easy.

Principle Behind Arduino Digital Clock

We build this digital clock with an Arduino, RTC module, and LCD display in this project. Here the clock we made is 24 hours clock. This means the time shown by the clock is 00.00 AM to 23.59. After 23.59 it resets to 0 again.

Project

Arduino Digital Clock With/Without DS1307 RTC Module

About Parts

Arduino

arduino-nano

Arduino is one of the most popular electronics prototyping boards based on the ATmega328P microcontroller. ATmega328P is an AVR architecture-based 8-bit microcontroller. Here I am using Arduino Nano for this project to give it a compact look.

16×2 LCD Display

A 16×2 LCD display is the most commonly used display unit for microcontroller-based applications. It supports 16 characters in a row with two such rows. It also supports special characters and even custom characters.

I2C LCD Display Module

i2c-module

I2C Module has an inbuilt PCF8574 I2C chip that converts I2C serial data to parallel data for the 16 pins LCD display. It is currently available with a default I2C address of either 0x27 or 0x3F. With this I2C LCD module, we can able to show data via only 2 wires which are SDA and SCL pins.

DS1307 Real Time Clock Module

ds1307 real time clock module

The DS1307 real-time clock (RTC) is a low-power, full binary-coded decimal (BCD) clock plus 56 bytes of NV SRAM. Address and data are transferred serially through an I2C bus. This clock provides seconds, minutes, hours, days, dates, months, and years.

Arduino Digital Clock With DS1307 RTC Module

Circuit Diagram

Arduino Digital Clock Using RTC Module Circuit

Components Required

  • Arduino
  • 16×2 LCD Display
  • I2C Module
  • DS1307 Real Time Clock Module
  • Push Button (x3)
  • Buzzer
  • 9V Battery

Circuit Connection of Arduino Digital Clock With DS1307 RTC Module

A serial I2C bidirectional bus made a communication between the Arduino and the DS1307 RTC module. The I2C protocol is a technique for communicating a faster device (master mode) and a slower device (slave mode).

In Arduino, there are 2 pins for I2C communication. Those are A4 and A5. These pins act as SDA (serial data) and SCL (serial clock) respectively.

SDA and SCL pins of both the I2C display module and DS1307 RTC module are connected to A4 and A5 respectively.

Working Principle of Arduino Digital Clock With RTC Module

We build this project to create a real-time clock for our daily life. The working principle of this clock is so simple.

With a real-time clock module, this circuit is working in automatic mode. Although we can manually set the time as our requirements through Arduino code. As we say that this is an automatic clock so the system can set time and date itself like a computer.

The whole circuit is working as a continuous sequence. When the power goes out, the circuit will not reset to its initial position.

Arduino Code

Arduino Digital Clock Without RTC Module

Circuit Diagram

Arduino Digital Clock Circuit

Components Required

  • Arduino
  • 16×2 LCD Display
  • I2C LCD Display Module
  • Push Button (x3)
  • 9V Battery

Circuit Connection of Arduino Digital Clock Without RTC Module

To make the digital clock’s first circuit, we need an Arduino board, two pushbuttons, an LCD display, and an I2C Display Module.

First of all, connect all two push buttons’ in any one terminal to the ground. The other terminals of the two buttons are connected to Analog pins D8 and D9 of the Arduino respectively.

In Arduino, there are 2 pins for I2C communication. Those are A4 and A5. These pins act as SDA (serial data) and SCL (serial clock) respectively.

SDA and SCL pins of the I2C display module are connected to A4 and A5 respectively.

Circuit Design Using PCB Software

To make the circuit compact and give it a professional look, I designed the PCB after testing all the features of the Arduino Digital Clock on the breadboard. I will explain in detail how we can design and order PCB for our project.

Arduino Digital Clock Pcb

For the Gerber file check out this link Simple Arduino Digital Clock

Working Principle of Arduino Digital Clock Without RTC Module

Without a real-time clock module, the circuit is working as a manual controller. We can manually set the time to our requirements.

The first button is for setting up the hour by sending a signal to the D8 pin. The second button is for setting up the minutes by sending a signal to the D9 pin of the Arduino.

The whole circuit is working as a continuous sequence. When the power goes out, the circuit will reset to its initial position. Then we need to again set the time via the push button. So this is a major drawback for this circuit.

Arduino Code

Applications of Arduino Digital Clock

  • This clock is used in data logging applications.
  • It can be used in time stamps.
  • As an alarm and timer.
  • As a simple clock in houses, offices, etc. 

Frequently Asked Questions

How do I set the time on my Arduino RTC?

For this project, it needs to set the real-time into Arduino code when uploading. But after that, we need not set the time every time when better die. Just remove the old battery and put in the new one that’s it.

Does Arduino have a real-time clock library?

Yes, there is a few Arduino real-time clock (RTC) libraries in the library manager of the Arduino IDE software. These help to compile Arduino code and upload it into the Arduino board.

How can I make an Arduino based clock without an RTC module?

To make this clock is too easy. But the only drawback of this clock is when the power cut down, we need to set the time again from the beginning. To build this clock go to this blog and check out the second circuit.

Why RTC is used in Arduino digital clocks?

The main purpose of using an RTC or a real-time clock is to provide a precise time and date which is very accurate. RTC is an electronic device in the form of an Integrated Chip (IC) available in various packaging options. It is powered by an internal lithium-ion battery.

How does RTC work?

An RTC maintains its clock by counting the cycles of an oscillator (32.768KHz Crystal Oscillator) circuit, an internal capacitor-based oscillator, or even an embedded quartz crystal. Some RTCs maintain the oscillator setting at the last known point before it went out of the lock with the power input.

What is the full form of RTC?

The full form of RTC is a Real-Time Clock.

1 thought on “DIY Arduino Digital Clock: A Fun Beginner’s Project”

Leave a Comment