My projects and ramblings

Welcome to My Scratchpad
Thursday, March 30 2017 @ 11:32 PM BST

DS1307 Real time clock on a breadboard

Heres my simple real time clock on a breadboard. 



Using the DS1307
The breakout boards you can buy seemed a bit expensive so I decided to hook up the cheap components on a breadboard to try out on my Arduino.

The Crystal is 32.768kHz.
The battery is a 3v coin cell in a holder.


Heres a schematic of the breadboard.
The photo doesn't completely match the schematic but the wiring and pins are correct.

Thanks to for the inkscape template.

I used the code from this forum topic
You need to install the DS1307 library from there.
This code was compiled on version 13 of the ide with a 328p but will work with a standard arduino.

#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h>

int rtc[7];

void setup()

void loop()

  for(int i=0; i<7; i++)
    Serial.print(" ");



To initialy set the time uncomment the RTC.set lines and change the values.
Once youve done this the clock is set and the 3v battery keeps the time.

Eventually its going to be incorporated in my main project.
A temperature logging device with one wire temp sensors ,web server, serial lcd display, buttons and using the 328p. But its an ever evolving project. Once I get the time tied up with the temp data, Ill be nearly there.


Trackback URL for this entry:

Here's what others have to say about 'DS1307 Real time clock on a breadboard ':

Verbouwingsgids from Verbouwen
Alles over aannemers en verbouwen [read more]
Tracked on Saturday, June 23 2012 @ 07:25 PM BST

DS1307 clock from clock dFwHxv
DS1307 Real time clock on a breadboard - My Scratchpad [read more]
Tracked on Monday, October 20 2014 @ 03:57 PM BST