Skip to content

Adding a RTC to Raspberry Pi

bwasmith edited this page Aug 29, 2016 · 6 revisions

A RTC, or "Real Time Clock", will be used to keep track of time for our datalogger.

##Overview When a Raspberry Pi turns on, it asks the internet what the local time is. If there is no internet connection, it will fall back to a default time.

Because we wish to start up the Raspberry Pi out in the field, it is necessary to keep a module responsible for tracking time. We will use Adafruits breakout board for the DS1307. It works just as the clock in your watch does.

This chip will communicate with our raspberry Pi via a communication protocol called I2C ("i squared c").

###Setting up I2C

Please follow these instructions to set up the Pi for I2C.

###Connecting the RTC

With I2C configured for our Pi, we connect the RTC. Refer to Adafruit's wiring instructions

As of August 2016, DO NOT follow the instructions to "Set RTC Time". Instead, please refer to AB Electronics' RTC Pi on a Raspberry Pi Raspbian Jessie.

###Testing the RTC After this is said and done, you should be able to test to see that your RTC works correctly.

Disconnect from the internet, reboot the pi, see if the time was set!

If your Pi connects to the internet automatically, run

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

To change the name of your wifi temporarily so it does not connect.

If the time shows up correctly without the internet, you have successfully added the RTC to your Raspberrry!

Clone this wiki locally