kheyer
Posts: 5
Joined: Mon Jul 08, 2019 8:23 pm

Micro/type-c USB power supplies immunity to backpowering validity/proof

Mon Jul 08, 2019 8:32 pm

Hi,

The pi 3b+ has the diode protection removed and the design guide (https://github.com/raspberrypi/hats/blo ... gnguide.md) states that:

"The micro-USB input on a Pi is expected to / almost universally is driven by a power source which does not sink current..."

They provide no additional information proving their validity and I have been unable to confirm this myself through the USB specifications.

Can anyone prove their assumption? Or disprove?

Thanks

User avatar
Burngate
Posts: 5932
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Tue Jul 09, 2019 9:50 am

In full, the paragraph reads:
NOTE that the Raspberry Pi 3B+ and Pi Zero and ZeroW do not include an input ZVD. The micro-USB input on a Pi is expected to / almost universally is driven by a power source which does not sink current, i.e. it will not try to actively pull down a voltage higher than its regulated voltage. If a HAT back-powers a Pi and uses a power source that does not try to sink current (and will safely stop/pause regulation if its input voltage is higher than its regulation voltage) it is OK to not include a ZVD on a HAT. If you are unsure or don't know then please include the ZVD! The HAT designer is responsible for the safety of their product.
So this question isn't really about the Pi itself - rather it's about whatever power supply is connected to the Pi.

"is expected to" means they designed the Pi that way - no further explanation required.
"almost universally is" can only mean that (a) the official PSUs, including the PoE HAT, comply with this, and (b) they haven't yet come across a readily-available supply that doesn't comply.

It doesn't mean I couldn't design a supply that does sink current - a shunt regulator using a 1N5338BG would do this quite happily.
It only means nobody in their right mind would do it.

kheyer
Posts: 5
Joined: Mon Jul 08, 2019 8:23 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Tue Jul 09, 2019 4:43 pm

Sure, but if I am going to design an external regulator capable of sourcing 3A onto 5V rail I would expect a more definitive answer than hopefully.

If the only concrete protection between the two sources is a polyfuse and a zener, neither have a hope of preventing the external power supply from sourcing current into a micro/type-c USB power supply.

Sorry, but I cannot design a sell-able product hoping that customers do not cheap out on a micro/type-c USB power supply :/

User avatar
Burngate
Posts: 5932
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Tue Jul 09, 2019 5:10 pm

I'm not sure I understand - are you designing (for sale) a power supply, or a device that needs a power supply?

If you're designing a power supply, then it seems obvious - make sure it won't sink current if another supply is connected to it, by building in an ideal diode or by any other means you wish.

If you're designing a device (such as the Pi itself, or a HAT or any other goody that can be attached to the Pi) and that device could have more than one supply attached - that is true of the Pi itself since power can be fed into it by any of several routes - then at the end of the day you're going to have to rely on your customers not doing stupid things, such as connecting a car battery to a micro-USB socket.

If you're looking for more certainty, perhaps you're trying to guard against being taken to court. If so you need a lawyer, not an electronics man.

kheyer
Posts: 5
Joined: Mon Jul 08, 2019 8:23 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Tue Jul 09, 2019 5:34 pm

I am designing a hat which can power the pi and also have deal with the pi potentially being connected to a power supply through the micro USB connector simultaneously.

You make it sound like all power supplies cannot sink current. It makes sense for a micro USB power supply to have a diode in series, but it is an easy way to cut costs just as what has been done with the Pi. So how can you guarantee that a power supply manufacturer does not have the same idea and removes its diode for cost savings and expecting the sink to have a diode?

Is there a specification requiring USB power supplies to have a diode in series? If so, I have been unable to find a USB specification that requires a diode.

User avatar
Burngate
Posts: 5932
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Tue Jul 09, 2019 6:21 pm

If you have been unable to find a USB specification that requires a diode, then assume it's not in the spec.
And I agree - manufacturers are quite likely to cut costs where they can.

If you're worried, then put your own ideal diode on your board - better safe than sorry, and also cheaper than a lawyer.

kheyer
Posts: 5
Joined: Mon Jul 08, 2019 8:23 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Tue Jul 09, 2019 6:30 pm

I can and will put a diode on the power supply I add but you cannot just add a diode for the micro USB without modifying the Pi PCBA itself.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23079
Joined: Sat Jul 30, 2011 7:41 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Wed Jul 10, 2019 8:34 am

I've spoken to one of our HW guys, and he is not entirely sure what is being asked for here. Can the OP explain things in a little more detail please.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Dave 2019
Posts: 1
Joined: Tue Jul 09, 2019 10:36 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Wed Jul 10, 2019 8:43 am

When something is designed to be idiot proof .... God designs a better idiot

drgeoff
Posts: 9606
Joined: Wed Jan 25, 2012 6:39 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Wed Jul 10, 2019 8:58 am

The OP is designing a HAT which, among other capabilities, can power a RPi. He is concerned about what happens if the RPi also has a PSU (any make and model) plugged in to the micro-USB socket.

James Adams
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 117
Joined: Wed Mar 19, 2014 2:58 pm
Location: Cambridge

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Wed Jul 10, 2019 9:21 am

The structure of flyback AC-DC PSUs (wall-wart type) means they generally don't (can't) sink current.

As long as your HAT does not sink current and will stop sourcing current when its output voltage is at the regulated set point (5V) or higher it should not 'fight' with any accidentally plugged in USB-C supply (most buck or flyback controllers should be fine here - though some controllers do try and clamp the output voltage if too high so YMMV).

I would still state clearly that the user should only plug in one power source at any one time, and it is your responsibility to design it properly, test it and make sure it is safe to your satisfaction.
James Adams
Raspberry Pi - COO & Hardware Lead

Heater
Posts: 12969
Joined: Tue Jul 17, 2012 3:02 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Wed Jul 10, 2019 9:41 am

Dave2019,
When something is designed to be idiot proof .... God designs a better idiot
Funny you should say that...

I once connected a Pi to a non-USB power supply via a USB cable that I had cut the "big end" off.

One day the supply was inadvertently switched to 12v. Smoke came out of the Pi. The protection diode jumped off the board!

Thus protecting the Pi, which amazingly still worked when the supply was set back to 5v.

Until I did it the second time...


kheyer
Posts: 5
Joined: Mon Jul 08, 2019 8:23 pm

Re: Micro/type-c USB power supplies immunity to backpowering validity/proof

Wed Jul 10, 2019 3:54 pm

That does not fix the issue. If you were to mux the two on a hat you would always need the micro USB powered to have the processor powered.

Return to “General discussion”