Pages: [1]   Go Down
Author Topic: Feeding DS1337 with Arduino +5V and having battery backup  (Read 2258 times)
0 Members and 1 Guest are viewing this topic.
BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11694
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

[ I won't respond to messages, use the forum please ]

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1643
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)



* drawing.jpg (18.17 KB, 555x291 - viewed 116 times.)
« Last Edit: August 29, 2012, 01:22:09 pm by pwillard » Logged

Worcester, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

@petethegeek
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!).

Logged

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

Worcester, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

I can understand your concern. In my case this isn't an issue as the datasheet for the PCF8563 claims that the clock will continue to operate all the way down to 1v.

Logged

BHZ, MG, Brazil
Offline Offline
Sr. Member
****
Karma: 10
Posts: 346
Android developer; Arduino enthusiast
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I played with the diodes idea last night.

Is it my measurements or do 1N4148 have a much higher voltage drop than a 1N4002? Shouldn't they all be 0.7V ?
Logged

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

Pages: [1]   Go Up
Jump to: