Kit Review – adafruit industries DS1307 Real Time Clock breakout board kit
Hello readers
Today we are going to examine another small yet useful kit from adafruit industries – their DS1307 Real Time Clock breakout board kit. My purpose of acquiring this kit was to make life easier when prototyping my clock and timer Arduino-based projects on a breadboard. For example, blinky, or the various clock projects in the Arduino tutorials.
When breadboarding a DS1307 circuit, there are a few problems – the legs of the crystal are very fine, and break easily, and trying to mount the backup battery holder on the breadboard can be difficult due to their odd pin-spacing. That is why this breakout board is just perfect for breadboarding.
Finally, (in Australia anyway) the price of the kit is less than the sum of the retail cost of the parts required. Anyhow, time to get cracking!
Again, as usual the adafruit kit packaging is simple, safe and reusable:
And with regards to the contents within:
… no surprises here, another quality solder-masked, silk-screened PCB that has everything you need to know printed on it. Now that you can see the crystal (above image, bottom-right) you can realise why this board is a good idea. Furthermore, the inclusion of a quality battery and not some yum-cha special is a nice touch.
Assembly is incredibly simple. The IC position is printed on the PCB, the resistors are the same, and the capacitor and crystal are not polarised. Again, no IC socket, but perhaps it is time not to worry about that anymore – my soldering skills have improved somewhat in the last twelve months. Plus the DS1307 can handle 260 degrees Celsius for ten seconds when soldering (according to the data sheet.pdf).
However if you like to read instructions (which is generally a good idea) the excellent documentation is laid out here for your perusal.
Soldering the board is quite straightforward, however when it comes time to solder in the coin cell holder, note that there are large gaps in the mounting holes:
It is important to solder the pins solidly to the PCB, without letting lots of solder flow through the hole and block the other side. If you can bend the pins slightly closer to the circumference of the hole, soldering will be a lot easier. And don’t forget to put a blob of solder on the top-facing pad between the two pin holes before soldering in the coin cell holder.
Finally, when time to solder in the header pins, mount the lot onto a breadboard, and support the gap between the PCB and the breadboard at the opposite end of the PCB. An old CD works very well:
And within ten minutes of starting, we have finished!
Insert the backup cell (writing facing up!) in the holder and you’re ready to time. A new backup cell should last between seven to ten years, so unless you want to reset the clock completely, leave the cell in the board.
Now it is time to use the board. My only experience is with the Arduino-based systems, and even so using the DS1307 can seem quite difficult at the start. However with the right library and some basic reusable sketch modules you can do it quite successfully. The board is a standard DS1307 circuit, and is explained in great detail within the data sheet.pdf.
Don’t forget you can get a nice 1 Hz (or 4, 8 or 32 kHz) square wave from this IC – here is a sketch that allows you to control the square-wave generator:
/*
DS1307 Square-wave machine
Used to demonstrate the four different square-wave outputs from Maxim DS1307
See page nine of data sheet for more information
John Boxall - tronixstuff.wordpress.com
*/
#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68 // each I2C object has a unique bus address, the DS1307 is 0x68
void setup()
{
Wire.begin();
}
void sqw1() // set to 1Hz
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.send(0x07); // move pointer to SQW address
Wire.send(0x10); // sends 0x10 (hex) 00010000 (binary)
Wire.endTransmission();
}
void sqw2() // set to 4.096 kHz
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.send(0x07); // move pointer to SQW address
Wire.send(0x11); // sends 0x11 (hex) 00010001 (binary)
Wire.endTransmission();
}
void sqw3() // set to 8.192 kHz
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.send(0x07); // move pointer to SQW address
Wire.send(0x12); // sends 0x12 (hex) 00010010 (binary)
Wire.endTransmission();
}
void sqw4() // set to 32.768 kHz (the crystal frequency)
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.send(0x07); // move pointer to SQW address
Wire.send(0x13); // sends 0x13 (hex) 00010011 (binary)
Wire.endTransmission();
}
void sqwOff()
// turns the SQW off
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.send(0x07); // move pointer to SQW address
Wire.send(0x00); // turns the SQW pin off
Wire.endTransmission();
}
void loop()
{
sqw1();
delay(5000);
sqw2();
delay(5000);
sqw3();
delay(5000);
sqw4();
delay(5000);
sqwOff();
delay(5000);
}
And here is a demonstration of measuring the SQW output with a very old frequency counter:
adafuit have written about using this with Arduino, or you may like my way of doing things in Getting Started with Arduino - Chapter Seven.
Well I hope you found this review interesting, and helped motivate you to expand your knowledge and work with real-time clocks, Arduino and the I2C bus.
You can purchase the kit directly from adafruit industries.
As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts. Or join our new Google Group. High resolution images are available on flickr.
[Note - The kit was purchased by myself personally and reviewed without notifying the manufacturer or retailer]
Otherwise, have fun, be good to each other – and make something! ![]()









Hello,
Thanks for doing the reviews of Adafruit products. I think she does a great service with her tutorials, instructions and construction of the kits themselves.
I have used other products from her and recommend them.
Don
Hi Don
Yes, their products really are that good – that is why I review and use them. Plus I find their open business philosophy is quite inspiring.
Crikey you’re quick off the mark
Thanks for dropping by!
john
Hi John,
My experience with RTC’s is in the PC world. I’m guessing that this Adafruit kit could be used as the basis for a simple on/off device to control an electric light, simple coffee, etc. Usual caveats re: interfacing with wall current of course.
I’ve got an Adafruit Arduino kit, plus a couple of books, and just today, their basic electronics hardware kit, (multimeter, soldering iron, third hand etc).
Thanks for the review.
Hello
Thanks for your comments. Yes, the DS1307 kit will provide a nice timing solution for Arduino projects (and others). Using your arduino board and this kit, you can create an almost infinite number of timing solutions. Adafruit actually sell the perfect device for controlling 110V AC with an Arduino – this > http://bit.ly/ctrI74
There are some examples of programmable Arduino-based timers that could control the powerswitch tail in tutorial chapter ten > http://wp.me/pQmjR-rm
Have fun
john
Hi John,
Thanks for the reply.
Based on your notes, I’m thinking that adding a DS1307 kit to my Arduino, and connecting my Arduino to the connectors on the Adafruit powerswitch tail would allow me to make a sketch to turn on and off the power to an attached device, such as a lamp, on a simple schedule.
I won’t bug you anymore about this
You’ve definitely pointed me in the right direction.
Many thanks,
Joel
Absolutely, spot on. Soon you will be creating all sorts of timing applications!
Thanks for your enjoyment and kind words. You can keep bugging me if you like.
cheers
john