Help

I am noob, so can somebody help me about RTC.
I checked a cod but I don’t see error in code.
Everything is okay but when I run Serial monitor, I got this data es a result.

#include <virtuabotixRTC.h> //Library used




//Wiring SCLK -> 6, I/O -> 7, CE -> 8
//Or CLK -> 6 , DAT -> 7, Reset -> 8

virtuabotixRTC myRTC(6, 7, 8); //If you change the wiring change the pins here also

void setup() {
 Serial.begin(9600);

// Set the current date, and time in the following format:
 // seconds, minutes, hours, day of the week, day of the month, month, year
 myRTC.setDS1302Time(15, 22, 21, 7, 14, 1, 2018); //Here you write your actual time/date as shown above 
 //but remember to "comment/remove" this function once you're done
 //The setup is done only one time and the module will continue counting it automatically
}

void loop() {
 // This allows for the update of variables for time or accessing the individual elements.
 myRTC.updateTime();

// Start printing elements as individuals
 Serial.print("Current Date / Time: ");
 Serial.print(myRTC.dayofmonth); //You can switch between day and month if you're using American system
 Serial.print("/");
 Serial.print(myRTC.month);
 Serial.print("/");
 Serial.print(myRTC.year);
 Serial.print(" ");
 Serial.print(myRTC.hours);
 Serial.print(":");
 Serial.print(myRTC.minutes);
 Serial.print(":");
 Serial.println(myRTC.seconds);

// Delay so the program doesn't print non-stop
 delay(1000);
}

And here is a text on Serial monitor:

Current Data / Time: 0/0/2000 0:0:0

I have no experience of Your RTC but to me it looks like the RTC is not properly initiated or started up. You need to succesfully write the date and time first time. Maybe that has not worked well.
Reading the year 2000 looks like the date I get from my GPS module until satelites are found and their data is received. I read the date 2000-0-0 and time is 00:00:00 at start up. You don't wait for any Magics from space so You ougth to get a proper date.
Check the start up commands needed. Setting the date and time every time, until You get things working can't be too bad.

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Circuit

Hi,
OPs, circuit…
4f79e-1.png

Tom… :slight_smile: