Arduino-Based Digital Clock with LCD Display


Materials





Arduino Uno Arduino Uno Buy at Amazon
Breadboard Breadboard Buy at Amazon
Jumper Wires Jumper Wires Buy at Amazon

Instructions

  1. Connect the LCD display and RTC module to the Arduino.
  2. Wire the LCD to the I2C pins (SDA and SCL).
  3. Upload the following code to your Arduino:

#include
#include
#include
LiquidCrystal_I2C lcd(0x27, 16, 2);
RTC_DS3231 rtc;
void setup() {
lcd.begin();
rtc.begin();
}
void loop() {
DateTime now = rtc.now();
lcd.setCursor(0, 0);
lcd.print(“Time: “);
lcd.print(now.hour());
lcd.print(“:”);
lcd.print(now.minute());
lcd.print(“:”);
lcd.print(now.second());
delay(1000);
}

Explanation

This code reads the current time from the RTC DS3231 module and displays it on the 16×2 LCD. It’s a straightforward project to understand how to use LCDs with Arduino.

Conclusion

This project demonstrates how to create a digital clock with Arduino. It’s a practical application for learning about timekeeping and LCD interfacing.

Leave a Comment

Meta quest 3 : a top contender for the best vr headset. Wi fi troubleshooting smartsavvyhome.