RTC date and time gets cleared

Looking for help, I have an RTC ds2321 connected to the arduino uno with a servo stepper motor and controller shield. I am attempting to turn the stepper motor based on the time of day which I have achieved. My problem is the RTC losers the date and time settings when I turn the external power source off and on. It does not do this when I remove the USB power source. I am using two buck converters to deliver power one outputs 12 volts and the other 6 volts. The RTC utilisers 3.3v from the arduino. I have replaced the batteries on the RTC shield which has not solved the problem and would not appear to be the problem as it holds the time and date if I disconnect the USB and there is no other power connected. Any ideas. Thanks

Hi David,

Hmm, that sounds a bit strange. Ignoring the rest of your connections, could you post a photo or draw a diagram of exactly how you’ve got the RTC connected to your microcontroller? What platform are you using? I’m assuming an Arduino or Pi?

What’s the code you’re running to get the time and date, are you using a library? What’s the exact product with the ds2321 that you’re using?

Hi Sam, I believe I have solved the problem, when I started putting the information together to answer your questions I noticed that I did not have the ground connected from the arduino to the RTC. I did have the ground connected from the two buck converters. Since connecting the ground I have not had the problem. Thanks

1 Like

Hi David,

Awesome! Glad to hear you got everything up and running, best of luck with the projects!