Real-Time Clock (RTC) DS3231 Project
The Real-Time Clock (RTC) project showcases the use of the DS3231 RTC module to maintain precise timekeeping with an Arduino Mega. The DS3231 includes an integrated temperature-compensated crystal oscillator, which ensures accurate timekeeping even when the Arduino is powered off.
Components Needed
- Arduino Mega
- DS3231 RTC Module
- Jumper Wires
- Breadboard
- Power Supply
Block Diagram
Circuit Setup
Connecting the DS3231 RTC Module to Arduino Mega:
Instructions
Library Installation:
Ensure the RTClib library is installed in the Arduino IDE. You can install it via the Library Manager (
Code Upload:
Open the Arduino IDE and create a new sketch.
Copy and paste the provided Arduino code into the sketch.
Upload the code to the Arduino Mega.
Testing:
Open the Serial Monitor in the Arduino IDE (set to 9600 baud) to monitor the current time and date output by the DS3231 RTC module.
The time will be set to the compile time of the sketch if the RTC lost power. You can also set the time manually by uncommenting and adjusting the