|
|
Arduino_UNO_R3 |
x 1 | |
|
|
SRD-05VDC-SL-CSONGLE
|
x 1 | |
|
|
BC547Onsemi
|
x 1 | |
|
|
1N4007ST
|
x 1 | |
|
|
25RX301000M12.5X20Rubycon
|
x 1 |
|
Arduino Web Editor |
DIY RTC Digital Clock with Professional PCB Design
In this blog post, we will guide you through making a DIY RTC Digital Clock using an Arduino UNO and an I2C LCD. We will also explain the provided circuit diagram, how to design and order a PCB from PCBWay, and why PCBWay is the best choice for high-quality PCBs.
Circuit Diagram Explanation

The schematic consists of an ATmega328P microcontroller, an RTC module, an I2C LCD, and other supporting components. The microcontroller manages the real-time clock functionality and displays the time on the LCD screen.
Key Components Used:
- Microcontroller: ATmega328P-PU
- Real-Time Clock Module: DS3231
- Display: 16x2 LCD with I2C interface
- Voltage Regulator: 7805 for 5V regulation
- Diodes: 1N4007 for reverse polarity protection
- Transistors: BC547B for switching
- Capacitors: 22pF and 220uF for stability
- Resistors: 10kΩ, 1kΩ
- Crystal Oscillator: 16MHz
- Relay Module: For controlling external devices
- LED Indicators: For power and status indication
Hardware Connections & Explanation
- I2C LCD: The I2C LCD is connected to the ATmega328P microcontroller via SDA (A4) and SCL (A5) lines. This reduces the number of GPIO pins required for communication.
- RTC Module: The DS3231 RTC module communicates via I2C and provides accurate timekeeping.
- Power Supply: The circuit operates at 5V, regulated by the 7805 voltage regulator.
- Relay Control: The relay is controlled by a transistor to switch external loads.
Working Principle
- The RTC module keeps track of the real-time clock and communicates with the microcontroller via I2C.
- The microcontroller reads the time data and displays it on the LCD.
- A relay is incorporated to control external devices based on time settings.
- The system is powered by a stable 5V regulated supply to ensure smooth operation.
How the RTC Module Works & Calibration
The DS3231 RTC module is a highly accurate real-time clock with an inbuilt temperature-compensated crystal oscillator. It maintains time even when power is removed, thanks to its onboard battery backup.
Calibration with Arduino UNO
Connect the RTC Module to Arduino:
VCC → 5V
GND → GND
SDA → A4
SCL → A5
Upload the following code to set the correct time:
#include <Wire.h>
#include <RTClib.h>
RTC_DS3231 rtc;
void setup() {
Serial.begin(9600);
if (!rtc.begin()) {
Serial.println("RTC not found!");
while (1);
}
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
Serial.println("RTC Set to Compilation Time");
}
void loop() {}
Verify RTC Time: Upload the code below to read and display the RTC time.
void loop() {
DateTime now = rtc.now();
Serial.print(now.year(), DEC);
Serial.print("/");
Serial.print(now.month(), DEC);
Serial.print("/");
Serial.print(now.day(), DEC);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(":");
Serial.print(now.minute(), DEC);
Serial.print(":");
Serial.println(now.second(), DEC);
delay(1000);
}
Arduino Code for RTC Digital Clock
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <RTClib.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
RTC_DS3231 rtc;
void setup() {
lcd.begin();
lcd.backlight();
if (!rtc.begin()) {
lcd.print("RTC ERROR");
while (1);
}
rtc.adjust(DateTime(__DATE__, __TIME__)); // Set to compile time
}
void loop() {
DateTime now = rtc.now();
lcd.setCursor(0, 0);
lcd.print("Time: ");
lcd.print(now.hour(), DEC);
lcd.print(":");
lcd.print(now.minute(), DEC);
lcd.print(":");
lcd.print(now.second(), DEC);
delay(1000);
}
Code Explanation
RTC Initialization: The DS3231 module is initialized using the RTClib library.
LCD Display: The I2C LCD module displays real-time clock data.
Time Adjustment: The RTC is set to the current compile time when the program is uploaded.
Loop Function:
Continuously reads the RTC time.
Displays the time on the LCD.
Refreshes every second to keep it updated.
PCB Design & Ordering from PCBWay
Conclusion
By following this guide, you can build a professional RTC Digital Clock using an Arduino UNO and an I2C LCD. This project provides a practical way to understand RTC communication, LCD interfacing, and relay control. Using PCBWay for PCB manufacturing ensures high quality and reliability. Happy DIYing!
DIY RTC Digital Clock with Professional PCB Design
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(1)
-
Sergio Oliveira
Jun 18,2025
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Estiak Khan
-
⚡ How to Make a DIY Spot Welding Machine at Home for 18650 Batteries | Full Circuit & Working
If you’re working on battery pack projects using 18650 lithium-ion cells, then you know how importan...
-
🔋 How to Make a Simple DIY Wi-Fi Router UPS at Home | Step-by-Step Guide with Circuit & PCB
Do you lose internet connection every time the power goes out?If yes, then this simple DIY Wi-Fi Rou...
-
Automatic AC Changeover for Inverter
Automatic AC Changeover for Inverter – DIY Circuit GuideAre you tired of manually switching between ...
-
How to Make a 12V AC/DC Fan Controller Module
If you're looking for an efficient way to control a 12V fan using either AC or DC input, this DIY pr...
-
Autocut DC Mini IPS for DC 12V Load
Autocut DC Mini IPS for DC 12V LoadIf you are looking for a reliable Autocut DC Mini IPS for DC 12V ...
-
Build a 12V Battery Autocut System with LCD Display
Are you looking for an efficient and affordable way to protect and monitor your 12V battery system? ...
-
DIY Transistor Tester | Build Your Own LCR Meter at Home with Arduino Nano
Are you fascinated by electronics and want to create your own tools for testing components? Building...
-
How to Make a Pure Sine Wave Inverter Using EG8010 + IR2110S | Step-by-Step Guide
How to Make a Pure Sine Wave Inverter Using EG8010 + IR2110S | Step-by-Step GuideIf you are looking ...
-
🔋 How to Make DC Changeover for Automatic Inverter System | DIY Inverter Changeover Switch
Are you tired of manually switching between DC power supply and battery backup during load shedding?...
-
No Need Adapter 🤔 WiFi Router UPS Making with Transformer
No Need Adapter WiFi Router UPS Making with Transformer | Complete Circuit DiagramAre you tired of ...
-
🔋 How to Make a Power Bank Module at Home
Are you looking to build your own DIY power bank at home? In this blog post, we’ll show you how to c...
-
Cute LIT 220W Inverter Load Test ⚡ Auto Changeover IPS System Explained! 🔋 Real Load Backup Test
Are you looking for a reliable backup power solution for your WiFi router, CCTV, or small appliances...
-
⚡ Hybrid WiFi Router UPS for Solar System
IntroductionPower cuts in off-grid areas can disrupt internet connectivity. With the rise of solar s...
-
🔋 DIY Solar-Based Mini IPS at Home | Auto Load Changeover Circuit for 12V DC Fan/Light
If you're looking for an easy and affordable solution to keep your 12V DC fan or light running even ...
-
🔋 DIY Automatic Cut Off 12V Trickle Charger | Lead Acid Battery AutoCut Charger
Do you often charge your 12V lead-acid battery manually and worry about overcharging? With this DIY ...
-
🔥 DIY Smart 12V Battery at Home | Using 18650 Cells + Smart BMS
Looking for a way to build a powerful and smart 12V battery at home? In this guide, I'll show you h...
-
🎮 DIY Arduino Nano Snake Game Console with OLED Display
DIY Arduino Nano Snake Game Console with OLED Display and ButtonsDo you love retro games? Want to bu...
-
DIY 150W IPS Making At Home with Auto Changeover System | Mini IPS 2025
How to Make an Automatic 150W IPS Using Two Circuit ModulesAre you looking for a reliable and effici...
-
-
AEL-2011 Power Supply Module
386 0 2 -
AEL-2011 50W Power Amplifier
360 0 2 -
-
-
Custom Mechanical Keyboard
605 0 0 -
Tester for Touch Screen Digitizer without using microcontroller
262 2 2 -
Audio reactive glow LED wristband/bracelet with NFC / RFID-Tags
257 0 1 -
-
-







