Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit DS1307 RTC Breakout: Examples, Pinouts, and Specs

Image of Adafruit DS1307 RTC Breakout
Cirkit Designer LogoDesign with Adafruit DS1307 RTC Breakout in Cirkit Designer

Introduction

The Adafruit DS1307 RTC Breakout is a real-time clock (RTC) module that keeps track of the current time and date. It is based on the DS1307 RTC IC from Maxim Integrated. This component is widely used in electronics projects that require timekeeping functionality, such as data loggers, clocks, and schedulers. Its ability to maintain accurate timekeeping even when the main power is off, thanks to a backup battery, makes it a reliable choice for time-sensitive applications.

Explore Projects Built with Adafruit DS1307 RTC Breakout

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Mega 2560-Based Real-Time Clock and Data Logging System with OLED Display
Image of projectwiring: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
This circuit features an Arduino Mega 2560 microcontroller interfaced with an OLED display, a DS1307 RTC module, a microSD card breakout, a pushbutton, and a blue LED. The Arduino handles data logging to the microSD card, displays information on the OLED, and reads real-time data from the RTC module, while the pushbutton and LED provide user interaction and status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Real-Time Clock with I2C LCD Display and IO Expansion
Image of teste: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
This circuit is an Arduino-based real-time clock and display system. It uses an Arduino UNO to interface with a DS1307 RTC module for timekeeping and a 20x4 I2C LCD to display the current time and date. Additionally, a PCF8574 IO Expansion Board is used to extend the I2C bus for additional I/O operations.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO with DS1307 RTC Controlled LED Lighting System
Image of li8: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
This circuit features an Arduino UNO connected to a DS1307 Real Time Clock (RTC) module for timekeeping and a red LED with a series resistor for indication purposes. The Arduino communicates with the RTC via I2C (using A4 and A5 pins for SDA and SCL, respectively), and controls the LED connected to digital pin D8 through a 330-ohm resistor. The embedded code sets the RTC time, checks the current time, and turns the LED on or off based on the specified time condition (between 11:00 AM and 11:43 AM).
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Real-Time Clock with DS1307 RTC Module
Image of rrtc: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
This circuit interfaces an Arduino UNO with a DS1307 Real-Time Clock (RTC) module. The Arduino communicates with the RTC module using the I2C protocol, with connections from A4 to SDA and A5 to SCL.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit DS1307 RTC Breakout

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of projectwiring: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
Arduino Mega 2560-Based Real-Time Clock and Data Logging System with OLED Display
This circuit features an Arduino Mega 2560 microcontroller interfaced with an OLED display, a DS1307 RTC module, a microSD card breakout, a pushbutton, and a blue LED. The Arduino handles data logging to the microSD card, displays information on the OLED, and reads real-time data from the RTC module, while the pushbutton and LED provide user interaction and status indication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of teste: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
Arduino UNO-Based Real-Time Clock with I2C LCD Display and IO Expansion
This circuit is an Arduino-based real-time clock and display system. It uses an Arduino UNO to interface with a DS1307 RTC module for timekeeping and a 20x4 I2C LCD to display the current time and date. Additionally, a PCF8574 IO Expansion Board is used to extend the I2C bus for additional I/O operations.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of li8: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
Arduino UNO with DS1307 RTC Controlled LED Lighting System
This circuit features an Arduino UNO connected to a DS1307 Real Time Clock (RTC) module for timekeeping and a red LED with a series resistor for indication purposes. The Arduino communicates with the RTC via I2C (using A4 and A5 pins for SDA and SCL, respectively), and controls the LED connected to digital pin D8 through a 330-ohm resistor. The embedded code sets the RTC time, checks the current time, and turns the LED on or off based on the specified time condition (between 11:00 AM and 11:43 AM).
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of rrtc: A project utilizing Adafruit DS1307 RTC Breakout in a practical application
Arduino UNO Real-Time Clock with DS1307 RTC Module
This circuit interfaces an Arduino UNO with a DS1307 Real-Time Clock (RTC) module. The Arduino communicates with the RTC module using the I2C protocol, with connections from A4 to SDA and A5 to SCL.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Features

  • Timekeeping Accuracy: ±2ppm from 0°C to +40°C
  • Battery Backup: Maintains timekeeping when main power is off
  • Communication: I2C interface
  • Operating Voltage: 4.5V to 5.5V
  • Clock Frequency: 32.768 kHz

Pin Configuration and Descriptions

Pin Number Name Description
1 GND Ground connection
2 VCC Power supply (4.5V to 5.5V)
3 SDA I2C Data Line
4 SCL I2C Clock Line
5 SQW Square Wave/Output Driver
6 32K 32.768 kHz Output
7 RST Reset (active low)

Usage Instructions

Connecting to an Arduino UNO

  1. Connect the GND pin to the ground on the Arduino.
  2. Connect the VCC pin to the 5V output on the Arduino.
  3. Connect the SDA pin to the A4 (SDA) on the Arduino.
  4. Connect the SCL pin to the A5 (SCL) on the Arduino.

Setting the Time

Before using the RTC, you need to set the current time. This is typically done through an initialization routine in your Arduino sketch.

Best Practices

  • Use a pull-up resistor on the SDA and SCL lines if your Arduino board does not have built-in pull-up resistors.
  • Ensure that the backup battery is properly installed for timekeeping during power outages.
  • Avoid placing the RTC module in high-temperature environments to maintain accuracy.

Example Arduino Code

#include <Wire.h>
#include <RTClib.h>

RTC_DS1307 rtc;

void setup() {
  Wire.begin();
  rtc.begin();

  if (!rtc.isrunning()) {
    // The following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  }
}

void loop() {
  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 repeating the loop
}

Troubleshooting and FAQs

Common Issues

  • Time not accurate: Ensure the backup battery is installed correctly and has charge.
  • I2C communication failure: Check the wiring, and ensure pull-up resistors are in place if needed.

FAQs

Q: How do I replace the backup battery? A: Carefully remove the old battery and insert a new CR1220 coin cell battery.

Q: Can the DS1307 RTC operate at 3.3V? A: The DS1307 is designed to operate at 4.5V to 5.5V. For 3.3V applications, consider using a different RTC module like the DS3231 which is compatible with 3.3V logic.

Q: How do I read the temperature from the DS1307? A: The DS1307 does not have a built-in temperature sensor. If you need temperature readings, you will need to use a separate temperature sensor.

Remember to keep your documentation up-to-date with the latest information and best practices to ensure users have the most accurate and helpful guidance.