in

Arduino Clock with LCD and RTC module

RTC module Arduino Clock

Welcome to the Quanta project, today we are going to make the Arduino LCD clock with the RTC module. this is the most famous project of a clock. basically this is the basic project of the Arduino. only you have to take the time with the RTC module.

No doubt! Numerous gadgets engineers rely on it for their time-sensitive tasks however RTC isn’t totally solid. It is battery worked and must be supplanted soon or later. Coming to IoT ventures it involves important SPI(Serial Peripheral Interface) sticks and gets chaotic with wires tangled around. Arrangement… .Here comes our saint NTP(Network time protocol).NTP is so precise since it gets time from the web. We will work this convention utilizing a customer service model. the procedure is easy to such an extent that our Nodemcu goes about as a customer and solicitation an NTP parcel from the server utilizing UDP. Consequently, the server sends a bundle to the customer which parses the information. NTP is the all-inclusive time synchronization convention. Presently let us light up our labs work station

The parameters for the capacity are featured in red: seconds, minutes, hours, day of the week, date, month and year (in a specific order). Sunday is day 1 of the week and Saturday is 7. Remember to uncomment that line of code.Subsequent to setting the present time, you can transfer the furnished code with the necessary adjustments

How to connect RTC and LCD with the Arduino

It is simple to make the connection with the Arduino. as it is given in the above diagram.

The DS3231 is a low-cost, Real-Time Clock Module that can maintain hours, minutes and seconds, as well as, day, month and year information.

The module can work on either 3.3 or 5V. The battery input is 3V and a typical CR2032 3V battery can power the module and maintain the information for more than a year.

Code for Arduino real-time clock

#include <DS3231.h>

#include <LiquidCrystal.h> // includes the LiquidCrystal Library

DS3231  rtc(SDA, SCL);

LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LC object. Parameters: (rs, enable, d4, d5, d6, d7)

void setup() {

rtc.begin(); // Initialize the rtc object

lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and

height) of the display }

}

void loop() {

lcd.setCursor(0,0);

lcd.print(“Time:  “);

lcd.print(rtc.getTimeStr());

 

lcd.setCursor(0,1);

lcd.print(“Date: “);

lcd.print(rtc.getDateStr());

 

delay(1000);

}

Upload the given code into the Arduino by Arduino IDE

What do you think?

0 points
Upvote Downvote

Written by shahid

Leave a Reply

Your email address will not be published. Required fields are marked *

Gesture based air mouse with Arduino

Smoke detection Fire alarm