Close

09-22-2022 Testing the RTC time accuracy

A project log for Making a literal digital clock

This is the start of a bigger project, splitting it up in different pieces. Sit back and relax, its gonna take some time ;-)

flamefireflamefire 2 days ago2 Comments

Basically I tested and followed the tutorial from workshop. However the accuracy of my RTC was at best 30 sec off.

Instead I made a test where I connect to an NTP server, retrieve the time and set the time in the RTC module accurately. This conveniently also fixes the RTC modules inaccuracy over active time, which I've read could be anything from seconds or minutes a day, depending on the module.

Picture below is the accuracy of the NTP server, which is basically one to one.

Testing NTP server accuracy

The picture below is the RTC time which has been set with the data from the NTP server and very accurate. Will check how much it differs from the real clock over time. But should be no problem because now we can connect to the internet and update it.

You might be wondering why not just throw the RTC in the thrash where it belongs? We might not always have a secure connection. This is why as soon as we have an connection we just update the RTC. Will this kill the battery? Most certainly it will, but that is tomorrows problems.

I will push all the test software up on my github when I the project is finished.

The next I will look at is making an interrupt on the squarewave from the RTC and make the motor move according to the time! :)

Discussions

Ken Yap wrote 2 days ago point

The DS1307 is rather old. The DS3231 is more accurate and cheap enough. I have one free-running and it stays very close to the actual time.

  Are you sure? yes | no

flamefire wrote 2 days ago point

Yea figured, but i did'nt imagine it would be that bad. Now im working with what i got, and current solution is nice and one to one accuracy, even though it requires somewhat internet connection.

  Are you sure? yes | no