DS3231 Real Time Clock




In this tutorial we will learn how to use DS3231 Real Time Clock with the Arduino.

---

Hardware Required:

Arduino Board - https://goo.gl/Rqc5w2
DS3231 Real Time - https://goo.gl/oXbKri
CR2032 Coin Battery - https://goo.gl/8wVM23
LCD Display - https://goo.gl/SxH8Jx
Potentiometer - https://goo.gl/MPwcEM
Breadboard - https://goo.gl/GjpqVW
Jumper Wires - https://goo.gl/TdGrkk - https://goo.gl/VRzUN4

Recommended Site - https://goo.gl/HDkZBt

---

About the DS3231 Module:

The DS3231 is a low-cost, Real Time Clock Module which 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.

---

Download the DS3231 Library:

https://goo.gl/Fypc7B

---

Get the Source Code:
#include <DS3231.h>
#include <LiquidCrystal.h>

DS3231  rtc(SDA, SCL);
LiquidCrystal lcd(1, 2, 4, 5, 6, 7);
void setup() { 
 rtc.begin();
 lcd.begin(16,2);
}
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); 
}