After searching the forums I found close matches, but nothing conclusive to match my situation. If this has already been well answered in a post I didn't find, I apologize.
If my project requires external power due to expected current draw, but I also need to use USB connection to the computer for serial comms, then how should the wiring look? My understanding is that I should connect the PSU 5V+ supply to the Uno's Vin pin, connect both grounds, and then still safely use the USB for serial comms to the computer. Is that correct?
I'm building a custom dashboard for the game American Truck Simulator. At some point I know the current draw is going to exceed what my Arduino Uno can handle. So I'm looking for suitable external supplies. The sticky bit I've come across is how to wire them. The posts I've found all seem to have different answers. I just want to clarify before I fry the Uno or USB port on the computer. Also, I eventually want to use a Nano or Micro for the project, so I will definitely need the external PSU at that point.
If it's relevant, the eventual circuit plan includes @20 addressable LEDs, a liquid crystal display (the backlight on that is already fluctuating, I assume due to available current), and 2-5 micro servos. Right now I'm testing code with 4 LEDs, the LCD, and two servos.
Vin needs at least 6.6V (7V would be better) to allow for the comparator controlling the P channel MOSFET to shut off Vusb from feeding through to +5V. When Vin exceeds 6.6V, Vusb is only used to run the 16U2 (and if it's a clone with a CH340, not even that).
That would have the 5V regulator and Vusb fighting each other, which would definitely be a bad idea.
That's fine. You could even forgo the Vin pin and just plug a spare 9V wall-wart into the barrel connector. That puts the reverse polarity protection diode in the circuit, whereas going to Vin directly bypasses it.
But I thought the Uno has a 900mA limit when powered through the on-board barrel connector. Am I mistaken? I will surely surpass that amount with what I have planned. I also plan to use a Nano or Micro for this at some point, so I will need to provide the power off-board.
Fair point. Connection wise, you're fine. Amperage wise, going back and reading your initial post again, not so much. You'll probably be better off with a separate 5V supply for the servos (and maybe the LEDs, depending on how much they draw).
And if you're going to do that... why not run all the peripherals off your 5V 2A wall-wart, and power the Uno from USB? Just make sure you've got a ground connection between the Uno and the wall-wart.
Ah, so I would have a 5V+ rail from the wart for the Vin for LEDs, Servo, and LCD Backlight. Everything else (PWM lines, LCD control lines, LED control line, etc.) would go to their appropriate pins on the Uno. Or, to put it simply, any line that needs constant 5V would go to the external rail, with a common ground between the wart and Uno. Am I understanding correctly?
Based on some of the diagrams I've seen trying to find the answer to this I thought there had to be some type of V+ connection between the PSU and Uno. But what you're saying makes much more sense if I do understand correctly. The power sucking components will draw from the external rail, the Uno powers from USB, and the signal lines from the Uno work correctly because they have a common ground.
You have got it exactly. With a ground connection between the Uno and the wall-wart, the Uno's signals have a complete circuit. And with the wall-wart powering all the hungry stuff off board, all the USB connection has to power is the Uno itself.
Related question. I did get things working just fine as outlined above. However, the sequencing of plugging things in leaves my LCD backlight powered on before it gets a signal.
I'm thinking of adding a MOSFET into the circuit that enables the 5V rail as the first setup action in the Uno sketch. Seems logical, but maybe I'm missing an easier solution to have the 5V rail enabled only after the Uno is plugged into the computer.