DS3231 Real Time Clock

When you first hear real time clock (RTC), you may think of the trusty DS1307. It's cheap, well-known, and has been available for years. But today there is a better solution out on the market - the DS3231 by Maxim. One of the biggest drawbacks of the original 1307 was that it required a 32khz crystal, but the DS3231 has one built right in. Actually, to use the DS3231, one only needs two 0.1uf capacitors, and maybe a backup battery if desired! Additionally, the DS3231 is 100% I2c compatible with the DS1307. No need to change any code around, since code for the DS1307 will work perfectly with the DS3231.

Breakout Board

Here is the breakout board I created. It only has the DS3132 chip, a coin cell holder for a standard 2032 lithium coin cell, and two 0.1uf decoupling capacitors.


Code

Here is the code I used, originally designed for the DS1307 but works perfectly with the DS3231.

Source Files

Here are the schematic and board files.