The Pi loses time when powered off. The Waveshare RTC HAT with DS3231 provides battery-backed timekeeping even offline.
Why RTC?
Pi has no battery-backed clock. Without NTP (internet time sync), it loses time on every reboot. Critical for data logging, scheduling, and offline deployments.
Specs
- DS3231 chip (accuracy +/- 2 ppm = ~1 minute/year drift)
- CR2032 battery backup (5+ year battery life)
- I2C interface (0x68)
- Temperature-compensated crystal oscillator (TCXO)
Setup
# Add to /boot/config.txt:
dtoverlay=i2c-rtc,ds3231
# Remove fake-hwclock:
sudo apt remove fake-hwclock
# Set time: sudo hwclock -w
# Read time: sudo hwclock -r
Time Sync Strategy
On networks with NTP: RTC syncs from NTP at boot, provides backup if NTP unavailable. Offline: RTC is the sole time source. Drift is ~1 minute per year.
Projects
- Data logger with accurate timestamps
- Scheduled task execution without internet
- Time-stamped security camera footage
- Industrial process timing
Frequently Asked Questions
DS3231 vs DS1307?
DS3231 has TCXO for +/-2ppm accuracy. DS1307 drifts more (up to 2 min/month). Always choose DS3231.
Battery life?
CR2032 lasts 5-10 years in standby. The RTC only draws microamps from the battery.
Works with Pi 5?
Yes, I2C is standard across all Pi models.
Multiple RTCs?
Not needed. One RTC syncs the system clock at boot.
Conclusion
The RTC HAT is essential for any Pi deployment that needs accurate time without internet access.
Browse the full Waveshare collection at Zbotic.in with fast shipping across India.
Add comment