Wiring the RTC

To keep costs low, the Raspberry Pi does not include a Real Time Clock module. Instead, users are expected to have it always connected to WiFi or Ethernet and keep time by checking the network. Since we want to include an external module, we'll have to wire one up.

We have three different RTC we suggest, PCF8523 is inexpensive, DS1307 is most common, and DS3231 is most precise. Any of them will do!

While the DS1307 is historically the most common, its not the best RTC chipset, we've found!

Adafruit DS1307 Real Time Clock Assembled Breakout Board

PRODUCT ID: 3296
This is a great battery-backed real time clock (RTC) that allows your microcontroller project to keep track of time even if it is reprogrammed, or if the power is lost. Perfect for...
$8.95
IN STOCK

Adafruit PCF8523 Real Time Clock Assembled Breakout Board

PRODUCT ID: 3295
This is a great battery-backed real time clock (RTC) that allows your microcontroller project to keep track of time even if it is reprogrammed, or if the power is lost. Perfect for...
$4.95
IN STOCK

Adafruit DS3231 Precision RTC Breakout

PRODUCT ID: 3013
The datasheet for the DS3231 explains that this part is an "Extremely Accurate I²C-Integrated RTC/TCXO/Crystal". And, hey, it does exactly what it says on the tin! This...
$13.95
IN STOCK

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.

CR1220 12mm Diameter - 3V Lithium Coin Cell Battery

PRODUCT ID: 380
These are the highest quality & capacity batteries, the same as shipped with the iCufflinks, iNecklace, Datalogging and GPS Shields, GPS HAT, etc. One battery per order...
$0.95
IN STOCK

Wiring is simple:

  1. Connect VCC on the breakout board to the 5.0V pin of the Pi (if using DS1307)
    Connect VCC on the breakout board to the 3.3V pin of the Pi (if using PCF8523 or DS3231)
  2. Connect GND on the breakout board to the GND pin of the Pi
  3. Connect SDA on the breakout board to the SDA pin of the Pi
  4. Connect SCL on the breakout board to the SCL pin of the Pi
Last updated on 2016-10-28 at 07.58.30 PM Published on 2012-08-31 at 01.19.59 PM