Creative Commons images are CC BY-NC-SA 3.0

Description: This is the SparkFun Real Time Clock (RTC) Module, this little breakout that uses the DS1307 to keep track of the current year, month, day as well as the current time. The module comes fully assembled and pre-programmed with the current time (MST) and includes a small CR1225 Lithium coin cell battery that will run the RTC for a minimum of 9 years (17 years typical) without an external 5V power supply.

The DS1307 RTC is accessed via the I2C protocol. We’ve written a test-bed to program the modules, this code should give you some insight on how to interface the module to any microcontroller using our example software I2C and BCD routines.

This rev of the Real Time Clock module finally adds I2C resistors and a larger battery pad to fix the problems with the battery shorting to the board.

Features:

  • Two wire I2C interface
  • Hour : Minutes : Seconds AM/PM
  • Day Month, Date - Year
  • Leap year compensation
  • Accurate calendar up to year 2100
  • Battery backup included
  • 1Hz output pin
  • 56 Bytes of Non-volatile memory available to user
  • 0x68 I2C Address

Dimensions: 0.75x0.75" (20x20mm)

Documents:

Recommended Products

Customer Comments

  • According to DS1307’s datasheet, it needs a minimum voltage of 4.5V to work. How can a 3V battery (CR1225) work at all?

    • Because the battery doesn’t run the module. The battery is there just to keep time when the unit is powered off, but you can’t communicate with the module at all when its just powered via the battery.

      • I found it so hard to believe that it really needed 5V that I had to check the datasheet. And it’s true! Next I checked the calendar, and we’re indeed in the 21st century! Maybe you should make a breakout board with an NXP PCF2123. This can communicate at Vdd from 1.8V to 5V, operates down to 1.1V and consumes only 100nA. That’s the 21st century! :-)

        (BTW, the PCF2123 is SPI. The I2C version is the PCF8523)

  • Does this compensate for DST (Daylight Savings Time)? Is it possible to reset the clock to a different time?

    • It does not compensate for U.S. DST or any other system. You are able to set the time to whatever you want and then the lock steps forward in minutes/hours/days/months/years automatically as time wears on. It’s possible to set it to a random date in 2004 if that’s what you send it.

  • Is it possible to run this board at the 3.3v needed for a FLORA device?

  • For just 5 dollars more you can get an Arduino shield with the same (lousy) RTC, but with also a breadboarding area and SD socket at Adafruit. Maybe this breakout board could be made cheaper if you’d use the PCF85263A instead of the DS1307. New breakout board please!

  • I found the more recent NXP PCF85263A, which is superior to the DS1307 in every way, yet costs 70% less! How about a breakout board for the 85263A?

    The DS1307 and PCF85263A compared: http://nenya.me/electronics/rtc.php

  • Is the 1 Hz square wave synced with the clock on the chip. I.E. Does the second roll over during the transition of the square wave?

    If I query the chip right before the 1 Hz pulse and right after. Will the seconds have incremented. I have looked through the datasheet and it is not clear on this.

  • Does this module include the crystal oscillator? I see that sparkfun has a 32.768kHz crystal available for sale, but it is not listed in “Also Purchased” ——-> so it doesn’t appear that people are buying them with this module.

    • Yes - it’s a complete module built around the RTC and includes the board with all the components on it as shown.

  • I confirm DS1307 work well on 3.3V GPIO with 1K pullup resistors on SDA/SCL, dont forget to unsold SJ2 jumper and supply 5V power. For information my board got 4.7K on SDA/SCL,it’s too much and dont work well. START falling edge on SDA pin is not clear with 4.7K, with 1K signal is perfect on 3.3 V GPIO.

  • So if I remove the solder jumpers on SDA/SCL it will bypass the pull up resistors. Could this then be used on a BBB using a 3.3v I2C bus instead of 5v (using the BBB pull-ups on the I2C clock and data pins)?

    Sorry for the nob question, but took so long to get a ‘bone that I don’t want to fry it by being a moron.

  • The link to the Arduino code is broken……

    • which link specifically, they all work for me.

      • The [English] Arduino Tutorial doesn’t work. I just got an error that they’re experiencing technical difficulties. The specific error message I got was this:

        (Can’t contact the database server: Can’t connect to MySQL server on ‘larry’ (111) (larry))

        I do live in the Central US, if that might somehow help, and ATT is my ISP.

        • Yeah, their site is having issues. I would just check the Bildr tutorial instead, it’s pretty good.

  • The pad says 5V but the coin cell is 3V. Can I run this on 3.3VDC if everything else on the i2c bus is 3.3VDC?

    • The coin cell does not power the unit. It only allows the device to keep track of time. Without the 5V you can not talk to the unit.

    • I too would really like to know the answer to this. Also, if I use this with a Arduino Pro Mini 328 - 3.3V/8MHz and a LiPo battery how should I get 5v into this thing?

      • Did you ever get it working off of 3.3v?

        • Looks like it shouldn’t be too hard: http://electronics.stackexchange.com/questions/98361/how-to-modify-ds1307-rtc-to-use-3-3v-for-raspberry-pi

          Just ordered this device, I’ll report back if I ever get around to trying 3.3V.

          • That’s bad advice: they’re running the RTC far out-of-spec, i.e. correct operation can’t be guaranteed, even if “it seems to work”.

          • Hi bronson, Did you ever get this to work at 3.3 by removing R1 and R2 pullups? Pre thx.

  • why would you put the SQW right in the middle of 4 primary I2C pins? shouldnt it be on one of the ends?

  • You can check out my RTCC library for the DSXXXX it has functions for setting, LCD update, display of time and temperature.

    C Sample Code

  • Is that a 0-ohm resistor and does anyone know what size coin-cell battery holder and the crystal? Any help would be much appreciated!

    • The schematic should help you derive that the two black components are 4.7kOhm resistors, the light brown one a 0.1uF capacitor, the crystal a common watch crystal (32.768kHz), and the description states “includes a small CR1225 Lithium coin cell battery”.

  • I was trying to figure out what the jumpers were for, so I tried to take a look at the schematic and eagle files, but both appear to be the older version (V1.3). Do you plan to post the ones for this revision? At the very least, do you mind saying what the apparent jumpers are for?

Customer Reviews

4.3 out of 5

Based on 4 ratings:

5 star
1
4 star
3
3 star
0
2 star
0
1 star
0

2 of 2 found this helpful:

something you need

NOBODY told me you had to SET THE CLOCK !!!! There was a lot about it was set at the factory and would go for 17 years, but nothing about that I had to set the clock. I found it in an obscure tutorial on the use of PICAXE and the I2C serial communication protocol. Please note on your SPARKFUN data spec that the breakout board has to have the data SET with a HI2COUT instruction !


1 of 1 found this helpful:

Good clock!

Easy to use, I needed to set the clock too but it is easily accomplished with one line from RTClib (google it)!


Great RTC breakout

Worked right out of the box! All I had to do is solder on a header and unsolder the solder jumpers that pulled up the SDA and SCL to +5V since the Raspberry Pi I was connecting to already has pullups to +3.3V on-board. A bit of code, 4 wires to connect, and I could read and write the time registers to set and read the time.


Awesome Product, but Lacking the Awesome SparkFun HookUp Guide

Preferred this over the “Dead On RTC”, as the I2C is easier to connect than the SPI on the ICSP for the boards i use. The product worked as intended out of the box. The clock may have been programmed, but i didn’t check. Piece of cake!

Being a thickheaded lout, the (typically awesome) SparkFun hookup guide would have been helpful to me. Still, i muddled through. I did use the AdaFruit branch of the JeeLabs library. (So i owe those folks.)