Author Topic: Switching USB power  (Read 1003 times)

0 Members and 1 Guest are viewing this topic.

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1690
  • Country: gb
Switching USB power
« on: March 29, 2022, 08:05:24 pm »
I'm building a USB multiplexer  - 1:2 - using one of those neat TS3USB221 boards, using that for the signals, but switching power between the two outputs seperately. 

It's mostly for developing custom USB devices that require frequent "unplugging" for testing, and dealing with the Arduinos (uno, pro micro etc..).  Essentially emulating plugging/unplugging USB cables, but with two channels with two different connectors (micro B + B).
I originally just thought as host has a fuse and over current protection, I could just use low VGS P channel MOSFETs to connect the 5V lines without any additional protection, but then I realise the body diode could possibly allow back feed into the USB input if a device is plugged in and providing its own power - unlikely I know, I generally have these things powered from the USB input.

Am I over thinking this? Would back-to-back P-channels on the input be a wise choice to prevent this?
 

Offline pigrew

  • Frequent Contributor
  • **
  • Posts: 680
  • Country: us
Re: Switching USB power
« Reply #1 on: March 29, 2022, 08:42:03 pm »
Most USB hosts will have a polyfuse on the Vbus line, but it's better not to depend on it. Some have more fancy detection of overcurrent (based on what limit the device requests).

The two pFETs would be a good idea.

Instead of a FET, I'd likely use a "load switch" IC which integrates everything together, even with OCP and fault detection. TI TPS2051BQDRQ1 would be one example
 
The following users thanked this post: Buriedcode

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1690
  • Country: gb
Re: Switching USB power
« Reply #2 on: March 29, 2022, 09:26:26 pm »
Most USB hosts will have a polyfuse on the Vbus line, but it's better not to depend on it. Some have more fancy detection of overcurrent (based on what limit the device requests).

The two pFETs would be a good idea.

Instead of a FET, I'd likely use a "load switch" IC which integrates everything together, even with OCP and fault detection. TI TPS2051BQDRQ1 would be one example

Thanks for the reply.

Yeah I've seen a few of those - and plenty come with two channels, which could save board space.  The only thing that steered me away from those was potential on resistance - I'm assuming that the host has one of these as well, so two in series, with a reasonable, say 300mA load might cause the VBUS to sag.  However, as I'm over-engineering this (personal project, not work!) it's probably a good idea.

I just did a quick google on the sort of on-resistance these USB load switches have.  Seems 100mOhm is in the max, which would mean - for 500mA max load, 50mV, which is fine.  I have some old laptop motherboards that I'm sure have a few of these on board so I'll do some testing. Cheers!  :-+
 

Offline pigrew

  • Frequent Contributor
  • **
  • Posts: 680
  • Country: us
Re: Switching USB power
« Reply #3 on: March 30, 2022, 06:41:37 pm »
I just did a quick google on the sort of on-resistance these USB load switches have.  Seems 100mOhm is in the max, which would mean - for 500mA max load, 50mV, which is fine.  I have some old laptop motherboards that I'm sure have a few of these on board so I'll do some testing. Cheers!  :-+

My feeling is that switches are designed to have voltage drops of 50 to 100 mV for this reason. Higher current load switches will often have lower R_DS,on FETs to maintain the voltage drop requirement.

Also, keep in mind that USB applications will have hot-plugs and moderate capacitive loads (1 to 10 uF is allowed), so soft-start in the load switch is very desirable. The upstream port must have >=120uF. I think the 120 uF can be split between the two sides of the load switch.
 
The following users thanked this post: Buriedcode

Offline BuriedcodeTopic starter

  • Super Contributor
  • ***
  • Posts: 1690
  • Country: gb
Re: Switching USB power
« Reply #4 on: April 03, 2022, 03:03:49 am »
Thanks once again.

I found a TPS2062 and a G546B2 (same pinout as the texas part, but the datasheet looks sketchy).  After going through the datasheets I noticed they do indeed mention soft start, as well as capactive loads - so it looks like these are definately handy, and of course, they are made specifically for this purpose. 

As with many projects, I get bogged down with "what if..." questions, and this one is no exception.  Especially as I'll have powered connectors flapping about in the breeze, and no doubt I'll probably plug this is to something that is already powered.  I can't think of every scenariowhere it can go wrong, but hopefully dedicated power switches will solve a few of the potential pitfalls.  I'll put one on an adapter and test its short circuit behaviour.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf