Go Down

Topic: "Tiny RTC I2C Module" issue (Read 27 times) previous topic - next topic

Docedison

re the crystal.. Soldering them to ground is a common practice for several reasons, one is mechanical .. Vibration can affect the frequency and the second is temperature variations, the third and most important is that soldering fixes the loading capacitors, movement of the crystal can change the operating frequency. I have a handful of devices with 32 KHz crystals.. All soldered..
Seiko had an app note on it from back in the 80's and is still present on some of the early clock chips data sheets... The above materials are all I can remember... It was a long time ago.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Jack Christensen

#16
Sep 19, 2013, 01:45 pm Last Edit: Sep 19, 2013, 01:47 pm by Jack Christensen Reason: 1


I've never seen a DS1307 design where the crystal case was soldered to ground. I've probably got a dozen of them around, at least three different designs, plus I've breadboarded them with success. I wouldn't think the heat from soldering would do those crystals any good.


Well, Sparkfun seem to think it's a good idea to anchor the xtal case to a solder pad - see attached photo.  Their module simply works.


Well that makes one. Here is the datasheet for a crystal that I use, it specifically warns against soldering the case. The part number for Sparkfun's crystal isn't on the schematic, but I suppose it's possible that soldering is OK for a different part.

I have used glue to mitigate movement and vibration.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

snusmumriken

As a newbie, I'm having to learn all this from a zero knowledge base.  I note in various datasheets that they refer to a 'local ground plane' in the vicinity of the xtal.  So is the large blob of solder under the xtal acting as that ground plane?  In which case, why would anyone solder (rather than glue) the case to it?

I can't help thinking (again from my position of ignorance) that this is a red herring from the OP's problem.  If the xtal was faulty or incorrectly located, the clock wouldn't update at all surely?  The problem is that once VCC power is lost the clock seems to forget to update until you reconnect (or at least won't report the correct time).

Gustavo_Murta

In my point of view there is one design problem in this module !
If you see the DS1307´s data sheet, you can find that battery voltage must be upper than 2.0V .
I dont know why this circuit have a voltage divider by resistors R6 and R4.
I will think about one solution for this problem.



Gustavo Murta (Brazil)

Jack Christensen


I note in various datasheets that they refer to a 'local ground plane' in the vicinity of the xtal.  So is the large blob of solder under the xtal acting as that ground plane?  In which case, why would anyone solder (rather than glue) the case to it?


I suppose that the solder is part of the ground plane, but more commonly, the ground plane is just the copper on the circuit board. From reading the datasheets, the manufacturers seem to think that is sufficient.

Quote

I can't help thinking (again from my position of ignorance) that this is a red herring from the OP's problem.  If the xtal was faulty or incorrectly located, the clock wouldn't update at all surely?  The problem is that once VCC power is lost the clock seems to forget to update until you reconnect (or at least won't report the correct time).


Could be. I haven't seen this behavior and I don't have a theory. There is a "clock halt" bit in the seconds register (0x00) but I see no reason to think it's being manipulated.


I dont know why this circuit have a voltage divider by resistors R6 and R4.


Very good question.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

webst

I got the same module mentioned in first post. I don't know if it's just cheap chinese knock off but I found what seems to be original idea here: http://www.hobbyist.co.nz/?q=real_time_clock

niziak

Hello!
After some days of operation my CR2032 battery (which was included) explodes. It was not dangerous, because battery case designed to this, but it makes loud click.
After this, I made some investigations:
- module is designed to work only with LIR2032 (rechargeable battery)
- LIR2032 nominal voltage is 3,6V, minimum safe voltage 3V, charging current is 20mA, maximum charging voltage is 4,2V 10mA
- voltage divider is to protect DS1307 Vbatt input from over-voltage. In my version R6/R4 = 510k / 1.5M. Which gives you 2,3V from 3V and 3,15 from 4,2 V.
- fast fix to use CR2032 (not rechargeable)  is to cut track in charging circuit (between D1 and R6). But voltage divider will be sucking 1,5 uA current from battery, so divider should be also removed (remove R4 and short R6).

Loic_B

Hello,

I recently bought a Tiny RTC module and experienced difficulties too. This post helped me a lot ! Thank you !
Nevertheless, I don't want to apply on board modifications, so I have found another way to make it work (without exploding batteries  ;))
I am here to share my own experience on this module and I came with some questions ...

