EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: Matir on May 06, 2017, 09:59:51 pm

Title: Powered from "wall wart" or USB?
Post by: Matir on May 06, 2017, 09:59:51 pm
How do devices that can be powered either from a wall wart or from USB work to avoid feeding power back to the USB host?  Take a powered USB hub for example -- many will operate with just the USB input, but can also take a "wall wart" SMPS to provide higher current supplies.  While super cheap ones just tie the two +5V lines together, I imagine there's a more proper way to do this.  Obviously, 2 diodes would work, but then you have a diode voltage drop, which isn't really usable to power USB from USB.
Title: Re: Powered from "wall wart" or USB?
Post by: testian on May 06, 2017, 10:10:04 pm
I haven't looked into one but it should be possible with mosfets like in reverse polarity protections.
Title: Re: Powered from "wall wart" or USB?
Post by: jeroen79 on May 06, 2017, 10:16:12 pm
You can get connectors with a built in NC switch that is connected to the USB 5V.
When the connector is inserted it will disconnect the USB power and take power from the external source.
Title: Re: Powered from "wall wart" or USB?
Post by: mariush on May 06, 2017, 10:20:15 pm
Most just do two diodes.
Some probably could have a circuit which which is powered from the smps side, disconnects the usb side and connect the smps side with some mosfets or something like that.
Look into ideal diode controllers or something like that.
Title: Re: Powered from "wall wart" or USB?
Post by: Zero999 on May 06, 2017, 10:37:54 pm
How do devices that can be powered either from a wall wart or from USB work to avoid feeding power back to the USB host?  Take a powered USB hub for example -- many will operate with just the USB input, but can also take a "wall wart" SMPS to provide higher current supplies.  While super cheap ones just tie the two +5V lines together, I imagine there's a more proper way to do this.  Obviously, 2 diodes would work, but then you have a diode voltage drop, which isn't really usable to power USB from USB.
USB sockets always supply power and plugs draw power. I've never seen a device with more than one USB plug before, so that situation doesn't arise.

Normally the "wall wart" used to power something like that has a USB socket which the device connects to so you either use that or a USB socket on another device.
Title: Re: Powered from "wall wart" or USB?
Post by: Matir on May 06, 2017, 10:45:55 pm
How do devices that can be powered either from a wall wart or from USB work to avoid feeding power back to the USB host?  Take a powered USB hub for example -- many will operate with just the USB input, but can also take a "wall wart" SMPS to provide higher current supplies.  While super cheap ones just tie the two +5V lines together, I imagine there's a more proper way to do this.  Obviously, 2 diodes would work, but then you have a diode voltage drop, which isn't really usable to power USB from USB.
USB sockets always supply power and plugs draw power. I've never seen a device with more than one USB plug before, so that situation doesn't arise.

Normally the "wall wart" used to power something like that has a USB socket which the device connects to so you either use that or a USB socket on another device.

So say you have this USB hub:

(https://i.stack.imgur.com/Hkqy8.jpg)

It has both a USB input that supplies +5v, and a power brick that can supply +5V.  This is the two-source situation I'm describing.
Title: Re: Powered from "wall wart" or USB?
Post by: Matir on May 06, 2017, 10:47:54 pm
Most just do two diodes.
Some probably could have a circuit which which is powered from the smps side, disconnects the usb side and connect the smps side with some mosfets or something like that.
Look into ideal diode controllers or something like that.

How can you power a downstream device after the diode drops?  At the input to hub you're getting 5V on a good day, after a diode drop, what, about 4.7 if you're bothering with Schottky diodes?  Add in USB cables and you have a lot of loss...
Title: Re: Powered from "wall wart" or USB?
Post by: Zero999 on May 06, 2017, 11:01:18 pm
How do devices that can be powered either from a wall wart or from USB work to avoid feeding power back to the USB host?  Take a powered USB hub for example -- many will operate with just the USB input, but can also take a "wall wart" SMPS to provide higher current supplies.  While super cheap ones just tie the two +5V lines together, I imagine there's a more proper way to do this.  Obviously, 2 diodes would work, but then you have a diode voltage drop, which isn't really usable to power USB from USB.
USB sockets always supply power and plugs draw power. I've never seen a device with more than one USB plug before, so that situation doesn't arise.

Normally the "wall wart" used to power something like that has a USB socket which the device connects to so you either use that or a USB socket on another device.

So say you have this USB hub:

(https://i.stack.imgur.com/Hkqy8.jpg)

It has both a USB input that supplies +5v, and a power brick that can supply +5V.  This is the two-source situation I'm describing.
What sort of connector does the power brick have? Do you have a picture of said connector?
Title: Re: Powered from "wall wart" or USB?
Post by: Matir on May 06, 2017, 11:07:36 pm
What sort of connector does the power brick have? Do you have a picture of said connector?

Not for this particular one, but all the ones I have seen have a plain barrel connector (often a typical 5.5 x 2.1mm, or sometimes a very small one).
Title: Re: Powered from "wall wart" or USB?
Post by: KE5FX on May 06, 2017, 11:10:53 pm
You typically use a MOSFET with a suitably low Ron. 

On the demand side, it's a mistake to think of USB as a "5V" source.  You need to assume you might get as little as 4.3 to 4.5V from anything associated with USB.  Boost or SEPIC regulators can be helpful to avoid brownout problems.

Title: Re: Powered from "wall wart" or USB?
Post by: Zero999 on May 06, 2017, 11:27:48 pm
What sort of connector does the power brick have? Do you have a picture of said connector?

Not for this particular one, but all the ones I have seen have a plain barrel connector (often a typical 5.5 x 2.1mm, or sometimes a very small one).
I haven't seen that before.

What voltage is the power brick? It wouldn't surprise me if it has a higher output voltage than 5V.
Title: Re: Powered from "wall wart" or USB?
Post by: sleemanj on May 07, 2017, 12:54:24 am
So say you have this USB hub:

(https://i.stack.imgur.com/Hkqy8.jpg)

It has both a USB input that supplies +5v, and a power brick that can supply +5V.  This is the two-source situation I'm describing.

If it's a cheap chinese hub, the external input will probably be directly connected with no provision for preventing backfeed.  I also suspect it's not really an issue, as long as you don't accidentally shove >5v into it's power.

In any case, this is one of those problems that sounds like it should have a really simple solution... but in practice it's really tricky (if you can't just use a diode and live with it's forward voltage and dissipation) for all sorts of reasons.

There are dedicated power management IC for this sort of job, eg TPS2115PW (no particular experience or reason for citing that one, just the first that I picked off the category list at RS).

Title: Re: Powered from "wall wart" or USB?
Post by: Matir on May 08, 2017, 04:59:38 am
For anyone following along, I happened to watch EEVBlog #643 tonight and discovered the TI TPS2113A, which is an "Autoswitching Power Mux".  This does exactly what I described (seamlessly switch between power inputs without backfeeding) and has an rDS (on) of ~84 mOhm.  At 1 A, that's a tiny .08V, instead of the (comparatively) massive voltage drop of a diode.