I'm using DS1302 RTC. It works fine for days or maybe weeks, but sometimes starts with a high consumption of current and generates a lot of heat. When it happens I disconnect the supply and reconnect it, but the problem is still there. If I disconnect the supply and take out the internal battery the module starts to work fine as nothing has ever happened.
That sounds like either a bad chip or power source. Post an annotated schematic showing exactly how you have it wired, include all connections, power, ground and power sources. Links to the RTC module you have would be a big help as well as links to other items in your project.
Hi, there is nothing complicated. A simple Arduino Uno board connected to my laptop using an usb cable and the the DS1302 module is attached to Arduino as follows.
Arduino VCC to DS1302 VCC
Arduino GND to DS1302GND
Arduino PIN 5 to DS 1302 CLOCK
Arduino PIN 6 to DS1302 Data
Arduino PIN 8 to DS1302 Reset
I'm using the code:
#include <virtuabotixRTC.h>
virtuabotixRTC RTC(5, 6, 8);
and then read the clock with:
RTC.updateTime();
and the hours are stored automatically by the library functions in the RTC.hours variable.
The time is displayed on the my laptop using Software serial. The setup works just fine for days, maybe weeks, but sometimes (not so often) the chip gets stuck, it doesn't show the time and gets really hot to touch. I quickly disconnect the arduino from the laptop, take out the DS1302 coin cell battery and put it back and it works again as nothing has ever happened.
If I only unplug the arduino from the laptop and plug it again after some time, the problem does not disappear. I have to take out the CR2032 RTC battery also.
How about you post both your sketch and annotated schematic. Be sure to show all power sources, ground etc. Links to technical information on the hardware items will also help.
The only thing I can think of that would cause the RTC to actually heat up without something being wrong with the chip or the wiring is if the data pin, which is push-pull when in output mode, is connected to a pin on the Arduino that is also in output mode at the opposite polarity - that would be a dead short. But I don't know if your library could even get into that state. But if it runs fine in the beginning without getting hot, and then craps out later, you have to consider that it might be a software problem in the Arduino that's causing this, without anything actually being wrong with the RTC.
Maybe it is trickle-charging the wrong type of battery.
@ShermanP, I think you are right. I might have tried to transmit on a RX line. It might be a bug in my software. I didn't marked this as a solution yet because I changed my software and I'm waiting to see if the problem occurs again.
@ZX80, the trickle charge is disabled, the chip comes with it disabled and there is no command in my code to enable it.
Hi, where do I download this library virtuabotixRTC.h ? Help would be much appreciated
Thanks, I am struggling to write a code for a 4 channel relay activation with on and off times to repeat every day, I am building a Automatic water system, I have been busy with my Arduino 8 years back but only started today again
Found the library with a Google search on;
virtuabotixRTC.h
Good luck.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.