Electronic – arduino – DS1307 power failure problem


The DS1307 has two power sources: the main VCC source and the backup battery. The latter will power the DS1307 when the main power goes down so the clock can keep ticking.

I am facing a problem with the RTC DS1307 when the main power suddenly goes down and then return back the time on the LCD just freezes. Sometimes when that happens (power off) the RTC keeps running (it seems that the DS is stuck when the main power off).

This is the exact circuit I used and the battery gives 3.0V:


The code I used is exactly in blog post: DS1307 Real Time Clock Working.

What could the problem be?

Best Answer

Schematic is good. Run this checklist:

  • Check your power supply for clean wave, specially on connect and disconnect times. If it pikes for more than 1V add 4.7uF capacitor. If it do not fix the problem, change power supply and renew DS1307.

  • Check 3V battery current capability, no voltage only, DS1307 need 200uA min.

  • Check for 3V bat having unwanted path discharging it. Specially if you are using protoboard.

  • Check I2C commands/software.