The print on the circuit is a bit different, it says ds1302N and the other lines are different as well, but the overall layout of the module is the same.
I used it with a NANO, connected the VCC to the main power supply at +5V, GND as well, the other three pins went to D6-8.
It worked well and did its function but I had one issue - when I unplug the breadboard power supply or turn it off, it takes only a rather short while - maybe 2 days or so - to drain the battery and then it looses its time. I could not yet confirm if that drain also happens when the power is up, but I presume that would not be the case - I will have to buy a new battery again in order to test that.
So what could be happening and did this happen to others before? I suspect that the power of the battery goes to the circuit on the breadboard and it "tries" to power the Nano and other components. Do I need to put in a diode or something to keep the power in the RTC module?
The module on the picture uses a Litium cell, often a Cr2032, as power backup. That's the normal way.
Post a wiring diagram! That's mandatory when having power problems.
There could be other problems, as well.
Did your program set the correct time, once, and then continue to retrieve the time and check it for correctness?
Did you measure the battery voltage while still in the holder and again when you removed it?
Finally, the board could be just a bad design.
Paul
It might be useful to use your meter to see if there is any voltage on any of the RTC module pins when the breadboard power is off (with the replacement coin battery installed). There shouldn't be any. And do the same test with the module completely disconnected from the breadboard. There shouldn't be any there either.
And finally, with the coin battery removed, see if the Vcc1 and Vcc2 pins of the chip are connected together. They shouldn't be.
it would not be the first time there are problems with the etching on the board.
as geek emeritus says, 8 years is what we expect. I have seen an RTC with 5 before failure and have a PC that has one still going at 12 years.
post your code, are you re-writing the time with each power cycle ?
The battery should NOT be powering the Nano, no diode needed. The only way for that to happen would be for the chip to be defective or have a copper bridge between pins 1 (vcc1) and 8 (vcc2) of the IC on the board.
It will easy to troubleshoot if you have a multimeter, almost impossible without one.
Have you read the spec sheet? Does it mention "trickle" charging? On some of these modules there is a trickle charge circuit that cause battery failure as the Battery is not designed as rechargeable.
Thanks for the advice. I disassembled the setup for now, but I can try measuring the module. I dont have the specs of that specific module - I ordered it on Amazon and it came without a spec sheet. There is no short-circuit between the battery and the Vcc pin, I checked that with a Multimeter, however if I put in the battery, I can measure the 2.9V at the Vcc pin, which is what I suspected. Resistance between the battery + and the Vcc pin reads at 3M, so I am puzzled a bit by it - the leakage must only happen when the module is active, it seems.
The code only reads the time every 50 ms with myRTC.updateTime(); I set the time only once and then commented that line from the code once the module had its time, relying on the battery.
I tried to recreate the circuit in Fritzing now, I hope I did this right, its first time I use that program (I also did not yet find a way to insert a power supply - the lower two power lines are connected to a +5V supply). It did not have the RTC module I use, apparently, so I put in another RTC module in that drawing instead. Are there ways to get more modules into the program or make placeholders oneself?
Paul__B:
Excellent photos. Interesting that you mirrored the photo of the underneath.
Well, no resistors, diodes etc. on that board, so nothing with which to fiddle.
Back to the drawing board!
Yes I think the mirroring makes it easier to see the schematics.
But this is a module I bought as it is - so I am surprised that it leaks the battery voltage to the Vcc - so I guess I will need to put a diode there in the future to only allow the voltage in one direction.
I think the PCB is missing some components since the DS1302 is a trickle-charge timekeeping chip
Diode and resistor selection is determined by the user according to the maximum current desired for battery or
super cap charging. The maximum charging current can be calculated as illustrated in the following example.
Assume that a system power supply of 5V is applied to VCC2 and a super cap is connected to VCC1. Also assume
that the trickle charger has been enabled with one diode and resistor R1 between VCC2 and VCC1. The maximum
current IMAX would therefore be calculated as follows: