Problems with the library file of DS1307 and DS3234

Hello folks,
I’m working on Real Time Clock. Attachment is the compressed folder of RTC_DS3234 and DS1307. Both examples of DS3234 and DS1307 don’t work with this library. Could you help me make the library work?
My email address is
Best regards

RTCDS3234andDS1307.rar (9.47 KB)

So, you dont know how to add libraries ? recently, i am finally manage to make real time clock from this site, try it out. Its completely compatible with DS3231 and DS 1307 as well. use the adjust sketch first to try whether its working or kot.

you need to add the folder after u click>>Manage libraries >>Libraries , then add DS1307 folder for example

this folder containing 1. example folder. 2.source code and 3.header file, then ur good to go

Hello, Srar-X,thanks for your kind reply. Actually, I know how to put RTC file in the libraries. However, after I put this file in the libraries, the codes of DS3234 and DS1307 are error compling. So Could you help me check the code of example and tell me how to make it work well? Thank you very much again.

it doesnt work for me either. why dont use the link below DS3231 for Arduino 1.0 SeeeduinoStalkerV2.1_Software(Arduino_1.0).zip

Ds3231 library also work with ds1307 rtc for clock purposes only , but the interrupt pin function might be different

ur given library does look similar with my other clock library.

just include wire.h & RTClib.h delete spi and rtc_ds1307 it worked

Hi, Star-X, Thanks for your kind help again. I delete spi.h and DS1307.h. But the code still doesn’t work. it said “RTC_DS1307 does not name a type”.You can check picture 1 attached. I also tried DS3234 example, it also showed " RTC_DS3234 does not name a type". You can check picture 2 attached.
You recommeded me to use the library of DS3231 which has a problem that we should set time by typing rather than synchronize time from computer when we download code to arduino.
I hope you can help me make these code work.
Could you send your RTC libraries of DS1307 and DS3234 to me?

ok, just change to (DATE,TIME), rtc will sync will ur pc or laptop compile time

// Date and time functions using a RX8025 RTC connected via I2C and Wire lib

#include <Wire.h>
#include "DS3231.h"

DS3231 RTC; //Create the DS3231 object

//year, month, date, hour, min, sec and week-day(starts from 0 and goes to 6)
//writing any non-existent time-data may interfere with normal operation of the RTC.
//Take care of week-day also.
DateTime dt(__DATE__,__TIME__);

void setup () 
    RTC.adjust(dt); //Adjust date-time as defined 'dt' above 

void loop () 
    DateTime now =; //get the current date-time
    Serial.print(now.year(), DEC);
    Serial.print(now.month(), DEC);
    Serial.print(, DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(now.minute(), DEC);
    Serial.print(now.second(), DEC);

DS3231.rar (7.65 KB)

Thank you Star-X, Can this library you attached be used for DS3234? Now, I only have DS3234 sensor and DS1307 sensor. Could you send libraries for DS3234 and DS1307? Best regards Jingbo

I do not have DS3234 IC or its module. but im sure it might work if it is only use for time clock purposes only for data logging. not sure about the wake up interrupt functionality. it seem it use spi port.

Hi, Star-x, thanks for your kind help. Jingbo