Description
- The DS1307 I2C Real Time Clock chips (RTC)
- I2C EEPROM Memory 24C32 32K
- Adopt LIR2032 rechargeable lithium battery, with the charging circuit
- Solved the problem of DS1307 with battery backup can not read and write.
- Fully charged, can provide the DS1307 timing for 1 year .
- Compact design, 27mm * 28mm * 8.4mm
- Lead off clock pin of DS1307 to provide clock signal for MCU .
- Can be cascaded to other I2C devices
Application:
- It is used in date and time applications
Getting started with the Real Time Clock Module DS1307
This post is about how to use the DS1307 Real Time Clock (RTC) module with the Arduino. You can also follow this guide for other similar modules like the DS3231 RTC. This example displays date and time on the serial monitor. This module uses I2C communication. This means that it communicates with the Arduino using just 2 pins.
Hardware required
- Arduino UNO
- DS1307 RTC module
- Jumper wires
Connecting the Hardware
Connect your Real Time Clock module to your Arduino as in the schematics below.
Wiring the RTC module is pretty straightforward
Pin | Wiring to Arduino Uno |
SCL | A5 |
SDA | A4 |
VCC | 5V |
GND | GND |
If you’re using other Arduino board rather than the uno, chek out what are their SCL and SDA pins.
- Nano: SDA (A4); SCL(A5)
- MEGA: SDA (20); SCL(21)
- Leonardo: SDA (20); SCL(21)
Code
Open the serial monitor at a baud rate of 9600 and you’ll see the results.Here’s the Serial Monitor displaying the current date and time.