How to automatic switch over voltage sources for RTC

Hi all,

I am trying to make a RTC backup voltage switcher (since my RTC ic does not have a separate pin for this).
Under normal conditions, the RTC is powered by 3.3V coming from an LDO (powered from battery or usb)
Under backup conditions, the power source is the battery (lipo 3,5 - 4,2V).

I need a circuit to SWITCH OFF the battery power from the RTC when the LDO gives 3.3V output.

Using two diodes won’t work here because these will pass the HIGHEST voltage to the RTC, and I need it to pass the 3.3V when it is available (the lowest voltage of the two in this case).

I thought I was smart and use a P-MOSFET to switch off the batt power when a voltage was applied to the gate from the 3.3 LDO.
BUT unfortunately, the mosfet will only switch off when the same or higher voltage is applied to the gate as the drain-source voltage (which is unfortunately the battery at 3.5-4,2V).
So this circuit below always provides the batt power to the RTC.

Can anyone help me out on how to make this switch over work?

Note: I could just power the RTC on +batt, and it would work, but the problem is that the battery includes a charging circuit and then this charging power is powering the RTC also (4,2V) which might mess up the measurements for the charger.

For next time I would totally order an RTC which comes with a BATT pin as standard, makes things a lot easier.

I am currently prototyping with ISL1208, a PCF8523 should also work, and classic DS1307, DS1339 as well.

For your mosfet, I’m not sure if you’ve wired it the wrong way, you can see that the body diode is currently oriented to allow current through. Normally source pin (pretty sure pin 2 on AO3401) would be facing the supply voltage.

Hi Ivo,
Thank you for your reply!
The diode inside the mosfet is used to block currents flowing back to the battery.
This circuit is better explained here:

Yes, using a different RTC would have made life easier. However, this one was really really cheap and has an integrated xtal.

I ended up not using the 3.3V to switch off the batt from the RTC, but the USB line.
So in my case, it is switched off when USB is plugged in and charging the battery. At that time a LDO is providing 3.3V (from USB source) to the RTC.

When USB is unplugged, the RTC is powered directly by battery. Not ideal, but it works.

I will have a look at your recommended RTC’s

Your circuit, though, is not that circuit. That circuit is using the body diode, in forward bias, purposefully, as a small-Vf-drop diode to prevent reverse polarity conditions. The mosfet there, is never designed to switch on and off, it always lets current through (When power is wired correctly).

What’s your problem? The mosfet is always letting current through…

In your circuit you are using the mosfet to switch on and off access to the BATT line. So you do not want a mosfet that always lets current through. Hence turning it the other way so it acts properly as a switch. Or heck, you could have two. One as the switch, one as the reverse polarity protection.

Additionally, your StackOverflow says:

It will NOT protect against the load pushing current back towards the source like a real diode will. That requires additional circuitry to accompany the PMOS.

You were saying you wanted this to block current flowing back into the battery? xD It probably does a good enough job, but not as good as a diode, for your case.

1 Like