Go Down

Topic: external 5V at Vin pin, and USB connection - UNO board (Read 3338 times) previous topic - next topic

Yvan

I designed a shield that powers Arduino Uno with 5V trough Vin pin.

For testing purposes I need to connect Uno to PC, and shield to 12V, but shield has a 5V regulator that powers Arduino Uno..

Will I damage anything if I connect Uno to PC with USB cable (that also has 5V supply)?
___   ____
     /__/  /    \      ** Registrovani korisnik Linuksa #291606 **
    /  / \/  /\  \     ** Registered Linux user #291606

PaulS

Quote
Will I damage anything if I connect Uno to PC with USB cable (that also has 5V supply)?

No. The Arduino has a power selector circuit that handles two separate power inputs. When USB power is present, that is used. When it isn't the Vin pin power is used.

retrolefty

#2
Feb 27, 2011, 03:28 am Last Edit: Feb 27, 2011, 03:34 am by retrolefty Reason: 1

Quote
Will I damage anything if I connect Uno to PC with USB cable (that also has 5V supply)?

No. The Arduino has a power selector circuit that handles two separate power inputs. When USB power is present, that is used. When it isn't the Vin pin power is used.


Actually external power has first switching priority over USB power. USB power is used if only there is no external power avalible.

However it brings another layer of complexity to the game. He is powering his shield via the Vin pin, that then activates both the on-board +5vdc on the Uno board and the +5vdc regulator that he has installed on his shield board. So while the USB +5vdc is isolated via the auto-voltage switching circuit on the Uno board, he is still 'hardwiring" the outputs of two different +5vdc regulators together. And I'm sure that I"ve read in regulator datasheets in the past that they do not recommend that practice. However it will probably work fine even if not a good engineering practice.

One way to eliminate this possible problem is to make sure that the +5vdc power on your shield board does not connect to the +5vdc shield connector power pin. That would keep the two regulators isolated from each other. But then he would have the problem of his shield would not have any +5vdc power if he was running on USB power. Oh the evil webs we weave.

Let us know if it lets any of the magic smoke out.  :D

Lefty

Yvan

#3
Feb 27, 2011, 07:27 am Last Edit: Mar 06, 2011, 08:46 am by Yvan Reason: 1

One way to eliminate this possible problem is to make sure that the +5vdc power on your shield board does not connect to the +5vdc shield connector power pin. That would keep the two regulators isolated from each other. But then he would have the problem of his shield would not have any +5vdc power if he was running on USB power. Oh the evil webs we weave.


I do not understand this part. What do you mean by "+5vdc power on your shield board does not connect to the +5vdc shield connector power pin"? How then would I power Uno when it is not connected to the USB port?

And I will always use it with external power, except now, I need to test if it is doing what it is suppose to, and I need to finish programing.

Here is the schematics, I want to controll idle speed on my car with a little steeper motor, and Daytime Running Lights:


Quote
Let us know if it lets any of the magic smoke out.  :D


I hope not.  :smiley-roll: :)


Please note that that there is an error at this schematics. Vcc should be connected to the +5V pin not to Vin, and, in the lower right corner CLT should be where TEMP is, and vice versa.
___   ____
     /__/  /    \      ** Registrovani korisnik Linuksa #291606 **
    /  / \/  /\  \     ** Registered Linux user #291606

retrolefty

#4
Feb 27, 2011, 07:39 am Last Edit: Feb 27, 2011, 07:46 am by retrolefty Reason: 1
The schematic helps a lot, you got a lot of stuff going on there. Now a problem is you are routing +5vdc shield voltage (Vcc) to the Arduino uno via the shield's Vin pin? That won't work, the Vin pin on the Uno has to have at least 7 vdc applied to it to power the input of the Uno's 5vdc regulator.

I thought you might to powering the uno board by wiring the shields vcc to the +5vdc pin on the shield connector, thus then having the two regulator outputs tied together problem I mentioned, if you were also routing voltage via the Vin pin, which your aren't.

This is all giving me a headache.  :D Anyway I still don't see a perfect way to power the system and still be able to utilize USB power when you wish. But what you have right now is flawed because the uno's regulator's input needs to be 7vdc or higher to operate correctly.

Lefty

Yvan

Yes, I made a mistake, but If I change it like this:
___   ____
     /__/  /    \      ** Registrovani korisnik Linuksa #291606 **
    /  / \/  /\  \     ** Registered Linux user #291606

Yvan

I changed this, and now my sketch works. I was wondering why it didn't, when Uno was connected to USB with LED's it did, but now it won't switch on the solenoid. :)

So that's sorted, but I still need to know if I can plug in USB while it is powered via +5V pin from the shield. :~
___   ____
     /__/  /    \      ** Registrovani korisnik Linuksa #291606 **
    /  / \/  /\  \     ** Registered Linux user #291606

retrolefty

Quote
So that's sorted, but I still need to know if I can plug in USB while it is powered via +5V pin from the shield.


It should work ok. However is the 500ma current limit for USB power enough to run both the Uno board and your shield board? The polyfuse in the Uno board will open if current draw is > then 500ma.

Lefty

Yvan

I do not know much about electronics, I coped most of the circuits from the Internet, so can you explain to me what happens when I connect Uno to USB.

I can understand that it can switch to use power from USB, but how can it switch off shield's power too?

How I see it, since there is no chance that both USB and my shield will be at the same voltage (both are ~5V), small current will flow in one direction.

I am probably wrong, but that's why I ask here :)

BTW, my shield only draws ~40mA.
___   ____
     /__/  /    \      ** Registrovani korisnik Linuksa #291606 **
    /  / \/  /\  \     ** Registered Linux user #291606

Yvan


Let us know if it lets any of the magic smoke out.  :D



I decided not to risk it. I will bend the pin going into +5V, so grounds will be connected, shield will be powered externally, and Uno will get +5V from USB.
___   ____
     /__/  /    \      ** Registrovani korisnik Linuksa #291606 **
    /  / \/  /\  \     ** Registered Linux user #291606

Yvan

I finally ended powering Uno with both USB and shield +5V, and nothing is fried, I can confirm that it can be done with no damage to the board.
___   ____
     /__/  /    \      ** Registrovani korisnik Linuksa #291606 **
    /  / \/  /\  \     ** Registered Linux user #291606

Go Up