5
\$\begingroup\$

I want to add a LiPo rechargeable battery backup to an existing RTC circuit, but I can't alter the preexisting circuit. Basically, the regulator, D2 and RTC (Existing Circuit) are all fixed and can not be reconfigured. All I have to work with is a power and ground connection which I can get 5V-Vf(diode) from. Obviously a diode, as shown, isn't enough, since the battery will also supply the charger when the supply is off:

schematic

simulate this circuit – Schematic created using CircuitLab

I know this can be done with a MOSFET, but unfortunately my theory there is a bit weak still. What type of MOSFET would I need and how would I hook it up? (Or if you have a good idea for which charger IC can feed power back, that would be welcome as well.)


A bit of detail for the curious/if required: This will be attached to a M68HC11EVBU (yes yes, you can stop laughing) on P3 to supply power to the onboard MC68HC68T1. I will put a diode at D3 and cut the trace but solder a wire at D4 so that power can get to the circuit in question. Section 6.4 of the EVBU datasheet has the schematic; the supply is on the first page of figure 6-2 (page 98), and the RTC is on the third page (page 100).

\$\endgroup\$
  • \$\begingroup\$ If you are soldering wires in and cutting traces, why not connect the charger's vin prior to d2 instead? Problem solved. i.stack.imgur.com/6neij.png \$\endgroup\$ – Passerby Aug 22 '13 at 6:27
  • 1
    \$\begingroup\$ 1) I'm trying to work with the device's design as much as possible. 2) I feel that having a solution which is generalized as much as possible can benefit others in the future as well. \$\endgroup\$ – Ignacio Vazquez-Abrams Aug 22 '13 at 6:29
  • \$\begingroup\$ @Passerby, that's exactly what my initial answer was, but after Ignacio's points above, I altered it to its present state. \$\endgroup\$ – travisbartley Aug 22 '13 at 6:55
  • \$\begingroup\$ We would have really laughed if you were using an HC12 instead of the HC11. \$\endgroup\$ – Johan.A Aug 22 '13 at 7:31
7
\$\begingroup\$

The problem with the original schematic, as you know, is that when the supply is removed, the charger is still being powered by the battery itself! So when the system is running on battery power, it constantly drains itself by attempting to charge itself. To remedy this, we should not supply power to the charger from the battery.

One way to do this, like you suggest, is to use a power FET to gate off the power supply from the charger. The challenge comes in with the fact that we can't reconfigure the preexisting circuit. So we need both the battery and the regulator to be able to power the same node, VSTABLE, but we need to gate power from the charger when the regulator is off. One way we can know whether the regulator is on or off is by the voltage of VSTABLE. As you specified, the supply voltage is 5V, and the battery is 3.7V, so we can use a voltage comparator to indicate if VSTABLE is closer to 5V or 3.7V. If it is closer to 5V, we know the regulator is powering the circuit and we should power the charger as well. If VSTABLE is closer the 3.7V, we assume the regulator is powered down, and we gate off the charger with our power FET, M1:

schematic

simulate this circuit – Schematic created using CircuitLab

The comparator voltage, 4.35V is based on a 0V voltage drop across the diode. If the voltage drop from the diodes is 0.7V, for example, the comparator voltage should be 3.65V instead.

General case

The above should work well for your situation. However, what if the external power supply and the battery were the same voltage? In this case, using a voltage comparator won't work. We need to add some signal to indicate if the regulator is active. Lets call this signal RGOODN, and say that RGOODN is low when the regulator is on, and high when the regulator is off:

schematic

simulate this circuit

RGOODN could be generated from a jumper, switch, circuit, etc. It is up to the designer to figure out how to generate the signal.

\$\endgroup\$
  • \$\begingroup\$ Excellent, this is certainly workable. And I can pass the battery to the inverting input of the comparator. Can I power it from the source of the MOSFET though? \$\endgroup\$ – Ignacio Vazquez-Abrams Aug 22 '13 at 3:49
  • \$\begingroup\$ @IgnacioVazquez-Abrams Yeah I think you are right. I don't quite catch your question though. Power what from the source of the PFET? \$\endgroup\$ – travisbartley Aug 22 '13 at 4:01
  • \$\begingroup\$ The comparator itself, if using something like a LM311. \$\endgroup\$ – Ignacio Vazquez-Abrams Aug 22 '13 at 4:05
  • \$\begingroup\$ @IgnacioVazquez-Abrams it should work, as long as your comparator can handle the power supply voltage range of 3.7-Vdiode to 5-Vdiode. It looks like LM311 needs a 5V supply, so it might not work over your whole operating range. It has to be a comparator that can operate in roughly the 3-5V range. \$\endgroup\$ – travisbartley Aug 22 '13 at 4:15
  • 1
    \$\begingroup\$ As a bonus, some regulators can generate RGOODN themselves. \$\endgroup\$ – Ignacio Vazquez-Abrams Aug 22 '13 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.