: Once the time is set, the DS1302 uses an external backup battery (like a CR2032) to keep time even when the Arduino is powered off. Standard Wiring Diagram The DS1302 requires five pins for operation:
While it can work with others, this library is primarily used with the . It is a low-power, serial RTC that tracks seconds, minutes, hours, days, date, months, and years. Key Features of the DS1302 Module:
: Manages seconds, minutes, and hours (including 24-hour or AM/PM formats). virtuabotixrtc.h arduino library
If you have ever built an Arduino project that involves logging data, controlling appliances based on the clock, or creating a digital clock, you have faced a fundamental challenge:
// LCD pin mapping (RS, E, D4, D5, D6, D7) LiquidCrystal lcd(12, 11, 5, 4, 3, 2); : Once the time is set, the DS1302
#include <virtuabotixRTC.h>
virtuabotixRTC.h library is a popular, user-friendly Arduino library designed specifically to interface with the DS1302 Real-Time Clock (RTC) module. It simplifies the process of setting, updating, and reading time data (seconds, minutes, hours, day, month, year) from the module using only three pins. Key Features of the DS1302 Module: : Manages
To get the time from the chip, you must call updateTime() . This fetches the current second, minute, hour, day, date, month, and year from the DS1302 and stores them in the object's public variables.