• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

How the clock is implemented in ESP32

Q&A Forum › Category: ESP32 › How the clock is implemented in ESP32
0 Vote Up Vote Down
SERGEY ILINYKH asked 3 years ago

How does the clock in this example work?
https://randomnerdtutorials.com/esp32-date-time-ntp-client-server-arduino/
Hardware implementation in ESP32 or software library?
How often do you need to sync them?
Where can you find out more about this?
thank

3 Answers
1 Vote Up Vote Down
Steve Mercer answered 3 years ago

My understanding is that the ESP32 has an internal RTC but it’s not very accurate with frequency error of about 5%. With an external 32k crystal the error will be determined by the crystal, usually about 20-30ppm. The de facto standard in the industry for crystal inaccuracy is 20ppm. 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.
 
Basically if you are using the internal RTC without an external crystal you would need to sync frequently to keep accuracy. With an external crystal you can sync a lot less. 

1 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Thank you so much for your answer, Steve 🙂
I wouldn’t explain it better.
Regards,
Sara

0 Vote Up Vote Down
Steve Mercer answered 3 years ago

With a little more research on this it appears just adding a crystal can be more complex as you would need to recompile the base ESP32 system. I’m thinking a better idea would be to use an external high accuracy DS3231sn module with crystal and backup battery. These have an error of about 2ppm. That way you can just use a library.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.