+12 VDC on Vin AND USB simultaneously?

Apologies if this is an old question, but I just want to be sure I don't let the smoke out. I have an older Arduino Uno (I'm not clear on which version) that I want to power with an external +12 VDC supply via Vin while also simultaneously connecting to my mac's USB port so that I can program and make use of serial monitor.

Does the Arduino auto switch DC power between Vin and USB, or will I blow it up if both are connected at the same time?

Photo attached for reference

Why do you want to do that?

What do you think it accomplishes?

  • You can simultaneously connect an UNO to Vin and USB.

  • 9V is better than 12V.

When VIN and USB power are both present the UNO will run on VIN, switching off the power from USB.
The common advise is to never supply anything from the +5V to be on the safe side.
The UNO itself will use about 50mA. It is possible to supply other circuitry from the +5V connection, but if that other circuitry pulls more than, say, 50mA from the +5V or 3.3V connection the voltage controller will get pretty hot, and a separate supply is advised.
At 9 Volts, as suggested here above, the trouble starts at a slightly higher current.

1 Like

If the USB is connected, why do you need anything on VIN?

It depends.

image

Power your Uno just from the barrel connector with nothing plugged into the USB. The measure the voltage on either end of the circled component. If you see 5V, your Uno is not shutting off the 5V path to your USB connector when it's powered externally. The 5V from your external power supply can backfeed into your USB port.

Looking at the schematic for the Uno R3, this is caused by the P channel MOSFET T1 not completely shutting off because an LM358 opamp is used for U5 rather than an LMV358. Yes, even on some real Arduino R3s. The LMV358 is a rail to rail op amp and will put 5V on T1's gate when external power is used, thereby shutting it off. The LM358 is not rail to rail, and will max out at around 3.5-3.8V — which is not enough to completely shut T1 off.

1 Like

The opamp LM358 has an output swing from 0.2 to 4.8 V, the mosfet FDN340P has a threshold of (typ) 0.8 V. It switches fine.

That turns out not to be the case. I invite you to re-check the LM358 datasheet.

Currently ( :wink:) I am connected the Arduino's +5V to a single relay's Vin.

I am using the +12 VDC power supply to supply power for a handful of other things. I was also sending it to Vin and then only pulling it from Vin if I specifically needed to check something over USB (such as code or the serial monitor for debugging). It would be convenient to just leave everything connected so long as I am not going to damage anything.

You have no control over whether the power comes from Vin, or the USB, unless you unplug the jack from Vin. When plugged in, the choice is made by the hardware on your Uno Rev2.

Thanks for the tip. In my case, I am bypassing the barrel connector and jumpering +12 VDC directly to the Arduino's Vin. I'll assume the voltage test is valid for either.

That's correct. The only difference using the Vin pin vs the barrel connector is bypassing the reverse polarity protection diode.

And I didn't even notice that was an R2 until @jremington mentioned it. Wow; that is an oldie!

1 Like

You need to lok at the right table.

And you need to look at the right datasheet.

image

That's the LMV358 datasheet. We're talking about the LM358 (no V). The LMV358 is rail to rail. The LM358 is not.

That is a mistake you see an many clones,
but the picture shows a genuine Uno from Italy.
Leo..

Part_Schematics_UNOR3

But if you're talking about clones, all bets are off.
May not even contain the switch.

And I have, within arm's reach, two vintage genuine Arduino Uno R3s, bought from authorized distributors back in the day, with LM358s on them. M5P marking on top, 3.5V output to the MOSFET's gate. Though if the OP is lucky, their R2 is old enough that it predates the whole LM358 instead of a LMV358 kerfuffle.

See my reply to @Wawa. Even on genuine Arduino Unos, despite what the schematics specify, the op amps are not always LMV358s.

I must agree: to separate VUSB from +5V the gate should be near the +5V, and the LM358 (without V) doesn’t do that.

The UNO WiFi R2 uses a different system for the switch.

I’m sorry to hear that even Arduino themselves got fooled by that nearly equal partnumber.

By the way: my R3 has SGM8542 for opamp, maybe they try to avoid this problem.