Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Based Real-Time Clock with DS1307 RTC

View and Edit Project In Cirkit DesignerImage of Arduino-Based Real-Time Clock with DS1307 RTC

Circuit Documentation

Summary

This circuit consists of an Arduino UNO microcontroller and a DS1307 Real-Time Clock (RTC) module. The Arduino UNO serves as the main control unit, while the DS1307 RTC provides accurate timekeeping functionality. The two components are connected via I2C communication, utilizing the SDA and SCL pins for data transfer. The circuit is powered by a common 5V supply, and both components share a common ground.


Component List

Arduino UNO

DS1307 RTC


Wiring Details

Arduino UNO


DS1307 RTC


Documented Code

Arduino Code

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

RTC_DS1307 rtc;

void setup() {
  Serial.begin(9600);
  Wire.begin();

  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (!rtc.isrunning()) {
    Serial.println("RTC is NOT running, let's set the time!");
    // This 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();

  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 printing again
}

Documentation Code

(Note: The documentation code section is empty as per the provided input.)


This concludes the documentation for the circuit.