How to make an Arduino Clock

Hello guys, welcome back to my SriTu Hobby blog. This tutorial includes how to make an Arduino clock. Also, we can use this Arduino LCD clock for the bedroom, study desk, office room, etc. So, this project mainly used the Arduino UNO board, RTC module, and LCD. Through this, you can see the temperature in addition to the date and time. They can be viewed through the LCD display. If you are not already familiar with the RTC module, For that, go to the RTC Module Tutorial.
How does work Arduino LCD clock?
Step 1
Arduino UNO board.

RTC Module.

LCD Display.
I2C Module
Jumper wires.
Li-ion battery holder & Battery.
5mm Foam board.

Step 2


Step 3


Step 4



Step 5
Then, attach the piece we connected to the Arduino board we made earlier to the bottom of the Arduino LCD clock.


Step 6
Next, take a 1.5 x 4.5-inch piece and attach it to the bottom.


Step 7
Ok, now connect the RTC module to the Arduino board. For that, use the circuit diagram below.


Step 8
Next, we set up the top of the Arduino LCD clock. For this, connect (solder) the I2c module to the LCD display. Then take a 2.75 x 4.5-inch piece and attach the LCD display to it. Afterward, connect it to the Arduino board.




Step 9
Afterward, connect the remaining two pieces to the bottom.




Step 10
Lastly, connect the upper part of the Arduino LCD clock. Also, insert the battery into the RTC module.



Step 11
Let us now enter the date and time for the Arduino LCD clock. You can use the following program for that. If you have not already included the RTC Library and I2C Library in the Arduino IDE, download and install them from the links below.
Arduino LCD clock code
/*RTC module with Arduino.
created by the SriTu Tech team.
Read the code below and use it for any of your creations.
*/
#include <DS3231.h>
DS3231 rtc(SDA, SCL);
void setup() {
rtc.begin();
rtc.setTime(8, 39, 0); //(12,00,00)Enter your time
rtc.setDate(23, 8, 2020); //(07,09,2020)Enter your date
}
void loop() {
}
Code explanation
There is nothing to include in the void loop.
void loop() {
OK, now upload this code to the Arduino board. For that, select the correct board and port. Afterward, upload this code.



Step 12
Now let us display the date, time, and temperature range entered above in the LCD. Use the following program for that.
#include <LiquidCrystal_I2C.h>
#include <DS3231.h>
LiquidCrystal_I2C dis(0x27, 16, 2);
DS3231 rtc(SDA, SCL);
void setup() {
dis.init();
dis.backlight();
dis.setCursor(0, 0);
dis.print("Table Clock");
dis.setCursor(0, 1);
dis.print("Loading");
for (int a = 7; a <= 15; a++ ) {
dis.setCursor(a, 1);
dis.print(".");
delay(400);
}
dis.clear();
rtc.begin();
}
void loop() {
dis.setCursor(0, 0);
dis.print("T:");
dis.print(rtc.getTemp());
dis.print("/");
dis.setCursor(8, 0);
dis.print(rtc.getTimeStr());
dis.setCursor(3, 1);
dis.print(rtc.getDateStr());
}
The first, includes the I2C library and the RTC library. Next, create an object called “lcd” for the I2C library and add the I2C address and the length and width of the LCD we are using. Then create an object called “rtc” for the RTC library and insert the I2C communication pin into it.
#include <LiquidCrystal_I2C.h>
#include <DS3231.h>
LiquidCrystal_I2C dis(0x27, 16, 2);
DS3231 rtc(SDA, SCL);
In the Void setup, the LCD display is initialized and the backlight is turned ON.
void setup() {
dis.init();
dis.backlight();
dis.setCursor(0, 0);
dis.print(“Table Clock”);
dis.setCursor(0, 1);
dis.print(“Loading”);
for (int a = 7; a <= 15; a++ ) {
dis.setCursor(a, 1);
dis.print(“.”);
delay(400);
}
dis.clear();
rtc.begin();
}
The temperature, date, and time in the void loop are displayed on the LCD.
void loop() {
dis.setCursor(0, 0);
dis.print(“T:”);
dis.print(rtc.getTemp());
dis.print(“/”);
dis.setCursor(8, 0);
dis.print(rtc.getTimeStr());
dis.setCursor(3, 1);
dis.print(rtc.getDateStr());
}
Well, let’s upload this code to the Arduino board.

Step 13
When all this is done, connect the power source to the Arduino LCD clock. You can use any power source you like for this. Remember to give a potential of 7 – 12 v. The full video guide is given below.




- Arduino nano board x 1 — Amazon / Banggood
- RTC Module x 1 — Amazon/Banggood
- LCD Display x 1 — Amazon/Banggood
- I2C module x 1 — Amazon/Banggood
- LCD holder x 1 — Amazon / Banggood
- Dot board — Amazon / Banggood
- Female & Male headers — Amazon / Banggood
- Wires — Amazon / Banggood
- Jumper wires —- Amazon/Banggood
Step 1
Arduino Nano board.

RTC module.

LCD display.

LCD holder.

I2C module.

Dot board.

Female & Male headers.

Wires.

Jumper wires.

Step 2




Step 3



Step 4



Step 5


Step 6
/*Table clock with Arduino.
created by the SriTu Tech team.
Read the code below and use it for any of your creations.
*/
#include <DS3231.h>
DS3231 rtc(SDA, SCL);
void setup() {
rtc.begin();
rtc.setTime(0,0,0);//Set time
rtc.setDate(0,0,0);//set date
}
void loop() {
}




Step 7
/*Table clock with Arduino.
created by the SriTu Tech team.
Read the code below and use it for any of your creations.
*/
#include <LiquidCrystal_I2C.h>
#include <DS3231.h>
LiquidCrystal_I2C dis(0x27, 16, 2);
DS3231 rtc(SDA, SCL);
void setup() {
dis.init();
dis.backlight();
rtc.begin();
delay(1000);
start();
dis.clear();
}
void loop() {
TimeDate();
}
void TimeDate() {
delay(500);
dis.setCursor(0, 0);
dis.print("TIME -- ");
dis.print(rtc.getTimeStr());
dis.setCursor(0, 1);
dis.print("DATE -- ");
dis.print(rtc.getDateStr());
}
void start() {
dis.setCursor(0, 0);
dis.print("HELLO SRITU TECH");
dis.setCursor(0, 1);
dis.print("CLOCK READY");
for (int a = 11; a < 16; a++) {
dis.setCursor(a, 1);
dis.print(".");
delay(700);
}
}

Step 8



How to make an Arduino Clock – step by step complete tutorial