Arduino Power - USB vs Vin

When a PC is connected to the Arduino (Mega) via USB and the Arduino is also powered via Vin, which dominates?

Thanks,
John-

Hi,
Here is the part of the Arduino schematic that controls the power supply.
If you have a basic knowledge of electronics you will understand.

PS: Oops this is on UNO. I'll check on Mega.

OK Mega has the same source control circuit.

Thanks. I didn't want to admit that I actually put the power in at the Arduino 5v output pin.
I know it's not advisable, however, I've done it for a long time without previous problems. The
reason is that I have a 12v battery supply and since the max Vin is 12v, I don't want to get near the limit,
since a 12v battery can have a newly charged value of more than 12v. The 12v goes to a 5v linear
regular on a proto shield, which then goes to the Arduino +5 pin.

John-

P.S. Still looking for someone with more than my understanding to interpret the diagram and reply.

Thanks. I didn't want to admit that I actually put the power in at the Arduino 5v output pin.
I know it's not advisable, however, I've done it for a long time without previous problems. The
reason is that I have a 12v battery supply and since the max Vin is 12v, I don't want to get near the limit,
since a 12v battery can have a newly charged value of more than 12v. The 12v goes to a 5v linear
regular on a proto shield, which then goes to the Arduino +5 pin.

John-

Perhaps I committed an atrocity by using the Arduino +5 output pin as a +5 input pin. However, I still would like to know which predominates: The USB connected to a PC, or the voltage connected to the +5 pin. I'm having reset problems and don't know if one or the other is causing it.

Thanks,
John-

The 5V pin is a perfect place to connect a regulated 5V supply to drive the arduino which will allow you to supply move current than the 500ma regulator on the arduino.

With Vin not connected, the comparator U1A is off (GATE_CMD == 0) which turns on T1 which connects USBVCC directly to the internal +5V.

When Vin goes above ~6.6V, the comparator turns on, forcing T1 off which disconnects USBVCC. Since Vin also connects to IC1, it supplies the regulator that delivers +5V.

If you connect the barrel jack, that comes in through PWRIN which goes through a diode and then connects to the same regulator as Vin.

Thank you.

So if Vin is not connected, T1 turns on which connects USBVCC to the internal +5V AND if an external supply of +5v is
connected to the 5V pin, do the supplies conflict? If one of the inputs falls below 5v, does the other take over; is current
forced back into the lower voltage supply?

John-

Yes, they battle it out to maintain +5V with current flowing as needed since you have 2 supplies

Thanks. Very interesting.

John-

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.