Go Down

Topic: [Solved]Why is it safe to drive 5V into the output of the NCP1117ST50 (Read 341 times) previous topic - next topic

sterretje

Jun 02, 2019, 11:15 am Last Edit: Jun 03, 2019, 05:49 am by sterretje Reason: Marked as solved; had to modify title to fit
I'm a cautious person ( at times ;) ) and have been wondering about the voltage regulator on e.g. the Uno or Mega. Since I joined this forum, a number of threads have been mentioning that you can power directly into the 5V pin; the statements have become more absolute stating that barrel/Vin are basically something from the past where 9V/12V wallwarts were a standard.

Due to lack of knowledge, I don't trust feeding a hard 5V into an output.

So the first question is why is it safe? I would like to see a technical discussion, not the answer that it's safe.

The second question is if it's still safe if USB power is / becomes connected as well.

Note:
In an addressable led project, I use a 5V-to-9V converter to power my Mega via Vin to be safe; it's only used to power the Mega itself.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Grumpy_Mike

Quote
I don't trust feeding a hard 5V into an output.
It is not an output. It is simply a pin connected to the processor's power line.

Quote
I would like to see a technical discussion, not the answer that it's safe.
The output of a regulator is the emitter of a transistor. The rest of that transistor that is the collector and base when unpowered are at a lower potential and so you have in effect a reverse biased diode protecting the regulator just like the normal reverse polarity protection diode in series with the barrel jack.

Quote
The second question is if it's still safe if USB power is / becomes connected as well.
The Arduino has a switch that protects the USB power in that case, but not the 5V rail. However you are connecting two regulators together, both are trying to maintain a steady voltage so you might think they would fight, which indeed they do. But the capacitors on the two regulators prevent serious oscillation and the output does not oscillate. Basically the regulator with the highest reference voltage wins and the other one winds itself down to that level.

Paul__B

So the first question is why is it safe? I would like to see a technical discussion, not the answer that it's safe.
Wow!  That's a tough one to be sure!  :smiley-eek:

Hmmm.  However could we go about figuring it out?

Maybe - just maybe one possibility but you never can tell - the trick is to read the datasheet?  :smiley-roll:
Quote
Protection Diodes
The  NCP1117  family  has  two  internal  low  impedance diode  paths  that  normally  do  not  require  protection  when used  in  the  typical  regulator  applications.  The  first  path connects between Vout and Vin, and it can withstand a peak surge current of about 15 A. Normal cycling of Vin cannot generate a current surge of this magnitude. Only when Vin is shorted or crowbarred to ground and Cout is greater than 50 µF,  it  becomes  possible  for  device  damage  to  occur. Under these conditions, diode D1 is required to protect the device.
So the message seems to be: Do not short out Vin!

The second question is if it's still safe if USB power is / becomes connected as well.
Well, USB power is fed - through a diode (Nano, Pro Mini) or polyfuse and FET - to the same 5 V line that is the output of the regulator, so exactly the same thing applies.

There is a concern about back-feeding the USB port if it is connected as well as a 5 V supply.  There is absolutely no suggestion that this can damage the UNO itself; transfer of power beyond 500 mA in either direction might trip the polyfuse.

The concern is that if the external 5 V is higher than the USB 5 V, you might "back-feed" the USB port on the PC or laptop.  This is in itself, a valid concern as there seem to be reports of USB ports being damaged in this fashion.

The point against this being likely however, is that many or most powered USB hubs do in fact, connect the accessory 5 V supply rated at something like 2.5 A directly to the 5 V terminal on all outputs and the input because without the accessory 5 V supply, the input must feed those outputs and you do not want to insert any device - such as a diode - which will cause a voltage drop.

So given the relative number of Arduino UNOs (some even genuine) and powered USB hubs, I feel if this were a frequent problem, it would be announced to a far greater audience than this forum!

sterretje

It is not an output. It is simply a pin connected to the processor's power line.
It's the output of the voltage regulator ;) I should have been clearer.

The output of a regulator is the emitter of a transistor. The rest of that transistor that is the collector and base when unpowered are at a lower potential and so you have in effect a reverse biased diode protecting the regulator just like the normal reverse polarity protection diode in series with the barrel jack.
Thanks for that, memory coming back. So it's something like the 2N3055 in http://powersupply33.com/wp-content/uploads/2011/10/low-riple-power-supply.jpg (image not inline as it's not my image).

The Arduino has a switch that protects the USB power in that case, but not the 5V rail. However you are connecting two regulators together, both are trying to maintain a steady voltage so you might think they would fight, which indeed they do. But the capacitors on the two regulators prevent serious oscillation and the output does not oscillate. Basically the regulator with the highest reference voltage wins and the other one winds itself down to that level.
Can you explain that in more detail? How can something that is lower, wind down (even 'more' lower)? I'm probably misunderstanding.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

sterretje

Maybe - just maybe one possibility but you never can tell - the trick is to read the datasheet:smiley-roll:
Sorry, should have said that I did read the datasheet and I did see the quote about the protection diodes. It's still open in my browser (https://www.onsemi.cn/PowerSolutions/document/NCP1117-D.PDF) ;) It just tells me that there is a path back through the regulator to its input so I'm possibly feeding through the FET and the fuse to the PC.

There is a concern about back-feeding the USB port if it is connected as well as a 5 V supply.  There is absolutely no suggestion that this can damage the UNO itself; transfer of power beyond 500 mA in either direction might trip the polyfuse.
I certainly hope it will ;) Although I have seen reports of USB ports on the PC shutting down as well, so it might not always be the case.

The concern is that if the external 5 V is higher than the USB 5 V, you might "back-feed" the USB port on the PC or laptop.  This is in itself, a valid concern as there seem to be reports of USB ports being damaged in this fashion.

The point against this being likely however, is that many or most powered USB hubs do in fact, connect the accessory 5 V supply rated at something like 2.5 A directly to the 5 V terminal on all outputs and the input because without the accessory 5 V supply, the input must feed those outputs and you do not want to insert any device - such as a diode - which will cause a voltage drop.

So given the relative number of Arduino UNOs (some even genuine) and powered USB hubs, I feel if this were a frequent problem, it would be announced to a far greater audience than this forum!
Most reports that I have seen always involved 12V on Vin.

And of course you will see that I'm the one that blows 100 Unos in a row so I'd rather be cautious ;)
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.


Grumpy_Mike

Quote
How can something that is lower, wind down (even 'more' lower)?
If you think about what a regulator does is it adjusting its output drive to match its reference voltage. So if the output voltage drops because of taking more current it compensates by driving the voltage higher until it matches the voltage it is aiming at.

That is the same as having just a variable resistor to control the output voltage with some one looking at an meter on the output and adjusting the resistor until the output matches what you want. So as the current increases and the voltage drops you turn the resistor down to get the voltage to move up. This person doing the fiddling about with the variable resistor is in fact superman and they can do it very quickly.

Now someone else comes along and supplies a higher voltage on the meter, now the variable resistor no longer changes the voltage output but superman still thinks he is in charge and turns the variable resistor down ( makes the value bigger to increase the voltage drop across it thus reducing the voltage output ). Nothing changes so he turns it down a bit more and a bit more and a bit more until it is wound down all the way it can go.

sterretje

If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Go Up