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?
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.
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.
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.
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.