Imprecise DS1307

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
igordashaar
 
Posts: 2
Joined: Wed May 14, 2014 10:32 am

Imprecise DS1307

Post by igordashaar »

Hey everyone,
I've bought 3 Adafruit RTC Breakout board kits (http://www.adafruit.com/products/264#te ... ils-anchor). Now I have two questions.
First Question: is it normal that they are pretty imprecise? After just one day I have a difference of 8 seconds in two of them. The time was set via Arduino Micro using the Adafruit example Code and they are store in the same place (meaning equal humidity and temperature)
And my second question: is there a possibility to get rid of the uploading delay when setting the time via Arduino?. My PC needs about 10 seconds to compile and upload an Arduino sketch. So every time I try to set the time using

Code: Select all

RTC.adjust(DateTime(__DATE__, "__TIME__"));
I have a delay of 10 seconds. Alternatively I tried doing something like this:

Code: Select all

RTC.adjust(DateTime(__DATE__, "19:27:10"));

it works fine (for maybe +- 1 second).

Thanks in advance for your help
igor

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Imprecise DS1307

Post by adafruit_support_rick »

How are you reporting the time from the module? Can you post your sketch?

The Time library has a sketch that works with Processing to synchronize your clock with a computer
http://playground.arduino.cc/Code/time

igordashaar
 
Posts: 2
Joined: Wed May 14, 2014 10:32 am

Re: Imprecise DS1307

Post by igordashaar »

Thanks for your reply,
I didn't know about the Arduino Time library, instead I used the "RTClib.h" suggested here: https://learn.adafruit.com/ds1307-real- ... no-library

the relevant part of the sketch looks like this:

Code: Select all

#include "RTClib.h"
void setup() {

  //for RTC, initialise I2C and RTC
  Wire.begin();
  RTC.begin();
}

void loop(){
  now = RTC.now();
  writeDateTime();

}

Code: Select all

void writeDateTime() {
  if (now.day() < 10) {
    Serial.print("0");
  }
  Serial.print(now.day(), DEC);
  Serial.print(".");
  if (now.month() < 10) {
    Serial.print("0");
  }
  Serial.print(now.month(), DEC);
  Serial.print(".");
  Serial.print(now.year(), DEC);
  Serial.print(" ");
  if (now.hour() < 10) {
    Serial.print("0");
  }
  Serial.print(now.hour(), DEC);
  Serial.print(":");
  if (now.minute() < 10) {
    Serial.print("0");
  }
  Serial.print(now.minute(), DEC);
  Serial.print(":");
  if (now.second() < 10) {
    Serial.print("0");
  }
  Serial.print(now.second(), DEC);
  Serial.print(" ");

}

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Imprecise DS1307

Post by adafruit_support_rick »

The DS1307 is not a temperature-compensated RTC, but it should be a lot better than 8 seconds/day.

Is it just one of the three that is off? Do the other two track pretty closely?

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”