

The Adafruit DS1307 RTC Breakout (Part ID: 264) is a real-time clock (RTC) module designed to keep track of the current time and date, even during power loss, thanks to its battery backup feature. It uses the DS1307 RTC chip and communicates with microcontrollers via the I2C protocol. This module is ideal for applications requiring precise timekeeping, such as data logging, alarms, and scheduling tasks in embedded systems.








The Adafruit DS1307 RTC Breakout is designed for ease of use and compatibility with a wide range of microcontrollers. Below are its key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 5V |
| Communication Protocol | I2C (Inter-Integrated Circuit) |
| I2C Address | 0x68 |
| Timekeeping Accuracy | ±2 seconds/day (at 25°C) |
| Backup Battery Support | CR1220 coin cell (not included) |
| Operating Temperature | -40°C to +85°C |
| Dimensions | 28mm x 28mm x 4mm |
The Adafruit DS1307 RTC Breakout has a simple pinout for easy integration into your projects. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| GND | Ground connection |
| VCC | Power supply (5V) |
| SDA | I2C data line |
| SCL | I2C clock line |
| BAT | Backup battery connection (CR1220 coin cell) |
The Adafruit DS1307 RTC Breakout is straightforward to use in your projects. Follow the steps below to integrate it into your circuit and program it for timekeeping.
VCC pin to a 5V power source and the GND pin to ground.SDA pin to the I2C data line and the SCL pin to the I2C clock line of your microcontroller.The Adafruit DS1307 RTC Breakout is compatible with the Arduino UNO. Below is an example of how to use the module with the Arduino IDE:
Install the following libraries via the Arduino Library Manager:
RTClib by Adafruit#include <Wire.h>
#include <RTClib.h>
// Create an RTC_DS1307 object to interact with the RTC module
RTC_DS1307 rtc;
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
Wire.begin(); // Initialize I2C communication
// Check if the RTC is connected and working
if (!rtc.begin()) {
Serial.println("Couldn't find RTC. Check wiring!");
while (1); // Halt execution if RTC is not found
}
// Check if the RTC is running
if (!rtc.isrunning()) {
Serial.println("RTC is NOT running, setting the time...");
// Set the RTC to the current date and time
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
}
void loop() {
// Get the current date and time from the RTC
DateTime now = rtc.now();
// Print the current date and time to the Serial Monitor
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
delay(1000); // Wait for 1 second before updating
}
RTC Not Detected
0x68.RTC Not Keeping Time
Incorrect Time Displayed
rtc.adjust() function to set the correct time.I2C Communication Errors
Q: Can the DS1307 RTC Breakout work with 3.3V systems?
A: The DS1307 requires a 5V power supply. However, its I2C lines are 5V-tolerant, so it can communicate with 3.3V microcontrollers.
Q: How long does the backup battery last?
A: A CR1220 coin cell can typically power the RTC for several years, depending on usage and environmental conditions.
Q: Can I use the DS1307 RTC Breakout without a battery?
A: Yes, but the RTC will lose track of time whenever power is disconnected.
Q: What is the maximum date the DS1307 can track?
A: The DS1307 can track dates up to December 31, 2099.
By following this documentation, you can effectively integrate the Adafruit DS1307 RTC Breakout into your projects for reliable timekeeping.