0
\$\begingroup\$

I'm trying to design a circuit to switch power supply from USB +5V to battery when the USB is disconnected. This circuit will power a WeMos D1 mini board, which needs a 3.3V input voltage, so the USB 5V voltage is converted to 3.3V through a LDO regulator, while battery voltage is already 3.3V.

I'm trying to select the power source through a FDN340P p-mosfet, like in the diagram below, but it doesn't work because when USB is disconnected, and the battery power is applied to Vcc, it goes backwards into the voltage regulator and Vin rises to 3V, switching off the p-mosfet.enter image description here

I've tried also putting a 1N4004 diode between Vin and the mosfet gate, but voltage doesn't drop across the diode (probably because current is too low?).

How can I keep the mosfet switched on when USB is disconnected?

\$\endgroup\$
  • \$\begingroup\$ The Vcc is the output pin, not to connect the battery on it. \$\endgroup\$ – Marko Buršič May 28 '17 at 19:46
0
\$\begingroup\$

Your MOSFET turns off becuase the battery voltage goes somehow from the out of the LDO to its input.

There are dedicated power path ICs that you can use. But if you want to learn a bit, and I am just guessing after a fast sketch, you can start with a couple of N channel MOSFETs used in a back-to-back configuration in series to the OUT pin of the LDO. Their gate, tied toghether, are connected to the input of the LDO, which is always higher then 3.3V by 5V-3.3V. If you can find a NMOS with a Vth less than such value, you can verify if it is a working solution.

I would use a back to back PMOS or something else also for the battery switch, because I suspect that its parasitic diode will let some current flow in the battery when it is discharged and below 3.3V. I have no clue if it is fine/safe, and works always fine in this way.

\$\endgroup\$
0
\$\begingroup\$

You need an LDO with reverse current protection such as the MIC5225 (example only). See the reverse current rating on page 5 when EN is low. Note that they show values for grounded and disconnected VIN. You will need to find an LDO that matches your other specifications with the same reverse current protection feature.

\$\endgroup\$
  • \$\begingroup\$ Thank you, this is interesting to know. Unfortunately I cannot substitute the LDO because it is part of the WeMos board. \$\endgroup\$ – Emanuele Jun 27 '17 at 18:14

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.