Go Down

Topic: Feeding DS1337 with Arduino +5V and having battery backup (Read 2 times) previous topic - next topic


My intention with the circuit below is to enable a DS1337+ (I2C, 8-DIP, RTC by Maxim) to have a battery backup, just like the DS1307.

The DS1337+  (and DS1672) is all I have in hads right now, so suggestions such as "just use a DS1307" aren't exactly what I am looking for. I already have all the components listed in the circuit below.

Basically the circuit is:

If there is +5V coming in from the arduino (header), then the DS1337+ is powered through a 3.3V regulated output provided by the MAX604, which in turn is powered by the Arduino. Otherwise it is fed by a CR2032 coin cell.

Q2 + R1 + R2 is simply as a "NOT" gate, having the arduino +5V as its input

LED D1 simply shows that there is power from the arduino.

The circuit above works in the protoboard, but it has a few drawbacks, and that's where your help comes in:

- In the picture above, Q2 is a 2N2222, but in reality it's a KA2222. I chose it over the 2N3904 because it has a lower voltage drop on the emitter than the 2N3904. I get at most 2.4V for Vcc @ U2 when it's unplugged. How can I maximized the voltage available to the DS1337 ?

- The MAX604 datasheet state that it has built-in protection for when Vout > Vin. I figure that will be everytime the circuit is disconnected from the Arduino. Would that do any hard to the IC in the long run?

- C1 is there not only to stabilize the output from the battery or from the MAX604, but also to prevent any lack of power when the circuit is being (dis)connected from the arduino and Q1 hasn't switched fast enough. Is 10uF enough for that?

- Is the circuit above correct? Can it be simpler considering all I want is to have 2 possible power sources for the DS1337?

Thanks in advance.
Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html


MOSFETs for the switching elements would eliminate any voltage losses and reduce current drain in the bias resistors (which can be much larger in value).  Couldn't Q1 & Q2 be replaced by a single PNP or p-channel device?
[ I won't respond to messages, use the forum please ]


Aug 29, 2012, 08:19 pm Last Edit: Aug 29, 2012, 08:22 pm by pwillard Reason: 1
Wouldn't this work too? (diodes)  3.3V from regulator is more than battery, keeping D2 non-conducting... unless it goes away... and then it conducts to allow battery to supply 3.2V (or less)


I recently did something similar making a simple RTC from a PCF8563 with battery backup provided by a CR2032. I just used a couple of 1N4004 diodes as shown/described in the circuit here.

Seems to work fine for my needs.


Thanks for the replies, guys.

Until now I was a bit reluctant on using diodes because of the voltage drop (0.7V), and please correct me if my line of thought below is wrong:

Considering the minimum voltage required by the DS1337 is 2.5V, a 0.7V drop caused by the diode would bring a brand new CR2032 (3.2V) to the minimum required supplyby the IC. I am afraid that whenever the battery gets to 3.1 or 3.0V, it would no longer be able to power the DS1337 in offline mode.

Thanks, I'll try that. I don't think I have any 1N4001 around, but I have a few dozen 1N4148

BTW: I am also planning on making a shield that will host a RTC + 4 X 24LC256 EEPROMs, all on a single I2C bus. I already ordered the EEPROMS from Sparkfun, but I just found out that Farnell carries the 24LC1025 from Microchip, which is a single I2C 1024Kbit serial EEPROM, which is quite appealing (memory: the more the merrier!).

Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html

Go Up