Introduction
We're glad to introduce a new member in Gravity family: Gravity I2C SD2405 RTC module. This is an extremely accurate I2C real-time clock (RTC) with crystal compensation, inner chargeable battery. The SD2405AL is available in industrial temperature ranges. The SD2405AL is dual power supply system. When the primary power supply goes down to an assigned value or resumes from low power, the system can switch between the primary power supply and battery automatically. Even there is no external power, it can still work for 5-8 years, 1uA ultra-low power consumption (inner battery, Ta=25°C). The SD2405AL can generates various periodic interrupt clock pulses lasting for long period (one year), and three alarm interrupts can be made by year, month, date, days of the week, hours, and minutes, seconds. It also provides a selectable 32.768KHz-1Hz clock output for an external MCU. The product incorporates a time trimming circuit that adjusts the clock with higher precision by adjusting any errors in crystal oscillator frequencies based on signals from the CPU. A 12-bytes general SRAM is implemented in the SD2405AL. Gravity SD2405 RTC can work as data logger, timer alarm clock and other time application. It is an ideal choice for timing project.
Specification
- Operation voltage range:3.3V~5.5V.
- Low-power:typical 1uA (inner battery, Ta=25°C)
- Timing Range: To 2099 (with leap year compensation)
- Accuracy ±5ppm from -40°C to +85°C.
- Fast (400kHz) I2C Interface(4.5~5.5V).
- I2C Address: 0x32
- Real-Time Clock Counts Seconds, Minutes,Hours, Day, Date, Month, and Year with Leap Year Compensation Valid Up to 2100.
- Time-of-Year,Month,Day,Week,Hour,Minute,Second Alarms.
- Programmable Square-Wave Output:32768hz,4096hz...1hz..1/16hz.
- Countdown timer interrupt.
- High precision time trimming circuit.
- 12-hour/24-hour time display selectable
- Dimension: 35.50 * 22.00(mm)/1.4 * 0.87 inches
- Weight: 6g
Board Overview
Num | Label | Description |
---|---|---|
1 | Gravity Interface | SDA: IIC Data SCL: IIC Clock GND: GND VCC: 3.3~5V |
2 | XH2.54 Pins | SDA: IIC Data SCL: IIC Clock GND: GND VCC: 3.3~5V INT: Interrupt |
Tutorial
In this tutorial, you can set and read time.
Requirements
Hardware
- DFRduino UNO (or similar) x 1
- Gravity: I2C SD2405 RTC Module
- M-M/F-M/F-F Jumper wires
Software
- Arduino IDE, Click to Download Arduino IDE from Arduino®
Connection Diagram
Sample Code
Please download Arduino RTC library, Install the GravityRtc library file.How to install Libraries in Arduino IDE
Note: //rtc.adjustRtc(F(DATE), F(TIME)); //Set the RTC time automatically. Please comment it after you have set time successfully //rtc.initRtc(2017,6,19,1,12,7,0); //Set Time: 2017/June/19th/Monday/12:07:0 am. Please comment it after you have set time successfully |
---|
#include "GravityRtc.h"
#include "Wire.h"
GravityRtc rtc; //RTC Initialization
void setup() {
Serial.begin(9600);
rtc.setup();
//Set the RTC time automatically: Calibrate RTC time by your computer time
rtc.adjustRtc(F(__DATE__), F(__TIME__));
//Set the RTC time manually
//rtc.adjustRt(2017,6,19,1,12,7,0); //Set time: 2017/6/19, Monday, 12:07:00
}
void loop() {
rtc.read();
//*************************Time********************************
Serial.print(" Year = ");//year
Serial.print(rtc.year);
Serial.print(" Month = ");//month
Serial.print(rtc.month);
Serial.print(" Day = ");//day
Serial.print(rtc.day);
Serial.print(" Week = ");//week
Serial.print(rtc.week);
Serial.print(" Hour = ");//hour
Serial.print(rtc.hour);
Serial.print(" Minute = ");//minute
Serial.print(rtc.minute);
Serial.print(" Second = ");//second
Serial.println(rtc.second);
delay(1000);
}
Expected Results
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.