RTC lost track of time after unpowered

I use Arduino Nano, DS3231 RTC, and OLED to show current time. I left Arduino and its modules unpowered for 2 weeks and when I powered them up again, OLED started showing time 00:00. However the RTC battery is not dead because when I power off for say, a few minutes it still keeps track of time. Is this normal behaviour?

  • First things first; change the RTC battery to see if it is a battery problem.

  • Does your RTC have its battery charging circuit disabled ?

  • Show us your schematic and sketch.

1 Like

What was the battery voltage after 2 weeks with the DS3231 not powered ?

unfortunately I do’nt have another battery

How can I verify that?

Ok

I didn’t measure the voltage. I will do it.

Well, no, it is not normal behavior. The whole point of having the coin cell is to make sure the RTC continues to keep time when Vcc power goes out.

Could you post your code and a circuit diagram?

Actually, it's almost certainly the battery, or the battery's connection to the RTC. If the time was frozen at the time when Vcc power was removed, then it could be the /EOSC setting in the Control register. But if the time is really zeros, then you've lost power.

How old was the battery when you completed and started your project? How long had the DS3231 module and it's battery been stored in a shipping container or warehouse before you received it?

Thank you @ShermanP and @JCA34F

So I re-synchronized the time and then I experimented powering off for more than 30 minutes and it is still keeping time, which makes me believe the battery is not that bad.

TO ALL:

I FORGOT to mention one detail: after the 2 weeks unpowered, I decided to add a watchdog to my code! That might have been the culprit. I had set watchdog to 2 seconds, and Arduino kept rebooting, so I realised that was probably because my loop was longer than 2 seconds, then I set watchdog to 8 seconds and Arduino is working ok. So WATCHDOG might have something do to with the RTC issue. What are your thoughts everyone.

What kind of battery? CR2032 (not rechargeable) or LR2032 (rechargeable)?

If youus a ZS-042 RTC module like below

and you're not using a rechargeable battery I suggest that you read ZS-042 DS3231 RTC module.

1 Like

Battery the right way in?
It's quite easy to short coin cells at the edges. Insert perfectly parallel to the holder and don't be tempted to use something conductive to push it in.
I've got the module in post #9 or very similar and it's been running for several years through power cuts and still keeping very good time -/+ one second per month against NPL MSF clock.

1 Like

What exact coin cell are you using?

This explains what @LarryD was getting at, and how to fix it if necessary.

https://campercontrol.devcave.uk/step-1-assembling-control-box/modifying-rtc-module/

a7

1 Like

Check the battery soldering. I came across one of those modules with a soldering defect.

1 Like