Go Down

Topic: DS1307 + AT24C32 not keeping time when on battery (Read 1 time) previous topic - next topic

Daedalus1632

Aug 18, 2013, 07:23 pm Last Edit: Aug 21, 2013, 11:17 am by Daedalus1632 Reason: 1
Hi all, I searched in old posts but nobody seems to have solved the problem.

I just bought a DS1307 + AT24C32 module (like this) from eBay.

I am able to write\read DateTime data to the module, and I can read the time updates via serial.
The problem is that when i disconnect the usb from the arduino, the RTC stops updating the time, and it starts again when USB is reconnected (from the point it stopped when USB was disconnected).

This should not happen since the battery is present, and it's a brand new CR2032.

All the posts I found with a similar issue are not about pre-soldered modules.

Can you help me? Should I buy another one or am I missing something?

Thank you guys! =)

If it can help, this is the datasheet for the DS1307 RTC

Nathan99

On the eBay listing it looks like there is a on board battery holder. Are you using this for your battery. If so have you tried connecting a battery to the external "BAT" pin? Hope this helps.  :)

Daedalus1632

Well, the module is pre soldered so if I want to solder something (pins excluded) I'd have to detach the battery clip, if you look on the link i provided, the picture shows the module is compact, so, in my opinion, no other soldering is needed but the pins'.

transfinite

I've had this problem before with DS1307 modules, and the problem has been a problem with the 32k crystal on the module. Either the crystal is bad, or the connection to it is bad. You can try re-soldering the crystal, or preferable replacing the crystal. These modules are cheap on eBay. It may be easier to just get a couple more.

-transfinite

Daedalus1632


txpto

Good night,

My case is that the battery clip was subject, but not tinned.

When I reviewed welding, and it has worked.

Battery set and BAT pin unconnected.

Daedalus1632

Yeah I think this may suit best my situation, cause the module keeps time if usb powered, it just doesnt get power from the bat imho. I'll try check the bat connection but I have no idea on how to do that cause its a plastic block glued on the pcb and I dont want to break it :|

transfinite

If there is a problem with the connection to the battery, the DS1307 module will lose the date and time when power is removed from the module. Daedalus1632 stated that the date/time continued from the time it left off when disconnected from USB power.  This implies that the battery is keeping the NVRAM powered, but the 32.768kHz crystal is not incrementing the time.

Replace the crystal or the module.

-transfinite

Daedalus1632

Ok I'll try buy a couple more, hoping they will send me at least a healthy one

thanks

JohnHoward

A  possible solution:

http://electronics.stackexchange.com/questions/51178/ds1307-power-failure-problem

Sounds like the same problem, with a couple of fixes proffered.

(Oh, and if you decided to buy more and the reduced on board memory is not an issue, the DS3231 modules are great!  I was unhappy with the DS1307 accuracy and switched.  Now it is VERY accurate.

Daedalus1632

#10
Aug 20, 2013, 10:25 pm Last Edit: Aug 21, 2013, 03:24 am by Daedalus1632 Reason: 1
I looked for a DS3231 on eBay, but it seems to cost the double or even more, so what's the difference? More precision and nv memory?

JohnHoward


I looked for a DS3231 on eBay, but it seems to cost much the double or even more, so what's the difference? More precision and less nv memory?


That's about it, yeah.  The price is a bummer, but I wanted to play with one.  The DS3232 (if you can even find one) is 2-3 times that, just for the extra memory onboard.

Actually, I have an arduino that periodically queries the internet NTP pool and adjusts a DS1307 via a W5100 ethernet shield.  That works perfectly well, too.  The gradual drift doesn't accumulate too much between daily adjustments.

(I'm the kind of guy who would pop the back of his digital watch and tweak the trimmer capacitor -- you know, slightly obsessive compulsive about it)

Daedalus1632

Hahaha =)

you know, I'm kinda new to this world, and i just ended waiting for the delivery from China to EUW and now the module is not working. Complaining about a 0,99 USD module is just a waste of time, but I wanted to know if to be wrong is me or the module.

So just to kill any other doubt, I'd like to describe you my layout so you can tell me "yeah, you didn't miss anything" or beat me hard with a stick

what I have is:

an Arduino UNO R3 board with this module that is composed of a DS1307 RTC and an AT24C32, that has 2 sides of pins

one side has:
- DS
- SCL
- SDA
- VCC
- GND

the other side has   <-- this is the side i tinned the headers
- SQ
- DS
- SCL
- SDA
- VCC
- GND
- BAT

and there are 3 more pins, with no text, just grouped together and called U1 (you can see it in picture on eBay, maybe for a temp sensor?)

from the side I use I connected GND, VCC (to 5V), SDA (A4) and SCL (A5), with no resistors or any other elctric component

did I miss something?

thank you guys, again! =)

JohnHoward

I have the identical module, attached to an Uno R3 as follows:

SCL --> A5
SDA --> A4
VCC --> 5V
GND --> GND

The pins on either side are pass-throughs, so it does not matter which you use.

I have this ds1307RTC library: http://www.pjrc.com/teensy/td_libs_DS1307RTC.html

I didn't have to do anything special to get it to work.  Just followed the example.

The U1 footprint is for adding a DS18B20 temperature sensor, which you can read using one-wire protocol.  The RTC doesn't utilize it or connect with it in any way, as far as I know.

Go Up