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 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.
The supply voltage for the RTC DS1307 needs to have a 5V input so it is not directly compatible with a 3.3V device (like a 3.3V Arduino or a Raspberry Pi). You would need to do some modifications before being able to use it with a 3.3V system.
You might be able to get away with just connecting the RTC to your 3.3V Arduino because of the open drain drivers => https://learn.sparkfun.com/tutorials/i2c#i2c-at-the-hardware-level . Otherwise, you might want to use a dedicated I2C logic level converter for the I2C pins => https://www.sparkfun.com/products/11955 . For the SQW pin, we recommend doing using a logic level converter https://www.sparkfun.com/products/12009 or voltage divider since the I/O of the Arduino is 3.3V.
For a Raspberry Pi, you can remove the solder jumpers for the pull-up resistors so that you can just use the Raspberry Pi’s internal pull-up resistors. For the SQW pin, we recommend doing using a logic level converter https://www.sparkfun.com/products/12009 since the GPIO for the Raspberry Pi is 3.3V.
Arduino I2C appears to lock sometimes when trying to communicate with the DS1307. There is a modified I2C library here to detect when this happens and resets the clock => http://www.paulodowd.com/2015/04/ds1307-woes-i2c-freezes-and-locks.html
This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.
Skill Level: Noob - Some basic soldering is required, but it is limited to a just a few pins, basic through-hole soldering, and couple (if any) polarized components. A basic soldering iron is all you should need.
See all skill levels
If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.
Skill Level: Competent - The toolchain for programming is a bit more complex and will examples may not be explicitly provided for you. You will be required to have a fundamental knowledge of programming and be required to provide your own code. You may need to modify existing libraries or code to work with your specific hardware. Sensor and hardware interfaces will be SPI or I2C.
See all skill levels
If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.
Skill Level: Rookie - You may be required to know a bit more about the component, such as orientation, or how to hook it up, in addition to power requirements. You will need to understand polarized components.
See all skill levels
Based on 13 ratings:
1 of 1 found this helpful:
I have used this chip twice with an Arduino Uno: (1) To adjust the elevation angle of a pole mounted Solar array, and (2) To inject a specified amount of EM1 algae control solution into a grey water tank. Both projects required knowledge of real time (Month, Day, and Time). The chip itself is easy to use but requires some understanding of its internal programming and its I2C register assignments. The best source of understanding that I have found is an archived article from Hobby Robotics titled "An I2C Bus Example Using the DS1307 Real-Time Clock". This article, and its large number of following questions/answers, can be found at http://www.glacialwanderer.com/hobbyrobotics. This article, written by Maurice Ribble, provided all I needed to know about programming the chip and reading it's registers. Two words of advice to other novice users: (1) Don't use the square wave (SQW) output capability unless you actually need it. The chip's on-board battery lifetime is significantly reduced if you enable this function. (2) The chip's internal programming regularly outputs to 7 register locations that include second, minute, hour, dayOfWeek, dayOfMonth, month, and year (in that order). You can not change (or delete) the information loaded into each of these register locations. If you do not need all of that stored information for your intended purposes, simply modify your "get" program and request only what you need by name. For instance, you may not need dayOfWeek, but you must at least initialize this register when you are setting the starting time. (Be sure to comment out the initialization statement in your program after you have properly set time within the chip. Otherwise, when Arduino reboots (perhaps due to a power outage), the chip will be reinitialized to an incorrect starting time/date.)
1 of 1 found this helpful:
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.)
1 of 1 found this helpful:
Easy to use, I needed to set the clock too but it is easily accomplished with one line from RTClib (google it)!
2 of 2 found this helpful:
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 !
I recently got an email from SparkFun with a clock project using a DS1307 and 3 5V volt meters. It looked interesting so I built one. This DS1307 module is easy to use -- you just have to watch out for the 24 hr bug in the SparkFun DS1307 library, which I fixed in my GITHUB fork. It would also be nice if the library provided access to the DS1307's 56 bytes of battery backed ram, which I plan to add to my fork (because I want to use it).
But the DS1307 module itself is great.
This is a good solution for take time into account
In my case, the only problem was battery, it run fewer than expected.
Using it to do the timing for an automatic fish feeder as part of a high school programming, hardware, 3D printing project. The hardware being an Arduino Uno,
I got one of these to go on my arduino that is wired into my car. Previously the arduino just had a proto-shield on top with some relays, wire connectors, and a BlueSmiRF Gold. I was using it to be able to remote start my car from either my cell-phone or the Raspberry Pi in my house. It was working great.
I installed this module so I would be able to send a command from my phone to tell the car to start up at a certain time so it would start itself in the morning, warm up for 20 minutes, and shut off all automatically at a certain time without me needing to do anything. At first the library file from SparkFun would not compile but apparently that was a problem with me having an outdated version of the arduino software on my desktop. After updating arduino on my PC everything compiled and worked fine.
The best part about this module is that you only have to set the time once and because of the battery, it stays set forever without having to keep power to the board all the time. So you can just upload a sketch to your arduino that only sets the time, set the time once, then rewrite your arduino with the actual code you will be using and you don't have to set the time again. There's no need to have code to set the time in the actual arduino program you will be using.
I used the DS1307 RTC to provide time for an Arduino, to control an external circuit that turns on a light once a day, an "alarm" light. When I view the output of the Arduino through the serial output, the clock time advances by several minutes, and I have to reset the module with a rtc.autoTime() command.
Easy hookup and fast delivery over the holidays.
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.
Almost the smallest I've found. However, I'm designing a board that could use any available RTC. Adafruit, Ebay finds, etc. They mostly have similar pin configurations, except for this one. I'll have to include two header options, because the small size outweighs the inconvenience.
This module was exceptionally easy to hook up with an Arduino. Breakout board made it easy to test on a breadboard and then solder directly into the completed project. A minor improvement would be to add a non-connected hole and pad opposite the primary header holes to allow and additional header pin to be installed and make permanent installation onto another PCB sturdier.