2
\$\begingroup\$

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

\$\endgroup\$
2
\$\begingroup\$

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).

\$\endgroup\$
  • \$\begingroup\$ I'm a little bit late, but if you aren't using the third channel, I recommend using the LTC4418, which is the two-channel equivalent. \$\endgroup\$ – BB ON Apr 2 at 18:31
0
\$\begingroup\$

Almost, except that it could violate the part of the USB spec about never, ever backpowering the bus for any reason at all, ever. (emphasis added, but you get the point) There's a potential path from the 12V battery, through Q1 and R2, into the USB plug. I don't know what happens if you do backpower it, but my suspicion is that the host side can't absorb energy (it's cheaper to make that way) and so you could end up with a local USB system that runs on anything from 5V to 12V depending on R2 and whatever else is plugged into other USB ports. 5V devices generally don't like 12V, by the way. :-)

Two ways you could solve this are:

  1. Add a buffer / level-shifter between the USB power and the battery shutoff. A diode won't do what you want because of the 5V-MCU-driving-12V-motor problem that shows up in probably hundreds of questions by now.
  2. Use some spare I/O if you have it, and do this job in software.
\$\endgroup\$
-1
\$\begingroup\$

The easiest way is to use a Schottky diode on each input, so you are OR'ing the power inputs. The output of this feeds an LDO, which then feeds your MCU. Make sure that the LDO can take as input any voltage which you may encounter.

schematic

simulate this circuit – Schematic created using CircuitLab Note that this schematic omits the LDO ground connection, and the diode types are not correct. First time using CircuitLab.

An example of a Schottky that I've used is Diodes Inc B320-13-F, it has a Vf of 0.39V @ 1.0A. But any will do. A cheap LDO is the TI LP2992, or the TI TLV1117-33. But the TLV part has a much higher dropout voltage. There are many of each, but at least these will point you in the right direction.

\$\endgroup\$
  • \$\begingroup\$ This doesn't work for a battery > 5V. USB power needs priority \$\endgroup\$ – Scott Seidman Mar 23 '15 at 12:41
  • \$\begingroup\$ VCC_USB is 5V; VCC_BATTERY is typically 3V-3.6V. So USB will take priority as long as VCC_USB > (VCC_BATTERY + Vf of D1) \$\endgroup\$ – Fix It Until It's Broken Mar 24 '15 at 16:41
  • 1
    \$\begingroup\$ The secondary supply has been specified to be 3V-12V \$\endgroup\$ – Scott Seidman Mar 24 '15 at 20:11

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.