Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Tutorial on driving real time clocks with Arduino

tronixstuff have written a great tutorial how to interface and program real time clocks (RTC). As an example he took two widely used chips DS1307 and DS3231. The main difference between both modules is clocking mechanism that can result in precision. Usually they come in modules that can be easily connected to microcontroller board via I2C interface.

ds1307-real-time-clock-module ds3231-real-time-clock-module

Both modules come with built in pull-up resistor, so there are only two wires required to interface to microcontroller (plus power lines). Simple demo program allows to output time and date infromation to serial terminal window every seconds. Both modules come with backup batteries so if you diconnect them from Arduino board they will continue counting time. When next time you connect them again, you will get correct time values.

[..Source link..]

Bookmark the permalink.

Leave a Reply