The DS3231 RTC module does not retain the time everytime I powered-off or reset

You set the time once only.

After that, you don’t need that line of code as the RTC time was set previously.

  • Set the RTC by uploading the sketch.

  • Comment that line of code, then upload the code a second time.

1 Like