What RTC Clock to buy ?!

Hello everybody ! (and sorry for my bad english, i'm french...)

Last year, i bought a DS1302 ( http://www.ebay.fr/itm/DS1302-Horloge-temps-reel-Module-temps-reel-avec-pile-CR2302-de-Noir-Vert-WT-/291893460872?hash=item43f634bf88:g:rXYAAOSwImRYaahb ). I'm very very disapointed about this RTC, after 1 day the clock has more than 30 min of late, and when arduino is unplugged (but the battery of the RTC is connected and full charge), the RTC start to 00:00 when arduino start...

After this, I bought a DS1307, who present similar unpleasantness...

So, can you give me the link of a good (and cheap) RTC module only at AliExpress or Banggood ?

Thank you very much :slight_smile:

30 minutes drift and resetting to zero after a reset sounds like code problems.

The DS1307 should accurate to within about 30 seconds per day.
The cheap DS3231 modules on Ebay are less affected by temperature and not much more expensive.

DS3231

DS1307 is a very poor choice.

Get a DS3231.

.

with that resetting problem, it might be a problem with the battery or battery connection. Also consider placing the unit somewhere that experiences less heat fluctuation/more standard (0-40C) temperatures.

The accuracy changes by temp:
https://datasheets.maximintegrated.com/en/ds/DS3231.pdf

mikb55:
30 minutes drift and resetting to zero after a reset sounds like code problems.

The DS1307 should accurate to within about 30 seconds per day.
The cheap DS3231 modules on Ebay are less affected by temperature and not much more expensive.

What kind of code problems ? :o In the program i have just some clock read function, not clock set function...
Too much read operations can make a late in the clock ?

Jellysfish:
with that resetting problem, it might be a problem with the battery or battery connection. Also consider placing the unit somewhere that experiences less heat fluctuation/more standard (0-40C) temperatures.

The accuracy changes by temp:
https://datasheets.maximintegrated.com/en/ds/DS3231.pdf

The RTC and Arduino is in my house, never less than 20°C...
I tested the battery with a multimeter (voltmeter), the battery is full...
And, if I power off the Arduino and power on ~5 min later the clock is still working, but after 20min it reset :frowning:

I would also recommend the DS3231 but with reservations.
There are 2 popular breakouts:

(1) ZS-042 style which includes an EEPROM. Lots of people advise removing the resistor from the charging circuit and using a non rechargeable CR2032 battery.

(2) A much smaller one marked "DS3231 for PI" with a soldered on backup battery. Despite the marking, this is also compatible with an Arduino.

You may find that the ds1307 library is compatible with the ds3231.

(2) A much smaller one marked "DS3231 for PI" with a soldered on backup battery. Despite the marking, this is also compatible with an Arduino.

This one gets my vote. I have used a few in projects. They work well and take up no room at all (it is smaller than my thumbnail). The bigger Z-042 modules have an EEPROM as well which I would not use.
DS1307 library will work with DS3231 in most cases but you miss out on the additional functionality (eg alarms) build into the chip.

Module ChronoDot based on DS3231 is very attractive.

Finette57:
What kind of code problems ?

Nobody will ever know until your code becomes no longer a secret, but it is a pretty fair bet that, while the ds3231 is definitly a better module, it probably won't fix your problem.

The RTC and Arduino is in my house, never less than 20°C...
I tested the battery with a multimeter (voltmeter), the battery is full...
And, if I power off the Arduino and power on ~5 min later the clock is still working, but after 20min it reset

In a reasonably stable indoor environment, the DS1307 is pretty good and is likely to be innocent of the problems you attribute to it.
You can use the DS3231 with code written for DS1307 - no changes needed.

Here is my code, as clean as I could…
If you see something wrong than can fix the problem I will try to use the DS1307 (china ship takes 1month…)

#include <MD_Parola.h>    // Lib Matrix8x8
#include <MD_MAX72xx.h>
#if USE_LIBRARY_SPI
#include <SPI.h>
#endif

#include <Wire.h>   // Lib RTC DS1307
#include "RTClib.h"

                     // DATA,CLK,CS,Devices
MD_Parola P = MD_Parola (10,  8, 9, 4);

RTC_DS1307 rtc;

int heure =    13;
int minutes =  37;

void setup(void)
{
  P.begin();
  P.setIntensity(0);
   P.displayText("init", CENTER, 0, 0, PRINT, NO_EFFECT);
   P.displayAnimate();
   delay(2000);
}

void loop(void)
{
  DateTime now = rtc.now();
    heure = now.hour;
    minutes = now.minute;
      char str[20];
      sprintf(str,"%d:%02d",heure,minutes);
    P.displayText(str, CENTER, 0, 0, PRINT, NO_EFFECT);
    P.displayAnimate();
  delay(1000);
}