First, concerning the oscillator and the ground thing, it seems from DS1307 datasheet itself (http://datasheets.maximintegrated.com/en/ds/DS1307.pdf ) that oscillator must be attached to ground (figure 2, p7) in order to be isolated from "RF generating signals". jonwwo was right (compliant with specs). End of story.

Then, if i understood well, this module is dedicated to work with rechargable battery only. I didn't had any, so I tried with a non rechargable one : that was not working. But if I powered up VCC pin, it works. Question 1 : Should I understand that powering VCC is mandatory ?

After that, I removed battery, and let VCC connected (from Arduino). That was working well, but when arduino was disconnected, RTC module was switched off and I lost current time. I could have expected that.

Finally, I powered up RTC module from external power source (9V battery through LM7805). Of course, Arduino powered or not, I keep current time and further request to time returns correct answer. Question 2: why powering VCC with external power source helps keeping time memory, while using a little CR2032 cell does not keep it ? Given the diagram already posted (http://www.emartee.com/Attachment.php?name=42059.pdf), it should be the same to me : VBAT pin is connected both to battery and VCC. CR2032 and LIR2032 voltage is quite the same, am I wrong ?

Now, I think I will keep an external power source connected to VCC to keep RTC module running, but it sources about 1.8 mA, while spec says that it sources only 5nA from battery. I am worried by this high consumption. Question 3 : Is there a way to decrease this ?

Anyway, this cheap module seems to do the job, but is quite hard for a beginner to make it work. And I guess it will become harder if I want to decrease current. We'll see ...

Thanks !
Wonderful and easy Arduino tutos here : ThePolyscope.com
And also science new and various tech topics !

/dev

Late to the party again...   I stumbled across this thread while trying to solve the same problem with my Tiny RTC module:  setting the time occasionally worked, and the clock didn't advance.  General flakiness.  And my crystal had also broken away from the ground pad.

After trying several different example programs from several sources, I always got the same flaky behavior.   It must be the hardware (says the software guy).

It was suggested elsewhere that 100pF might not be enough decoupling, but I wondered if the signals just weren't clean enough.  Before breaking out the 'scope, I decided to try shorter wires for connecting SCA and SCL: about 1.5" instead of 8".  The VCC and GND wires were still 8" long, and they also went through breadboard rails.

Now it works!  And switching back to the long SDA/SCL wires causes the flaky behavior to reappear.

Cheers,
/dev

dandj


Question 2: why powering VCC with external power source helps keeping time memory, while using a little CR2032 cell does not keep it ?


In critical applications where button cells are used (eg my auto-darkening welding helmet) they are usually soldered or welded direct to the circuit board. That's due to the very low current flowing through the battery connections. The slightest contact resistance (due to corrosion or vibration) will impact the available voltage. Normal connectors rely on current passing through the contacts to keep them clean. I suggest the button cell be soldered or very tightly clamped to avoid this problem.

Jack Christensen


The slightest contact resistance (due to corrosion or vibration) will impact the available voltage.


I have an RTC circuit where the backup battery is connected to the RTC chip through a 1K series resistor. The battery current is on the order of 1µA, so the resistor only drops about about 1mV.

This is not to dispute the welding helmet observation. In particular, galvanic action caused by corrosion can easily disrupt small currents. I'm just saying that it's not about pure resistance. Lower current circuits will be affected relatively less by even modest amounts of resistance.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Stefan_28

I still am getting errors using thoselibraries.  does any one have a link for RTClib.h?

dtokez

I'm also having trouble. Have used the adafruit example and tried the code from here http://bildr.org/2011/03/ds1307-arduino/

I am running the sketch with the line uncommented to set the time and get nothing but this

Code: [Select]
RTC is NOT running!
2165/165/165 165:165:85
since midnight 1/1/1970 = 1381621585s = 15990d
now + 7d + 30s: 2013/10/19 23:46:55

2165/165/165 165:165:85
since midnight 1/1/1970 = 1381621585s = 15990d
now + 7d + 30s: 2013/10/19 23:46:55

2165/165/165 165:165:85
since midnight 1/1/1970 = 1381621585s = 15990d
now + 7d + 30s: 2013/10/19 23:46:55



Any ideas guys?

RoomHeli

Hi,
Design of this module is not correct. If it does not work at all try to test it that :
1. remove battery
If it works (communicate on I2c ) and update time - the problem that you have is that vcc is not high enough ( less than 5 V).
If it works (with battery) but does not keep time after power down.
2. disconnect battery level line from Arduino.
If it now works and keep time  it means that you circuit is one as shown on Gustavo Murta schematic and the problems outlined by Niziak.

Design is incorrect because R5 and D1 must be removed (battery is not rechargeable) and voltage divider violates ds1307 specification for power down and up levels with respect to battery input to the chip - removing battery test that.

R6 is wrongly placed - it should be shorted (battery drives  battery pin on ds1307 directly) and new 500K resistor should be placed between this line and bat level pin on connector. Design flaw with R6 placement causes that (because of internal resistance on arduino adc input pin during power off is lower than internal resistance of ds1307 ) during power off battery voltage on ds1307 is too low and is below level required to run oscillator (disconnecting battery  voltage sens line from arduino proves it).

With some soldering and track cutting on board this correction can be made.

Regards

coryjp75

I appreciate all of this wonderful information and shared troubleshooting...

Though, I think it's worth mentioning again, that this module is designed to work only with LIR2032 (rechargeable battery).  If you are fortunate enough to receive it, with this type of battery, then you need not do anything special except let that battery charge, at least overnight.

I speculate:  The reason that you might be experiencing the need to pulse the module at start-up is due to some strange conflict when connected to the serial port.

Best regards,
Cory

Go Up