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'll go with the easy-to-use and low-cost DS1307. To make the job really easy, we'll use the the Adafruit DS1307 RTC Breakout Board Kit - it comes with all the parts you need, just add a coin battery!
The Kit does require a little light soldering. In theory you could use all the parts and build them onto a breadboard, but the coin holder is a little difficult since its not breadboard-friendly, so please go ahead and build the kit.
When building the kit, leave out the 2.2KΩ resistors - by leaving them out, we force the RTC to communicate at 3.3V instead of 5V, which is better for the Pi!
Wiring is simple:
- Connect VCC on the breakout board to the 5.0V pin of the Pi
- Connect GND on the breakout board to the GND pin of the Pi
- Connect SDA on the breakout board to the SDA pin of the Pi
- Connect SCL on the breakout board to the SCL pin of the Pi
DONT FORGET TO POWER IT FROM 5V - THIS IS FINE AND SAFE FOR THE PI - JUST MAKE SURE TO REMOVE THE 2.2K PULLUPS AS MENTIONED IN THE LARGE RED BOX UP ABOVE TO KEEP THE I2C PINS AT 3.3V LOGIC LEVELS