One of my projects started to show some erratic behavior and while trying to replicate the problem I have simplified it like this:
Arduino uno, DS1302 RTC, I2C display (20x4).
The problem is that when powered by batteries in the Arduino power input, the RTC runs like crazy, many times faster than it should. RTC battery removed.
When powered by USB, everything is ok (no battery to RTC).
When powered by batteries and with RTC battery in position everything is ok.
I would like to power this from a 12V car battery that should be connected to Arduino power input. The RTC battery should be removed.
Any ideas why the RTC runs that fast while the device is powered by batteries?
Why? If the module is meant for usage of a rechargeable battery, removing it might have unknown consequences
(Note that The DS1302 is notoriously not very precise - a DS3231 would do better)
12V in the input jack is a lot, esp as your car battery is probably more than this, may be 14V.. that’s a lot of energy the regulator has to burn as heat, could possibly shutdown.
How will You power the LCD then? Don't count on the controller 5 volt output to manage that when powered from a 12 -14 volt system. The internal 5 volt converter might get overheated.
Well, it seems that the reason was quite stupid. The socket's quality of the DS1302 chip was so poor that probably the crystal did not make proper connection.
Changing that fixed the problem.
Anyway it was a good opportunity to change a little my design as some of the components were using the 5V output of the Arduino board. I have a 5V buck converter running the Arduino board now and all other modules that require that voltage.