There are various ways to synchronize the time of a DS3231 RTC (Real Time Clock) on Arduino. In this video I show you how to do it without WiFi, i.e. without using NTP.
The Arduino system (IDE/compiler) can get the current time and date from the computer and pass it to the Arduino board. Most of the example sketches rely on the `rtc.lostPower` method to do it. The problem with that approach is that to trigger the lost power you need to remove the CR2032 batter in the RTC. This is not always practical.
Essentially we need a condition and some tricks in the code to know when it is the right time to sync (besides using `rtc.lostPower`).
The function I present you in this video has been tested with an ESP8266 but it should work on other boards as well with some modifications.
🔗 LINKS
📧 Business Inquiries Only: [email protected]
📝 Contact me for you project (Google form): https://SolveComputerScience.github.i...
📝 Contact me for you project (Nextcloud form): https://SolveComputerScience.github.i...
📰 Follow me on Substack: http://solvecomputerscience.github.io...
💼 Jobs page: https://SolveComputerScience.github.i...
💼 Fiverr profile: https://SolveComputerScience.github.i...
🐘 Follow me on Mastodon: https://SolveComputerScience.github.i...
💻 Arduino sketch source code (Codeberg): https://SolveComputerScience.github.i...
🔖 CHAPTERS
0:00 Intro
0:26 Algorithm
1:39 strtol function in detail
5:09 Outro
#rtc #ds3231 #arduino #esp8266 #datetime