which RTC is better

I have tested my code with arduino Uno RTC device DS1307/ PCF8563/ MCP7940N . I would like to know from experts which RTC device is better in performance and time Switch application which IC should i go ahead

The 1307 isn't so great because it has no temperature compensation. I have never heard of the others but, if they do, they will surely be better. I believe the favourite is the ds3231.

The three devices you name ( i.e. DS1307/ PCF8563/ MCP7940N ) all seem to need an external 32768 Hz crystal and since the accuracy primarily depends on the crystal they willl have similar accuracy. My experience of the DS1307 ebay boards from China is that they use very poor crystals so are not very accurate. I use the DS3231 modules which have an inbuild temperature compensated and software trimable oscillator and those I have purchased are significantly more accurate than the DS1307 boards.

I've swapped out DS1307s where ever they were and replaced with DS3231s. I don't think I ever had to change the code. Or it was minimal.

Much better accuracy as has been pointed out. And cheap - I bought 8 at what I thought was a good price and it turned up as 8 packages of 5, so basically a life-time supply (I older).

HTH

a7

If you just want the time, the 3231 certainly can run on the same time code. I don't know what it offers that requires its own library.

Nick_Pyner:
If you just want the time, the 3231 certainly can run on the same time code. I don’t know what it offers that requires its own library.

The SQW pin output frequencies on the 3231 are not the same as those available on the 1307.

Of those 3 only the MCP7940N has temperature compensation so if those are the only choices that would be the one.

Can some one suggest here

DS1307 and DS3231 Temperature compensation. What will happen to RTC time if temperature compensation not considered.

what is effect of temperature compensation on RTC clock.
how accurate i can get RTC value comparison with above device DS1307/DS3231/pc8563

i wanted to know it has battery backup to to retain RTC value .

I remember a device some time back where a cheap (none temperature compensated) RTC was used for cost reansons
after devices had been in use or storage for several months the RTC time was found to be 15 or 20 minutes out in a number of cases

people suggesting not to use DS1307. since due to external crystal it can drift 5 min monthly basis . so which is 1 hour yearly.

Accuracy wise DS3231 are better but cost is more.

is anyone used MCP7940N /PC8563.

NXP PC85163 wont support Battery backup. and i am planning to use 24LC eeprom to write various timing .So it might coincide with slave address of EEPROM/RTC

so i need more
information on accuracy , temperature drift,end application. My application is Time Switch

Not mentioned is using internet time.
Although I hate to rely on the internet, it should be mentioned.

The ESP32 has a built in RTC that I cause to be set upon boot and once a week from the internet.

Idahowalker:
The ESP32 has a built in RTC that I cause to be set upon boot and once a week from the internet.

If available I use a GSM or GNSS device to update time daily

You can get time from a variety of external sources, but any of them can fail, or simply be unavailable. So I have sometimes used an RTC as a backup source, and to perform a "sanity check" on the external time data. In some cases, it is the RTC built in to the processor.

For a time switch, the exact time is often not so important. Does it matter if you water your plants at 13:00:00 or 13:01:23? In that case, setting the time once manually and keeping it in a battery backed up RTC is simpler and more location independent than using internet or GPS.

As a point of interest many of the DS3231 boards floating about (eg this type https://smile.amazon.co.uk/gp/product/B07DK1SRPB) actually have onboard storage.

I accidentally discovered it when scanning i2c and got 3 addresses reported where I expected 2. Only 4k on this board but 4k is 4k more than I thought I had and very useful :smiley:

LeChatQuiRit:
As a point of interest many of the DS3231 boards floating about (eg this type https://smile.amazon.co.uk/gp/product/B07DK1SRPB) actually have onboard storage.


That would of course, be the additional 24C32 chip on the board. :grinning:

Note the address jumpers.

However unlike the DS1307 which has BBRAM, this is EEPROM and it would be unwise to update it every second.

When you said BS3231, you really had me going... :slight_smile:

i have another doubt . in case if i use without battery ic like NXP PC85163 module. If power fails what does happen to RTC time. Since they dont SRAM to store.

In case of DS1307 most of expert says 5 min monthly. Timer interrupt can handle these drift??

AJITnayak:
In case of DS1307 most of expert says 5 min monthly. Timer interrupt can handle these drift??

not sure what you mean by "Timer interrupt can handle these drift??"
you require some means of updating the RTC to the current time
either manually by an operator setting it or from the internet, GSM, etc

link 2

It might help others to while selecting RTC device.

I have got good comparison from here.I am still need more information on MCP7940 and PCF85163

Assume if i use PCF8563 module . where i wont have battery backup. what will RTC time does when main power fails.

For above case if i use battery backup with cR2302 making RTC battery and Arduino Gnd common will it continue to retain time.???

what kind of application we should use without Battery back up RTC device like PC85163