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
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).
Tiny RTC.pdf (53.4 KB)
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 …
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.
Loic_B: 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.
dandj: 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.
I still am getting errors using thoselibraries. does any one have a link for RTClib.h?
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
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?
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.
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
Hello everyone with Tiny RTC problems, I was experiencing them as well, but, at least in my particular case, they appear to be solved. Problem description: 1. Something like this: 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
- Sometimes, especially after loading a sketch, I was able to set the clock, but the clock would not advance.
Cause: Faulty or improperly selected resonator (DS1307 has specific requirements, see the datasheet).
Solution: I took a working resonator of the same size (no specs known) from an old bathroom clock I was about to get rid off anyway. 5 minuts of resoldering and the RTC started to work as expected. It looks like it was not necessary to solder the body of the resonator to ground (it worked just fine without it), however, I decided to do it (carefully, trying to avoid overheating the resonator) after inspecting the way other RTC designs were built.
Update 20140304.1 It looks like there might be another issue - actually already mentioned by RoomHeli - I have left the RTC with the BAT output connected to the A1 input pin for a week or so. Today, I have noticed that the clock stopped back then. I did some experiments and it turned out that this might be due to leaving this BAT output connected - it makes the clock stop for some reason. Leaving BAT not connected seems to correct this issue. I would like to use this for checking the battery status, but I guess I will have to live without it. I will keep checking these findings.
Update 20140304.2 Yet another problem - for some reason, after the power is applied and serial console is not connected, the module will not provide time (2165/165/165 165:165:85). I would suspect that the R7 resistor might be causing this behaviour - bu it is not present on my Tiny RTC module. This rechargeable battery mess actually does not do much good - I opt for making the changes suggested by RoomHeli (getting rid of all the charging circuitry and replacing the LIR2032 rechargeable battery with a regular CR2032 type one) to get the module as close to the simple, "typical" circuit design as possible.
I'm also having issues with this Tiny RTC module and after reading this thread, I get the feeling that it's not really worth my time to continue trying to get it to work.
Can anyone recommend an alternative module that "just works"?
lintmachine: I'm also having issues with this Tiny RTC module and after reading this thread, I get the feeling that it's not really worth my time to continue trying to get it to work.
Can anyone recommend an alternative module that "just works"?
[quote author=Jack Christensen link=topic=177297.msg1681642#msg1681642 date=1397588497]
Perfect. Just ordered one of yours. Thanks!
lintmachine: Perfect. Just ordered one of yours. Thanks!
Thank you! Just dropped it off at the Post Office. Popular place, I forgot what day it was. I pulled in next to a lady that was filling out her tax return in the car!
Epic turn-around time on that! Just received it and looks great. I'll be trying it out this weekend.
Thanks for braving the post office on Tax day.
lintmachine: Epic turn-around time on that! Just received it and looks great. I'll be trying it out this weekend.
Thanks for braving the post office on Tax day.
Haha, USPS actually does pretty good work these days! The PO wasn't bad, I didn't have to stand in line :D
Hope it works well for you, let me know!
Hi! I was just about to cut R6 or R4 and the battery line and so on (like it described on the internet). I started to pull out the resistor and I saw that the power was on and that the time on the LCD is right, wtf, until now I got only 156/156/156……… when I connected the Arduino to power supply unit (The Arduino was not connected to the pc): . I turned the power off and on again and I got 156/156/156………….. again but this time I gave the tiny rtc some time : ) . After 30 plus on and off I got Between 30 sek to 5 min until the tiny rtc got the right time back.
Hope that this information help.
OMG what a mess....
So I got a Tiny RTC module a week ago, after tinkering with it I finally got it working (well kind of), what I did was: desolder and discard r4,r5,r6 and d1. Bridged with some solder the 2 contact pads where r6 used to be. That way I got rid of all the charging circuitry and I'm applying directly the battery power to the ds1307. I measure the voltage from pin 3 to ground and I have a healthy 3.3 volts. Now I found out the RTC is not keeping time everytime there is no power from the Arduino, which actually is the only reason why I needed an RTC. I just stumbled in this thread and made an account just to add my experience to it... I'm working with Arduino DUE.
Anyway I hope someone can figure out whats the problem, it is weird that the RTC works perfectly with +5v but stops working even if there is more than 3V in the battery pin.
I forgot to mention that when I disconnect power from the RTC and reconnect after a few minutes the time is still the same as when I disconnected it. Thats the weird part because that means that the RTC has power, I assume… But the oscilator stops working.
Ahhhh the chinese crap…