How to Make a Real-Time Table Clock Using Arduino and RTC

Hello and welcome back! In this project, we will learn how to make a real-time table clock using an Arduino Nano board. For that, I have mainly used the RTC module. Also, we can see the time and date on the LCD screen. I have added three modes to this project. You can change the display to show only the time, only the date, or both time and date. Otherwise, you can change it as you like by modifying the program.
In this project, I have designed a PCB with JLCPCB. Therefore, we don’t need any additional wires for this project. Also, you can power up this project using an external power supply. I think you can make this project easily using just a few components. If you want to know about the RTC module and how to use it with Arduino, please use this link.
Ok, let’s do this project step by step. The required components are given below.
- Arduino Nano board x 1 — Our Store / Amazon
- RTC module x 1 — Our Store / Amazon
- 10k Resistor x 1 — Our store / Amazon
- Tactile Push button x 1 — Our store / Amazon
- LCD x 1 — Our Store / Amazon
- 104 Preset x 1 — Our store / Amazon
- Female header x 1 — Our Store / Amazon
- 12v connector x 1 — Our store / Amazon
Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.
Step 1
Firstly, identify these components.








Step 2
Secondly, let’s order the PCBs for this project by following the steps below.


- Click the “Instant Quote” button and upload the Gerber file, which you can download from the link below.
- Gerber file – Download
- For this project, I ordered five green PCBs. Next, select the build time and shipping method. Finally, click “Save to Cart” and complete the payment.






Step 3
Thirdly, let’s unbox your PCB package once you receive it.






Step 4
Now, solder the components one by one.




Step 5
Next, connect the Arduino Nano board, RTC module, and LCD screen to the PCB. Also, remember to insert the battery into the RTC module.




Step 6
Afterward, connect the Arduino nano board to the computer. Then copy and paste the following program to the Arduino IDE. Also, please include the DS3231 library file to the Arduino IDE.

#include <DS3231.h>
DS3231 rtc(SDA, SCL);
void setup() {
rtc.begin();
rtc.setTime(11, 45, 00); //(12,00,00)
rtc.setDate(24, 03, 2025); //(7,9,2020)
}
void loop() {
}
- Now, enter the correct time and date. Then, select the board and port. After that, click the upload button.





Step 7
Next, copy and paste the following code to the Arduino IDE.
#include <Wire.h>
#include <DS3231.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(9, 8, 4, 5, 6, 7);
DS3231 rtc(SDA, SCL);
#define button 10
int displayMode = 0; // 0: Time, 1: Date, 2: Time & Date
void setup() {
pinMode(button, INPUT_PULLUP); // Internal pull-up resistor
lcd.begin(16, 2);
rtc.begin();
delay(1000);
start();
lcd.clear();
}
void loop() {
checkButton(); // Check if the button is pressed
displayData(); // Show the correct mode
}
void checkButton() {
if (digitalRead(button) == LOW) { // Button pressed
delay(200); // Debounce delay
displayMode = (displayMode + 1) % 3; // Cycle through 0, 1, 2
while (digitalRead(button) == LOW); // Wait for button release
}
}
void displayData() {
lcd.clear();
switch (displayMode) {
case 0: // Time Only
lcd.setCursor(6, 0);
lcd.print("TIME");
lcd.setCursor(4, 1);
lcd.print(rtc.getTimeStr());
break;
case 1: // Date Only
lcd.setCursor(6, 0);
lcd.print("DATE");
lcd.setCursor(3, 1);
lcd.print(rtc.getDateStr());
break;
case 2: // Time & Date Together
lcd.setCursor(0, 0);
lcd.print("T: ");
lcd.print(rtc.getTimeStr());
lcd.setCursor(0, 1);
lcd.print("D: ");
lcd.print(rtc.getDateStr());
break;
}
delay(500); // Small delay to prevent flickering
}
void start() {
lcd.setCursor(0, 0);
lcd.print("HELLO!");
lcd.setCursor(0, 1);
lcd.print("CLOCK READY");
for (int a = 11; a < 16; a++) {
lcd.setCursor(a, 1);
lcd.print(".");
delay(500);
}
}
- Now, select the board and port. After that, click the upload button.




Step 8
Finally, remove the USB cable and connect the power supply to the PCB. For that, I have used two Li-ion batteries, but you can also use a 9V battery. Additionally, you can adjust the LCD screen contrast using the preset and change the clock mode using the push button.
Alright, enjoy this project! The full video guide is below. We hope to see you in the next project!





Troubleshooting tips
- Verify the correct time and date.
- Check the RTC module battery.
- Select the correct board and port.
- Adjust the contrast value using preset.
- Check the power supply.
How to Make a Real-Time Table Clock Using Arduino and RTC