Hello there. So if I set real time it doesn't show correct time in serial monitor.
1 sec lasts like 7mins. Checked all pins, sda,scl,vcc and ground. Later I figured out that I
accidentally connected DS3231 on 12V instead of 5V
RTC DS3231 set time but serial monitor will not accept correct time, serial monitor shows wrong time
Here is code
#include <DS3231.h>
// Init the DS3231 using the hardware interface
DS3231 rtc(A4, A5);
void setup()
{
// Setup Serial connection
Serial.begin(115200);
// Initialize the rtc object
rtc.begin();
// Write your current time and date to this following lines
rtc.setDOW(MONDAY); // Set Day-of-Week to Monday
rtc.setTime(13, 44, 0); // Set the time to 12:00:00 (24hr format)
rtc.setDate(29, 12, 2021); // Set the date to January 1st, 2014
}
void loop()
{
// Send Day-of-Week
Serial.print(rtc.getDOWStr());
Serial.print(" ");
// Send date
Serial.print(rtc.getDateStr());
Serial.print(" -- ");
// Send time
Serial.println(rtc.getTimeStr());
// Wait one second before repeating
delay (1000);
}
Hi @catphomet
I hate to be the bearer of bad news, but you blew the clock.
That photo is taken from the data sheet. The sensor has a max voltage of 6V on any pin. 12V is double.
Did you try replacing it? Did it work before? etc. etc.
Ill replace it and then will see if it does work again
Tnx guys
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.