DS3231 High Precision Real Time Clock

For upcoming projects, I'll need to have time keeping capabilities (beyond on-MCU timers).  To this end, I've purchased a three pack of these, the DS3231 high precision real time clock (RTC) that operates via I2C.

To drive this, I'll be using an Arduino Nano.  The I2C pins on the nano are as follows:

SCL    A5    PC5
SDA    A4    PC4


If you ever forget how I2C works, there's a great tutorial on SparkFun.

Since I've already written a I2C library in grad school, I went straight to connecting things and sought to get a quick start by leveraging a nice library for the DS3231.  I quite like this library because the code appears to be of high quality and the comments are pretty good.

There's no substitute for reading the datasheet.

Here's a photo of how things look initially.
Note the 4.7K resistors on the SDA and SCL lines.  These are pull-up resistors to tie the lines high.  One could probably get away without these, but it's a good idea to have it so as to avoid any possible floating values.

No comments:

Post a Comment