Here's a fact that surprises a lot of people: a microcontroller has no idea what time or date it is. Every time it loses power, it forgets everything — there's no built-in calendar the way a phone or computer has. The Tiny RTC module fixes that: it's a tiny chip with its own coin-cell battery, so it keeps ticking the real date and time even while your board is completely unplugged.
1. Real-World Uses
Anything that needs to know when something happened, not just that it happened, needs a real-time clock:
- Data logging with real timestamps — a temperature log is much more useful when each reading says "2026-08-25 14:30" instead of just "reading #4,281."
- Scheduled actions — water the plants at 8 AM every day, or turn on a light at sunset, by checking the current hour against a target.
- Attendance / access-control systems — recording exactly when a badge was scanned or a door opened.
- Anything that must survive a power cut — since the coin-cell battery keeps the clock ticking even with the main board completely unplugged, you never lose track of the correct time.
2. Hardware Specifications & Addresses
The Tiny RTC module combines three things on one small board:
- RTC chip: a DS1307 or DS3231 Real-Time Clock, at a fixed I2C address
0x68. - EEPROM chip: an AT24C32 4KB memory chip, at a fixed I2C address
0x57— handy for storing small amounts of data that also needs to survive a power cut. - Battery: a CR2032 3V coin cell, which is what actually keeps the clock running when the board loses power.
[!NOTE] Both chip addresses are fixed — there are no address-select pins like the LCD I2C backpack (10.3) has. That means you can only use one Tiny RTC module per I2C bus; a second one would collide on the same addresses.
3. How the Clock Stores Time (BCD Format)
The RTC chip stores each part of the date/time (seconds, minutes, hours, etc.) as one byte in a format called Binary Coded Decimal (BCD) — instead of storing the number directly, it stores each decimal digit in its own 4-bit half of the byte. For example, the number 42 is stored as the byte 0x42, not the byte 42 (which would be 0x2A in normal binary). Converting between the two is simple arithmetic:
Every block below that reads or sets a time value does this conversion for you automatically — you always work with normal decimal numbers.
