DS3232 RTC - cannot get this to work


(I've seen a number of posts with issues about this, but cannot find a solution which matches my problem, sorry if my question does, in fact, have a well documented solution)

I've been trying to get my head around this with a simple sketch before I try to incorporate it into bigger things - code pasted at end.

Many suggests involve using different libraries, and after testing several I've found this one does not actually give me any errors.

There are no errors at any stage, however the monitor just returns zeros, which the library documentation suggests is inability to see the RTC module. I've attached a screenshot of the monitor output

I've tried the IR2 test program from here, and it says it's finding the device which suggests there isn't a hardware fault

The code I'm using is below

// DS3232RTC - Version: Latest
#include <DS3232RTC.h>
#include <Wire.h>

DS3232RTC rtc;

void setup() {


setTime(18, 34, 00, 13, 3, 2021);


void loop() {

time_t myTime;
myTime = rtc.get();




Any help with resolving this would be gratefully received

Best wishes

Screenshot 2021-03-14 at 08.58.50.png

Screenshot 2021-03-14 at 08.58.50.png

Which address was found by the I2C Scanner sketch ? Is it 0x68 ?

That library is used together with the TimeLib. Have you installed that ?
I think that you have to call the setSyncProvider() function.
Where did you find the example code ? it is for the Adafruit RTC library.

Is something else connected to your I2C bus ?
Which Arduino board do you use ?

Thankyou :slight_smile:

I found and used the AdaFruit one, re-wrote the code, and it's working now.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.