To keep costs low, the BeagleBone Black (BBB) does not include a battery-backed 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, even 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 BBB!
The diagrams below show the 2.2KΩ resistors in place - but please remove them either by not soldering them in or clipping them out if you did solder them in! This way, we'll use the BBB's 1.8K pull-up resistors to 3.3V
Wiring is simple:
  1. Connect VCC on the breakout board to the P9_5 (VCC 5V) or P9_7 (SYS 5V) pin on the BBB. NOTE: The P9_5 VCC 5V pin will only be powered if a 5V adapter is plugged in to the barrel jack. If powering over USB use the P9_7 (SYS 5V) pin instead!
  2. Connect GND on the breakout board to the P9_1 (GND) pin on the BBB
  3. Connect SDA on the breakout board to the P9_20 pin of the BBB
  4. Connect SCL on the breakout board to the P9_19 pin of the BBB

DONT FORGET TO POWER IT FROM 5V - THIS IS FINE AND SAFE FOR THE BBB - 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
Check your wiring and insert the coin cell so that the + is facing up, the RTC requires a coin cell to be installed

Verify your wiring by running i2cdetect -y -r 1 at the command line, you should see ID 68 show up - that's the address of the DS1307!

This guide was first published on Jul 17, 2013. It was last updated on Jul 17, 2013.

This page (Wiring the RTC) was last updated on Jul 15, 2013.

Text editor powered by tinymce.