RTC stops ticking over night


I am working on an art project. I use the time shield because the system should only be active between 9am and 6pm.

The shield and the library work great. But when I power my arduino in the morning, the time is 0:0:0 and it doesn’t go to 0:0:1 or anything. I tried setting the time right before midnight and it handles it nicely.

I think it is something with the battery. I use a CR2032. It sits kinda loose in its socket but I’m sure it makes a connection.

Also, when I set the time (with the sketch that came with the library), I have to unplug my arduino for a few seconds. Otherwise the time will not change. Is this normal?

I don’t want to upload a sketch every morning to set the time. This needs to be going for a few years without touching it.

You’ll have to change the code so that the time won’t be set if you power the arduino.

Just program it for one time and make sure the shield doesn’t lose power.

Thank you for your response.

I have two sketches: one for setting the time and one for the programm.
The programm sketch never resets the time.

Tonight I left it powered and the time was correct this morning (and still ticking).
I think the battery holder isn’t perfeclty soldered or something like that.

The battery gives 3V so the battery is okay.