RTC Module broken?

Hi guys,

I'm using an RTC module on a Arduino UNO board. At first, I was powering the board with the USB cord that I use to read the serial monitor and develop my code.

Then, I started powering the board with an external battery (12V) connected to a level shifter to have 5V, plugged into the Vin and GND of the board.

In order to save power, I'm using a circuit that uses MOSFETs to turn the power ON and OFF using a button, as described here: https://circuitjournal.com/arduino-auto-power-off. The idea is to set a timer in the code and to turn off the board automatically.

Rapidly, I noticed the code was freezing when initializing the RTC Module when powered by the battery. The problem is not appearing when powered with the USB cord. I tried different ways to connect the wires unsuccessfully.
Later the RTC module started not to increment the time at all. Time stayed to 00:00 continuously. So I tried to use another RTC module that I had and it worked fine... for a short time!

Now, I have 2 RTC modules that freeze the code when I do the clock.begin();.
The auto-power-off circuit and the code work fine as long as I don't initialize the RTC module.

Do you consider likely my RTC modules to be broken by a voltage peak or something like that?
Is it possible I fried the RTC modules with this auto-power-off circuit or even simply with the external battery?
Is it possible the battery on the Vin and the USB cord plugged at the same time would create a high voltage?

Here's an overview of the whole circuit. I can send closeup pictures if it can help you having ideas.

It takes minimum of 7.5V into the power jack or 7V into Vin for the onboard voltage regulator to regulate properly. If you have regulated 5V, connect it to the 5V pin.

It is not clear if this affects you but the name clock is used in the C++ library time.h so (re) using this name is not advised. Switch on compiler warnings in preferences if you have not already done so and check the compiler output.

What is the "level shifter"? Is it a logical level shifter module?
The logic level converter is not intended for power supply, it is only for low current signals

No.
It seems to most probably for me that you connections (especially for power lines) is wrong.

Please show a detail connection diagram instead.

Ok. I'll change name. Thanks.

Let me make a clean diagram and come back here. Thanks

Here's a diagram of the circuit.

To answer @b707,

  1. By "level shifter", I meant "LM2596 Buck Converter". I didn't know the exact word.
  2. I came to think the RTC got broken because the behavior was not consistent. Please note that it has been working exactly as expected for a short while.
  3. I didn't draw the part with the screen, as I suppose it's not related to the problem, but if you want to see it, I can make the full circuit.

I made the sketch as close as possible to the actual circuit.

It's based on this circuit:

Another question that comes to my mind, should I unplug the battery wires when I plug in the USB cord?

Also, I've noticed when I plug directly the battery wires to the Vin/GND, the screen backlight flickers a bit. Could it prevent the RTC module to initialize correctly? When I plug the USB cord, the screen doesn't flicker at all.

Hi guys,

I'll close this topic. I have multiple contact failures in my circuits.

Thanks for taking the time to read and answer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.