DS1302 Real-Time Clock (RTC) Module
Battery-Backed Timekeeping with Simple 3-Wire Interface
A microcontroller has no real sense of wall-clock time on its own - millis() only counts time since the last power-up or reset, and that count is lost completely every time power drops. The DS1302 solves this by being a dedicated, self-contained timekeeping chip: it tracks seconds, minutes, hours, day, date, month, and year, with automatic leap-year correction built in, using its own internal oscillator, and critically, it keeps running on a tiny backup coin-cell battery even while the rest of your project is completely powered off - so the correct time survives power cycles, resets, and reprogramming. It communicates over a simple synchronous 3-wire interface (a chip-enable-like line, a clock line, and a single bidirectional data line) rather than I2C, and internally stores its date/time fields in BCD (binary-coded decimal) format, meaning each byte's two nibbles directly represent two decimal digits - a detail your code needs to convert to and from when reading or setting the clock.
Key features
Battery-Backed Timekeeping
A coin-cell backup keeps the clock running through complete power loss.
Full Calendar Tracking
Seconds, minutes, hours, day, date, month, and year with leap-year correction.
Simple 3-Wire Interface
No I2C address conflicts - a dedicated CE/CLK/DATA connection.
Onboard Trickle Charger
Some breakouts can trickle-charge a rechargeable backup cell.
Built-In RAM
A small block of battery-backed general-purpose RAM for persistent settings.
Low Power Draw
Draws only a few hundred nanoamps from the backup battery when main power is off.


