Adafruit DS1307RTC Not Keeping Correct Time When Unplugged

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
JJohnson062
 
Posts: 4
Joined: Mon Jun 25, 2018 10:25 pm

Adafruit DS1307RTC Not Keeping Correct Time When Unplugged

Post by JJohnson062 »

Hi,

I have a project that I am working on, and I have an Arduino UNO with an RTC, SD card reader, LCD screen and a couple pressure transducers..
I have everything hooked up and soldered correctly (to my knowledge) and everything is working perfectly, with the exception of the clock.

When I update the sketch, the time is accurate. However, when I unplug the Arduino after uploading the sketch, and wait a few minutes to pass, the RTC will not keep the correct time, and will instead reset back to the same time that I uploaded the sketch onto the Arduino. I need it to maintain the correct time.

My RTC device is from Adafruit, and is the DS1307 RTC Breakout.

Any help would be greatly appriciated!

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: Adafruit DS1307RTC Not Keeping Correct Time When Unplugg

Post by Franklin97355 »

There is a line of code in the examples that sets the RTC to the compile time that you need to comment out or remove.

User avatar
JJohnson062
 
Posts: 4
Joined: Mon Jun 25, 2018 10:25 pm

Re: Adafruit DS1307RTC Not Keeping Correct Time When Unplugg

Post by JJohnson062 »

Thank you for the quick reply, Franklin, I appreciate your assistance.

I haven't had much time to play around with the matter, but when I get home tonight I will try to mess around some more.
I will try what you suggested and let you know how it works out.

Thank you!

User avatar
JJohnson062
 
Posts: 4
Joined: Mon Jun 25, 2018 10:25 pm

Re: Adafruit DS1307RTC Not Keeping Correct Time When Unplugg

Post by JJohnson062 »

franklin97355 wrote:There is a line of code in the examples that sets the RTC to the compile time that you need to comment out or remove.
As it turned out, you were correct! I commented out the "adjust" and sure enough it works just fine now!

Cheers.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”