0
\$\begingroup\$

I think this a simple question but I can't find the answer ! I try but ... that don't came out !

I have an USB connector. In one case, I want to powering myself with my batterie (if I use it with a device and I'm the host). In the other case, I will have Vbus powering by an external host (so I want to cut the power by the battery) -> So the schematic case

I don't want to use a power switch CI.

I found a solution with a simple diode but I lose some voltage power ... I wanted to use a Mosfet for switching power. I can command this mosfet with an MCU. So when I detect vbus power 5V, I cut the battery power ...

How i can do this with a mosfet ? (P or N ...) ?

schematic

simulate this circuit – Schematic created using CircuitLab

Thanks you very much

\$\endgroup\$
  • \$\begingroup\$ What are the specs of your battery (voltage range, chemistry)? What is the minimum acceptable voltage when switching between power supplies? \$\endgroup\$ – Bruce Abbott Feb 16 '18 at 11:04
  • \$\begingroup\$ This is AA, I have 4.5 Voltage. I don't understand the second question ... In my case, I just want to power USB when a device is connected and if I have a host, the Vbus will be powered by the host (so I need to cutoff Vbat). And, I know this is not enough for USB power but I will add a booster to made a 5V ... \$\endgroup\$ – user1568445 Feb 16 '18 at 11:36
  • \$\begingroup\$ To avoid a short between the two power supplies there must be a small time period during switch-over when neither supply is switched in. Knowing how low the voltage can go during this time may help to optimize the circuit. \$\endgroup\$ – Bruce Abbott Feb 16 '18 at 13:44
  • \$\begingroup\$ Ok I think it's 3.3, the voltage for the MCU. \$\endgroup\$ – user1568445 Feb 16 '18 at 14:08
  • \$\begingroup\$ the simplest is going to be a high-side reed relay and a buffer cap. mosfets will require a lot of support circuitry since you probably want a common ground. \$\endgroup\$ – dandavis Feb 16 '18 at 16:28
0
\$\begingroup\$

You can eliminate the diode voltage drop using a P-channel MOSFET, but there are some subtleties that could catch you out:-

  1. The MOSFET has an internal 'body' diode connected between the Source and Drain. This can perform the same function as your diode, but to get the diode pointing in the right direction the Drain/Source polarity must be reversed.

  2. If the MCU only outputs 3.3V then the MOSFET's Gate voltage must be raised up to meet the Source voltage. This level shifting can be done with another FET or bipolar transistor, which can also conveniently invert the signal so the FET turns on when the MCU's digital output is high.

The circuit looks like this:-

schematic

simulate this circuit – Schematic created using CircuitLab

So far so good. However this scheme has a problem - if external USB power is applied while the FET is turned on then current will flow from the USB port into the battery until the MCU switches the FET off. Also the difference between internal and external USB power is then quite small (~4.5V vs 5V) so the MCU might have trouble determining when external USB power is present.

If you add a booster to get 5V from the battery then the voltage difference could be so small that it is impossible to tell whether external power is present. One solution might be to feed both battery and USB power through the booster, with diodes in series with each source to isolate them from each other. You can then measure USB input voltage without interference from the battery, while the booster produces a full +5V from both power sources.

schematic

simulate this circuit

In this scheme you would have one USB port to get power from as a device, and another to put power onto as a host. If you want to do both jobs with a single USB port then you are creating something similar to USB On-The-Go, so it might be easier to use a dedicated OTG controller chip.

\$\endgroup\$

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.