Go Down

Topic: DS1307 Real time clock on breadboard (Read 68791 times) previous topic - next topic


Shiwa, i think the year is only one byte like RTC.set(DS1307_YR,13); = 2013; You also need to set them in order like

Wire.send(decToBcd(second));    // 0 to bit 7 starts the clock
Wire.send(decToBcd(hour));      // If you want 12 hour am/pm you need to set
                                  // bit 6 (also need to change readDateDs1307)


alm 7100 thank you, I will try, if I have some time


Sorry, I hadnt seen the updates added to my original post.
I hadnt tried anything higher than 2010 on my setup.



I used the next instructions:


it works fine   ;D , tried again today to be sure..

----------->  BUT if I change :

 RTC.set(DS1307_YR,13);   //<--------------- 13 !!

I see on the display the year 2000 !!! not 2013... >:(

Perhaps this sort of high level instructions does not work all the way ?


Jul 25, 2010, 04:09 am Last Edit: Jul 25, 2010, 04:14 am by Jeremy1998 Reason: 1
From the retail boards that I've seen, there is normally a capacitor (Looks to be 0.1uF.), and two resistors (On the Ladyada version they are 2.2K). What does this do?

From what I understand the resistors are in line with the serial clock and serial data. I also understand that the cap is for power smoothing? I don't know if it's on the battery line, or the regurlar supply... Can someone please confirm or correct this?

EDIT: From what I understand from the datasheet, the resistors are pull up resistors that go from VCC (+5V) to the serial data and the serial clock pins.


I havnt used the external pullup resistors. The internal ones seem to do the job.
The capacitor seems to be for smoothing but again I havnt used one as im powering it from the arduino which already has a good power supply.



Hi All,

I tried to build the same using the DS1307 on a general purpose PCB, but since i did not have the 32.768 crystal, I had to use the little crystal from a kids digital watch.

Everything worked fine, but i do see that there is a offset of ~ +10 min / day in the clock.

Do you think it could be a issue with the crystal I am using ?

Also the refresh rate for the clock read (RTC.read) command is 500ms.

I will try with the correct crystal and update if that worked.


Sep 05, 2010, 03:38 am Last Edit: Sep 05, 2010, 03:56 am by liuzengqiang Reason: 1
Something is weird. Here is what I got when I connected a 3V coin battery.
36 29 20 1 45 45 2165
37 29 20 1 4 9 2010
38 29 20 1 4 9 2010
0 0 0 0 0 0 2000
0 0 0 0 0 0 2000
41 29 20 1 4 9 2010
42 29 20 1 4 9 2010
0 0 0 0 0 0 2000
0 0 0 0 0 0 2000
45 29 20 1 4 9 2010
46 29 20 1 4 9 2010
0 0 0 0 0 0 2000
48 29 20 1 4 9 2010

If I disconnect the 3V battery I get normal results. Any suggestions? I found the library from a later page on that forum topic and should be a good version.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter



liudr, I have the same issue, theres a thread a few pages back.  I never did find the cause.


Isn't that missing two 22pF condenser on the crystal ?


The ds1307 has internal capacitors.


Why isn't the onboard crystal oscillator suitable for a realtime clock?  :-?


Prob, energy consumption. The clcok is always on, thats the reason the freq is low as possible for cristals. Energy consumption is related to freq.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131