Electronic – Switching between power supplies – USB dominant

power supplyusb

I'm trying to create a data logger. I want the data logger to be able to run in 2 modes.

  1. Bench mode (usb powered 5V)
  2. Field mode (externally powered 3.3 – 12V)

Bench mode is active whenever power is supplied to the usb port. In the other case Field mode is active. i want this because the data logger will be used in battery powered projects and i don't want the data logger to leech from the host project if it can get it's power from usb.

So basically i want to create a power multiplexer that switches the external power supply off whenever usb power is supplied.

The datasheet of the micro controller I'm planning to use gave the following schematic.

USB dual power, self power dominant

The working thou is exactly opposite of what i had in mind. So i tried to adjust it.
I know this should work as long as the external power supply is lower the 6-7V, but what about higher voltages?

schematic

simulate this circuit – Schematic created using CircuitLab
Note: Only an example.

Either configuration should have an as low as possible current consumption, and a small footprint.

I have seen a lot of topics related to this but they haven't given me the answer how to do it.

so my question(s):

  1. Is it possible?
  2. How can i switch off a 3.3V – 12V power supply using USB power supply.
  3. How to determine needed resistor / capacitor values.
  4. Which parts would you recommend.

New Edit

thou ORing is an option it doesn't prevent my circuit (behind the LDO) to leech from the host project.

I also understand the restrictions set by the usb standard.

i probably should use mosfets instead of BJT's but i wonder if this would work.

schematic

simulate this circuit

Best Answer

If you don't mind sourcing and using a dedicated IC for the task and are willing to sacrifice a bit of board space, you can put a LTC4417 to work at this job, along the lines of the circuit below. You'll have to tweak the values to fit, though: I did a "rough cut" at the datasheet procedure for applying this chip, but you'll want to go through the datasheet application procedure yourself to make sure you're getting things like inrush currents and voltage rail droop right.

schematic

simulate this circuit – Schematic created using CircuitLab

The good news with this solution is that you can't do something silly with it inadvertently, like backpower the USB port, and it takes care of all that prioritization business for you (the IC always prioritizes V1 over V2 when both are functioning).