How To Use An RTC (Real Time Clock) With Arduino Uno R3 | Make an Accurate Clock!
Core Electronics Core Electronics
115K subscribers
61,719 views
0

 Published On May 31, 2021

First a simple example using only an Arduino Uno R3 and a DFRobot DS1307 RTC Module - then incorporating an LCD Display + three buttons to make a Functional, Accurate, Digital Clock.
The Full Article with Code and Libraries - https://core-electronics.com.au/tutor...

Related Information
Arduino IDE Download - https://www.arduino.cc/en/software
Arduino Workshop - https://core-electronics.com.au/tutor...
Arduino IDE Overview - https://core-electronics.com.au/tutor...
Arduino Boards Compared - https://core-electronics.com.au/tutor...
Info on Breadboards - https://core-electronics.com.au/tutor...
Heaps of Projects for Inspiration - https://core-electronics.com.au/projects
I Remixed the Code to Work with Nixie Tubes -   / cs0jciitu2o  

Today I will show you the Hello World equivalent usage of a RTC (real time clock) and demonstrate how to create an accurate clock with three functional buttons that will still keep the time even when you pull the plug. I'll show exactly how to use a RTC, how to bread-board and how to make three components, a DFRobot Gravity: I2C DS1307 RTC Module, a DFRobot Gravity: I2C LCD1602 Arduino LCD Display Module and the Italian micro-controller stallion that is the Arduino Uno R3 work in harmony. The Arduino Uno R3 is perfect for a job like this as we can tell it exactly what to do and it will perform that job every time and the instant it turns on. It also has great support for all kinds of maker hardware so you can use it for this project then pull it out, re-flash the code and throw it into a whole different setup doing a completely different task. The DFRobot Gravity RTC clock used here will function for 5 years from when the button battery is inserted providing accurate time for that whole length of time. This has the new version DS1307 RTC module which adopts a high precision crystal oscillator. Testing conducted shows the time error is only about 1 second in 24 hours (for comparison the average time error of Mechanical Watches is about 20s). For this setup here I used a DFRobot Gravity LCD Display. This one is neat because the contrast is automatically done (no fiddling with a potentiometer required) and it comes backlit out of the box. I explain all the code, how to set up Arduino IDE and provide schematics. With all the code already downloaded to the Arduino, this would make for a very fun bread-boarding experiment with a very rewarding conclusion. It is very tactile and would consistently tell the correct time even when powered down. I can see it being implemented as a school lesson over a double period. I also see this as a great springboard to create your own clock creations with the Arduino being used with other exotic display methods (like Nixie Tubes) or improving the code to creating new features (such as multiple clocks running for different locations in the world).

If you have any questions about this content or want to share a project you're working on head over to our maker forum, we are full time makers and here to help - http://coreelec.io/forum

Core Electronics is located in the heart of Newcastle, Australia. We're powered by makers, for makers. Drop by if you are looking for:

Arduino Uno R3: https://core-electronics.com.au/catal...

DFRobot Gravity: I2C DS1307 RTC Module: https://core-electronics.com.au/catal...

DFRobot Gravity: I2C LCD1602 Arduino LCD Display Module: https://core-electronics.com.au/catal...

A to B Peripheral Cable: https://core-electronics.com.au/catal...

Jumper Wires: https://core-electronics.com.au/catal...

Breadboard: https://core-electronics.com.au/catal...

330 Olm Resistors: https://core-electronics.com.au/catal...

Sweet Buttons: https://core-electronics.com.au/catal...


0:00 Intro
0:13 Real Time Clock Overview
0:44 Simple Connecting RTC to Arduino
1:27 Simple Schematic
1:31 Button Battery into RTC
1:41 Connect Set-Up to a Computer
2:00 Arduino IDE Set-Up and Flash Code
2:53 Establish Communication with RTC!
3:22 Quick Look at the Code
4:06 Lets make an Accurate Arduino Clock with LCD Display
4:16 Time-lapse
4:26 Schematic of Accurate Clock
4:31 Overview of Accurate Clock
6:47 Flash the New Code to the Arduino
7:30 Let Me Show You Its Features
8:06 Outro

show more

Share/Embed