DS3231 RTC module - I2C Interface
Based on the DS3231 IC. The DS3231 IC can do timing, set two alarms and it can also measure temperature. Onboard AT24C02 EEPROM, you can record more alarms and event information.
The onboard AT24C02 EEPROM can be used to record more alarms as well as event information. The onboard CR20xx battery holder allows keeping time when the main power to the device is interrupted.
Features of the ds3231 rtc module:
- Compatibility: Compatible with Arduino UNO R3 / Arduino Mega2560 or any other microcontroller with an I2C interface
- Working voltage: 3.0 ~ 5.5VDC
- Working current: 3mA (Max)
- Interface: standard I2C interface (400kHz)
- Timing accuracy: ±2ppm @ 0~+40'C; ±3.5ppm @ -40~+85'C
- Temperature measurement accuracy: ±3'C
- Temperature resolution: 0.25'
- SQW is a programmable square wave output pin
- Arduino Library: DS3231
- Great for Arduino DIY project
Sketch for the ds3231 rtc module.
#include <DS3231_Simple.h> DS3231_Simple Clock; void setup() { Serial.begin(9600); Clock.begin(); Serial.println(); Serial.println(); } void loop() { // Create a variable to hold the data DateTime MyDateAndTime; // Ask the clock for the data. MyDateAndTime = Clock.read(); // And use it Serial.print("Hour: "); Serial.println(MyDateAndTime.Hour); Serial.print("Minute: "); Serial.println(MyDateAndTime.Minute); Serial.print("Second: "); Serial.println(MyDateAndTime.Second); Serial.print("Year: "); Serial.println(MyDateAndTime.Year); Serial.print("Month: "); Serial.println(MyDateAndTime.Month); Serial.print("Day: "); Serial.println(MyDateAndTime.Day); Serial.print("End Of Program (RESET to run again)"); while(1); }
Library and more examples available here: https://github.com/sleemanj/DS3231_Simple