0

DS3231 RTC will not change time?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DS3231 RTC will not change time?

by Lettow1918 on Sat Dec 22, 2018 2:31 pm

All

I was working on a clock project where I am using the Precision RTC DS3231. Worked fine for several months on a breadboard. I had built a wood box for the project (supposed to be Xmas gift) fed the wires back to the breadboard one last time before soldering, and the clock stopped working, with the clock failing to recognize any time.

I double checked wiring, but it was correct. So I removed the DS3231 to its own board, ran the Example sketch from the Library, with and without specifying a time, same output. I did not have a spare UNO, but did have a spare Mega, and again same output trying both with and without specifying a time.

Also tried loading the code from two different PCs, since the Example sketch takes time from the sketch being run if you do not specify. Only thing that is different is the "time now + 7 days" is different each time, all over the map from Jan 2019 dates (so close) to 2024 and 2036 dates.

The output I get is the following, always the same first row, and time does not increment:

2165/165/165 (Sunday) 165:165:85
since midnight 1/1/1970 = 2090164689s = 24191d
now + 7d + 30s: 2036/4/3 5:48:15

Given it is a XMAS project , trying to fix it, but seems like somehow it is fried.... Any thoughts?

Lettow1918
 
Posts: 33
Joined: Sun Feb 28, 2016 2:21 pm

Re: DS3231 RTC will not change time?

by franklin97355 on Sat Dec 22, 2018 2:36 pm

Can you post pictures of your connections and soldering along with the code you are trying to run? Since it worked until you moved it the problem is most likely in the wiring.

franklin97355
 
Posts: 20127
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: DS3231 RTC will not change time?

by Lettow1918 on Sat Dec 22, 2018 8:02 pm

mega3.JPG
Picture
mega3.JPG (152.47 KiB) Viewed 112 times


Having problems inserting picture, attached as file.

At this point I have removed the DS3231 to its own breadboard. There are now just four wires. I am using the Mega for power. Tried both 5V and 3.3V. Ground. SDA and SCL (Digital pins 20 and 21). I had read online about alot of these issues are power. related So I have tried powering the RTC from a separate source as well, no change from my earlier post. Only difference is the now + 7 days time is always 2036.


Lettow1918
 
Posts: 33
Joined: Sun Feb 28, 2016 2:21 pm

Re: DS3231 RTC will not change time?

by franklin97355 on Sat Dec 22, 2018 9:03 pm

So, just to check, you have the battery installed and you are running ds3231.ino from the RTClib library? Does the serial monitor say it is setting the clock when it starts?

franklin97355
 
Posts: 20127
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: DS3231 RTC will not change time?

by Lettow1918 on Sun Dec 23, 2018 12:29 am

I am using the DS3231 example file from the RTCLib at this point.

I have actually tried running this sketch six different ways while separating the DS3231. The "default" where the time is based upon when the sketch is compiled, as well as uncommenting the line where you can set the time (which is what I use in my project). Neither works. Also, I try to run each with and without the battery. Finally with power not from the Uno, nut a separate supply. Again no difference in output on the serial monitor.

It is very odd as this ran on my bench for several months as part of my clock project. Used to let it run a day or two just to make sure the whole project was still working fine.

Not sure if it matters, but the clock I made has three LED buttons to change features: one each for Hour, Minutes and Color. The color one still works fine, the minute and hour ones no longer increment the clock. Guess that makes sense.

A Microcenter near me happened to have an Adafruit Featherwing DS3231. Not sure if it would work with an Arduino (have never used a Feather before), but the example from the RTCLib was the same, so hooked it up to both the UNO and Mega - still the same result, but not as confident in that one,

Lettow1918
 
Posts: 33
Joined: Sun Feb 28, 2016 2:21 pm

Re: DS3231 RTC will not change time?

by Lettow1918 on Sun Dec 23, 2018 12:35 am

Meant to add first line on Serial Monitor output...

RTC lost power, lets set the time!
2165/165/165 (Monday) 165:165:85
since midnight 1/1/1970 = 1558914385s = 18042d
now + 7d + 30s: 2019/6/3 12:16:31

Good news is now at least in the same decade....

Lettow1918
 
Posts: 33
Joined: Sun Feb 28, 2016 2:21 pm

Re: DS3231 RTC will not change time?

by franklin97355 on Sun Dec 23, 2018 1:09 am

You say you tried the Feather board and still did not get valid readings? You should be able to get it working on the Uno by connecting to A4 and A5 for i2c and then 5-volts and ground for power for the breakout and 3.3-volts and ground for the Feather. Here is the data on the Featherwing.

franklin97355
 
Posts: 20127
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Please be positive and constructive with your questions and comments.