I have a RTC ds1307 mounted on a prototype board ( the one with 3 pin stripped ), and I'm experiencing a delay of about 5 sec/day, far too big compared to some research I did. Can that delay be caused from extra capacitance added by the prototyping board or is just the crystal? This is the crystal I'm using.

  • \$\begingroup\$ @CamilStaps should e 32768, I added the datasheet anyway \$\endgroup\$ – Felice Pollano Apr 22 '13 at 18:39
  • \$\begingroup\$ @CamilStaps well, I'm an hobbist, not a real EE :) so not so easy. The datasheet claim a +-20ppm tolerance, I would like to study if that tolerance is compatible with my drift. \$\endgroup\$ – Felice Pollano Apr 22 '13 at 18:43
  • 2
    \$\begingroup\$ That crystal comes in 6 pF and 12.5 pF versions. Are you sure you have the right one? \$\endgroup\$ – markrages Apr 22 '13 at 18:47
  • 5
    \$\begingroup\$ There are 86400 seconds in a day, so five seconds is 60 ppm out. This could easily be caused by improper load capacitance on the crystal. \$\endgroup\$ – markrages Apr 22 '13 at 18:48
  • \$\begingroup\$ This seems like a capacitance issue to me. I can't say more without some good quality photos of the board itself and list of all components (including capacitors). My advice would be to take a look at the square wave out on the RTC (also what tools do you have available) and check exactly which frequency you're getting. This would most likely be solved by rearanging components on the board and using small 1 pF capacitors in strategic locations. \$\endgroup\$ – AndrejaKo Apr 22 '13 at 18:49

Well, I solved the drift. After checking the crystal capacity and seeing it is correct as the frequency, I decided to power the Arduino power from an external power supply, my DS1307 uses the +5v from the Arduino board. With the new power supply the clock is accurate ( I can't see a drift of second in 24 h ). I don't know if it was a problem in having a barely enough voltage with the USB or if that supply was "dirty", but in any case the single cause was the power supply.

  • \$\begingroup\$ A RTC takes very little power, a few mA at most during communication (i2c/spi/etc), and the Arduino has 5v regulated, not 6v. \$\endgroup\$ – Passerby Apr 28 '13 at 18:37
  • \$\begingroup\$ @Passerby you are correct about the current topic, I can' explain why but with an external power it works like a charm \$\endgroup\$ – Felice Pollano Apr 29 '13 at 5:51
  • \$\begingroup\$ I would assume because the usb power supply is regulated over a long cable, while the vin supply is regulated at the arduino board's regulator. Do you have a decoupling cap for the rtc? \$\endgroup\$ – Passerby Apr 29 '13 at 6:35
  • \$\begingroup\$ @Passerby no I don't, it is probably the problem, but anyway the circuit will work with an external supply in the "production" case. I will add a decoupling cap too, I think 100nF will be ok? \$\endgroup\$ – Felice Pollano Apr 29 '13 at 7:23
  • \$\begingroup\$ 0.1uf/100nf is the standard size decoupling cap, so yes. \$\endgroup\$ – Passerby Apr 29 '13 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.