DS1307 Date and Time Will Not Reset

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

DS1307 Date and Time Will Not Reset

Postby Maxxim » Fri May 04, 2012 8:58 am

I purchased and assembled the “DS1307 Real Time Clock breakout board kit”. The kit worked beautifully for about a week and then it started returning a very strange time and date (see exhibit #1). I pulled the battery for about 1 min hoping that it would return to the beginning time and date but instead it is returning the time and date in exhibit #2. It is also no longer incrementing time. Does anyone have a clue how to reset the clock?


Exhibit #1
2165/165/165 165:165:85
since 1970 = 1396050385s = 16157d
now + 7d + 30s: 2014/4/4 23:46:55


Exhibit #2 (notice that the time is not incrementing).
RTC is NOT running!
2165/165/165 165:165:85
since 1970 = 1396050385s = 16157d
now + 7d + 30s: 2014/4/4 23:46:55

2165/165/165 165:165:85
since 1970 = 1396050385s = 16157d
now + 7d + 30s: 2014/4/4 23:46:55

I did un-remark the time setting command "RTC.adjust(DateTime(__DATE__, __TIME__));" to set the clock to compile time. No luck.

Code used to set the clock:
Code: Select all
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib

#include <Wire.h>
#include <RTClib.h>

RTC_DS1307 RTC;

void setup () {
    Serial.begin(57600);
    Wire.begin();
    RTC.begin();

  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    //RTC.adjust(DateTime(__DATE__, __TIME__)); 
  }

}

void loop () {
    DateTime now = RTC.now();

    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();

    Serial.print(" since 1970 = ");
    Serial.print(now.unixtime());
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    Serial.println("d");

    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now.unixtime() + 7 * 86400L + 30);

    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print('/');
    Serial.print(future.month(), DEC);
    Serial.print('/');
    Serial.print(future.day(), DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(':');
    Serial.print(future.minute(), DEC);
    Serial.print(':');
    Serial.print(future.second(), DEC);
    Serial.println();

    Serial.println();
    delay(3000);
}
Maxxim
 
Posts: 3
Joined: Fri May 04, 2012 8:28 am

Re: DS1307 Date and Time Will Not Reset

Postby adafruit_support_bill » Fri May 04, 2012 10:08 am

Post photos of your soldering and connections. This is a symptom of a bad connection somewhere.
User avatar
adafruit_support_bill
 
Posts: 16071
Joined: Sat Feb 07, 2009 9:11 am

Re: DS1307 Date and Time Will Not Reset

Postby Maxxim » Fri May 04, 2012 1:37 pm

I have two pictures ready. One of the bottom and one of the top. I can't upload them here (invalid file error) so the links below will take you to them.

https://picasaweb.google.com/1057769545 ... directlink

This was my first soldering job but it did work for about 1 week before the problem developed.

Thanks in advance for your help.

John
Maxxim
 
Posts: 3
Joined: Fri May 04, 2012 8:28 am

Re: DS1307 Date and Time Will Not Reset

Postby adafruit_support_bill » Fri May 04, 2012 1:44 pm

The 5v and SDA pins on top need a bit more solder. The back-side photo is a little too dark to see well, but look closely at the joints and re-touch any that are not smooth and shiny. A 'frosted' appearance indicates a cold joint and they can become intermittent over time.

Also, did you remember to put a blob of solder under the battery clip? It is needed to assure good contact with the battery.
User avatar
adafruit_support_bill
 
Posts: 16071
Joined: Sat Feb 07, 2009 9:11 am

Re: DS1307 Date and Time Will Not Reset

Postby Maxxim » Fri May 04, 2012 1:53 pm

I will touch them up and take new pictures and post them. I did add the solder to the battery area as well. I will include a picture of that as well.
Maxxim
 
Posts: 3
Joined: Fri May 04, 2012 8:28 am

Re: DS1307 Date and Time Will Not Reset

Postby buckidge » Fri Oct 12, 2012 11:50 am

I second this as a solution to the problem. I just got done re-soldering my connections and this fixed the exact same problem as the original post described.
buckidge
 
Posts: 1
Joined: Fri Oct 12, 2012 11:49 am


Return to Microcontrollers

Who is online

Users browsing this forum: No registered users and 3 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [107]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]