Pages: [1]   Go Down
Author Topic: DS1307 + AT24C32 not keeping time when on battery  (Read 1354 times)
0 Members and 1 Guest are viewing this topic.
Venezia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: August 21, 2013, 04:17:38 am by Daedalus1632 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley
Logged

Venezia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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'.
Logged

Birmingham, AL
Offline Offline
Jr. Member
**
Karma: 2
Posts: 91
Arduino, disobey me.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Venezia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So you suggest me to buy a couple more?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Venezia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-neutral
Logged

Birmingham, AL
Offline Offline
Jr. Member
**
Karma: 2
Posts: 91
Arduino, disobey me.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Venezia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

thanks
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 219
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Venezia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: August 20, 2013, 08:24:26 pm by Daedalus1632 » Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 219
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Venezia
Offline Offline
Jr. Member
**
Karma: 1
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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! =)
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 219
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: