Page 1 of 2

RTC accuracy

Posted: Thu Nov 23, 2017 11:37 pm
by natsnats
Using the sntp example from

https://github.com/espressif/esp-idf/tr ... /sntp/main

While in deepsleep, the RTC time is wrong by 76 seconds after 3.5 hours. Is this the best that can be expected?

Re: RTC accuracy

Posted: Fri Nov 24, 2017 1:15 am
by ESP_igrr
Internal RTC clock frequency error is about 5%. With external 32k XTAL the error will be determined by the XTAL, usually about 20-30ppm.

Re: RTC accuracy

Posted: Fri Nov 24, 2017 3:47 pm
by Gfast2
ESP_igrr wrote:Internal RTC clock frequency error is about 5%. With external 32k XTAL the error will be determined by the XTAL, usually about 20-30ppm.
Hi ESP_igrr,

Cool stuff!

https://www.dataq.com/blog/data-logger/ ... ppm-stuff/ :o
The de facto standard in the industry for crystal inaccuracy is 20 PPM
You can also express PPM as a percentage: ±20/1,000,000 = ±0.002%. So after 30 days (2,592,000 seconds) we can expect the clock to drift about ±52 seconds; after 60 days about ±104 seconds, and so on.
Cheers

Gfast2

Re: RTC accuracy

Posted: Tue Aug 25, 2020 11:35 am
by Ritesh
ESP_igrr wrote:
Fri Nov 24, 2017 1:15 am
Internal RTC clock frequency error is about 5%. With external 32k XTAL the error will be determined by the XTAL, usually about 20-30ppm.
Hello,

We are planning to use Internal RTC with button Cell to keep updated time once External Main power will be off. So, Will it possible to get clock properly with accuracy if we will go with Internal RTC?

Re: RTC accuracy

Posted: Tue Aug 25, 2020 1:37 pm
by ESP_Sprite
Sorry, the internal RTC does not have the capability to run off coin cell. Suggest you get the time using e.g. NTP once you power up.

Re: RTC accuracy

Posted: Tue Aug 25, 2020 4:27 pm
by Ritesh
ESP_Sprite wrote:
Tue Aug 25, 2020 1:37 pm
Sorry, the internal RTC does not have the capability to run off coin cell. Suggest you get the time using e.g. NTP once you power up.
Thanks.

Yes. We will take time from NTP if external network connectivity will be there or will set forcefully one time when board is fresh.

But our requirement is to maintain time when board is off using RTC and once there will be power applied then it will collect updated time from RTC and set into system clock.

So for that can't it be possible using internal RTC and button cell connected with VDD3.3V_RTC? what is accuracy provided if we consider 24 hours to execute RTC without external power supply?

Re: RTC accuracy

Posted: Wed Aug 26, 2020 1:16 am
by Franco
One solution to keep the real time accurately while minimizing power consumption is to use an external RTC like ds3231 or similar.

Re: RTC accuracy

Posted: Wed Aug 26, 2020 3:28 am
by Ritesh
Franco wrote:
Wed Aug 26, 2020 1:16 am
One solution to keep the real time accurately while minimizing power consumption is to use an external RTC like ds3231 or similar.
Thanks.

That is our next plan if not possible to get exact accuracy with internal RTC of ESP32. Actually we don't want to extra cost overhead into our product due to lower budget.

So that my intention is to use internal RTC with just button cell holder but need to think for other option if not possible to get accuracy with internal RTC.

I have also tried to find out Internal RTC Accuracy into ESP32 Documents but didn't find it anything apart from below.

"RTC timer: Allows keeping the system time during any resets and sleep modes, only the power-up reset leads to resetting the RTC timer. The frequency deviation depends on an RTC Clock Source and affects accuracy only in sleep modes, in which case the time will be measured at 6.6667 us resolution."

Re: RTC accuracy

Posted: Thu Aug 27, 2020 4:00 am
by Ritesh
ESP_Sprite,

Do you have any idea or clue for this? any suggestions or inputs to move further?

Re: RTC accuracy

Posted: Fri Dec 09, 2022 6:18 am
by IrfanIslam
ESP32 accuracy on main power is very good but when in deep sleep on 3.7v battery the accuracy is worse in my case it's 162 seconds for 5 hours which is not acceptable, adding external hardware like DS3231 is not good idea when to keep project size compact, small and lower cost.