This guide is for Pi models prior to the Pi5, which has a built in RTC. For Pi5 see here: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#real-time-clock-rtc
For stand-alone projects with no network connection, you will not be able to keep the time when the power goes out. So in this project we will show you how to add a low cost battery-backed RTC to your Pi to keep time!
RTC Options
Adafruit currently offers three different RTC options in the shop. As a general summary:
- PCF8523 is inexpensive
- DS3231 is most precise
- DS1307 is historically most common
While the DS1307 is historically the most common, it is not the best RTC chipset, we've found! However, any of these RTC options will function on a Raspberry Pi.
These RTC options also come in various form factors. The oldest style has only a row of headers and requires soldering. Newer style include STEMMA QT connectors to provide a solderless connection option. For the PCF8523 and DS3231, there are also a Pi specific version that will mount directly to the Pi's GPIO header.
RTC Battery
Don't forget to also install a CR1220 coin cell. In particular the DS1307 wont work at all without it and none of the RTCs will keep time when the Pi is off and no coin battery is in place.
Page last edited April 07, 2026
Text editor powered by tinymce.