The DS3231 is a low-cost, extremely accurate I2C real-time clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO).
The device incorporates a battery input (CR1220-Not Included)and maintains accurate timekeeping when main power to the device is interrupted. The integration of the crystal resonator enhances the long-term accuracy of the device. The RTC maintains seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with an AM/PM indicator. Two programmable time-of-day alarms and a programmable square-wave output are provided. Address and data are transferred serially through an I2C bidirectional bus. A precision temperature-compensated voltage reference and comparator circuit monitors the status of VCC to detect power failures, to provide a reset output, and to automatically switch to the backup supply when necessary. Additionally, the RST pin is monitored as a pushbutton input for generating a reset externally.
See Attachments for sample code:
Please download and extract the file and place the RTClib library in my documents > Arduino > libraries. Open the sketch file and compile and run, view with a serial console at 57600 Baud Rate.
http://www.instructables.com/id/Real-time-clock-using-DS3231-EASY/?ALLSTEPS
Features:
- Input: CR1220 Coin Cell battery
- Use DS3231SN precision clock chip, built 32.768 crystal
- Can provide precise year, month, day, hour, minute, second, in the morning and afternoon data
- You can output 1Hz signal, a second output signal
- You can use the CR1220 coin cell holding travel time
- The pull-up resistor R1 R2 own welding on the I2C bus
- Small size 3cm in diameter
- Pin spacing 22.86mm