USB Hub Power Selector Design Advice Needed - Page 1
Forum section: electronics / projects

author: elmood
author_rank: Regular Contributor
timestamp: January 23, 2021, 10:33:37 pm
content: Hey folks, I'm working on a USB hub design for an embedded project. It can either be bus powered or self-powered. In either case the input voltage is 5V.I've checked a lot of reference designs from hub IC manufacturers and haven't found a good example of proper power switching to prevent back-feeding through the upstream USB port. In my search I've found many end-users complaining of upstream backfeeding damaging their computers.With the same voltage on both the powered and upstream ports there doesn't seem to be an easy way to detect which connector is powered. I've looked at using back-to-back P-MOSFETs to make a load disconnect without backfeed. But the issue remains that once the internal 5V rail is powered, it's not possible to know where the power is coming from. Diodes of course are not the answer because the full input voltage is needed for the downstream ports.The only thing I can think of is to use a higher input voltage on the external DC port, and then just use a local buck regulator... it would be easy then to detect the buck input voltage and just disconnect the upstream VBUS in that case. But I would prefer the external DC port to just be a second USB socket for a number of reasons.Does anyone know of a better way?Thanks!

author: jan28
author_rank: Contributor
timestamp: January 23, 2021, 10:55:10 pm
content: I recently had almost the same problem: switch between 2 possible power sources and avoid feedback.I worked it out with 2 P channel mosfets AND a comparator to explicitly switch between one of the sources:- The comparator pulls the gate of 1 the mosfets to gnd to open it (and the inverse used for the other MOSFET).- To avoid oscillation at crossover I added a postitive feedback to give the comparator a little hysteresis.- Power-up works thru the body diodes of the mosfets. Once the comparator powers up, the MOSFET goes open completely eliminating the body diode drop.- Everything is pull-down with pull up resistors to facilitate power up.In my case power was not very important and I used component I had laying around: 10k resistors and I thing an LM393 (second comparator used as inventor for the second MOSFET). If I remember correctly the circuit draws around 1-2 mA at 5V due toe the 10k pull down resistor and voltage dividers needed to drive the comparator inputs.It worked on the breadboard, still need to do some edge case testing on it. Let me know if you’re interested in a circuit diagram. Don’t have it at hand now.Jan

author: PeteH
author_rank: Unknown
timestamp: January 23, 2021, 11:07:29 pm
content: You can get power path priority mux ICs that do this. Or ideal diodes...

author: jan28
author_rank: Contributor
timestamp: January 24, 2021, 12:26:58 pm
content: PeteH,You're right. I was following the DIY path.@all,In this context the following TI application note might be useful:https://www.ti.com/lit/an/slvae57/slvae57.pdfI think it give a nice overview.

author: PeteH
author_rank: Unknown
timestamp: January 24, 2021, 01:20:34 pm
content: TPS2110 family was my first thought.Depends whether you're up for learning/saving cost or just want something that works. Usually more rewarding to roll your own solution for DIY or cost (depends on volume, NRE vs BOM costs)

author: elmood
author_rank: Regular Contributor
timestamp: January 24, 2021, 08:04:19 pm
content: Thanks for the suggestions. I definitely prefer to choose the DIY path in this particular case. When there are lots of possible substitutes / jellybean parts I just go with those. But I've been burned before choosing something special and then being stuck when it's not available.