


The DS1307 RTC I2C Module with AT24C32 (without battery) is a popular module used in electronics for timekeeping and data storage. Let me break down what it offers and how it's typically used:
The module usually has the following pins (depending on the version):
Here’s a basic example of how you might interface the DS1307 and AT24C32 with an Arduino:
#include <Wire.h>
#include <RTClib.h>
RTC_DS1307 rtc; // Create an instance of the DS1307 RTC
const int eepromAddress = 0; // Starting address in the AT24C32 EEPROM
void setup() {
Wire.begin();
rtc.begin();
// Set up the RTC time (if needed)
if (!rtc.isrunning()) {
rtc.adjust(DateTime(F(__DATE__), F(__TIME__))); // Set time to compile time
}
// Write some data to EEPROM
Wire.beginTransmission(0x50); // I2C address for AT24C32
Wire.write((byte)(eepromAddress >> 8)); // High byte of address
Wire.write((byte)(eepromAddress & 0xFF)); // Low byte of address
Wire.write(0x42); // Write data (e.g., ASCII 'B')
Wire.endTransmission();
}
void loop() {
// Reading time from RTC
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 1 second
}
Origin:- China
Brand:- Generic