Can I connect USB when driving Arduino from an external supply?

Hey all,

Bit of a noob question (sorry if it's been asked before)...

I have an Arduino Mega driving an LED matrix display that needs more power than my computer's USB port can supply. At the moment I'm running them both off a separate 2A 5V supply. (I'm powering the Arduino via it's 5v and GND pins)

Is it safe to also connect the USB port for programming and serial communications while the external 5V supply is also connected? At the moment I'm disconnecting everything before I plug in the USB to update the sketch.

The documentation for the Mega says it will pick the supply automatically, obviously I don't want it to draw power from the computer, just pass data back and forth.

Thanks Nick

USB power is disconnected if there is an external VIN supply. If you hook up an external supply directly to +5V, that circuit will probably not trigger.

mrnick1234567: The documentation for the Mega says it will pick the supply automatically, obviously I don't want it to draw power from the computer, just pass data back and forth.

The auto select circuit selects between the 5V node and Vin node. The 5V node is connected to Vusb (after the on-board fuse) and 5V pin.

So in this case where you are applying 5V directly to the board, you should be disconnecting your external 5V supply (and associated hardware) before uploading.

Is it safe to also connect the USB port for programming and serial communications while the external 5V supply is also connected? At the moment I'm disconnecting everything before I plug in the USB to update the sketch.

That is the safest method for you to use. If plugged into the USB while also wired to an external +5vdc supply then you are 'hardwiring' two different voltage sources from two different regulators, that is not a recommended engineering practice, however many indeed do that and most have experienced no problem.

A second problem is if you just disconnect your external +5vdc voltage source but still have your external LEDs wired then the USB power will attempt to supply current for the whole thing and most likely cause the on-board 500ma thermofuse to open up and power everything down.

Lefty

Arduino will automatically select the input with the higher voltage.

So, if your external supply is at 4.99 V and your usb is supplying 5.01 volts then arduino will still run from USB power.

rNmScale: Arduino will automatically select the input with the higher voltage.

So, if your external supply is at 4.99 V and your usb is supplying 5.01 volts then arduino will still run from USB power.

That is not correct, you obviously haven't read or understood the auto-switching circuit on an arduino board. It only looks at the Vin voltage to decide to switch or not between the on-board 5 volt regulator's output or the USB power. Wiring a regulated +5vdc directly to the arduino +5v pin is not switched on or off in any situation.

Lefty

Thanks for the answers everyone. So to follow up, if I did want to keep the USB attached to read serial output or whatever, would there be a way to wire it?

I guess using the Vin pin wouldn’t work as the external power supply voltage is < 7v.

As the only signals running between the LED matrix board and Arduino are data, could I run the Arduino off the USB, the matrix off the external supply, and just tie the grounds together?

Interesting.... this tread. It is related to my tread in this section. I am trying to make a link from USB to an Arduino live circuit, just like the OP, an I am award of the 5 V from USB and from 5 V from the circuit. My design is the use of opto-coupler. The USB - computer power it side and the Arduino circuit power the other side. And a RS232 link work on the same principle. The circuit power the receiver side of the RS232 and the computer power it side. That system work for a stand alone Ardiuno - chip, but I am not so sure for a UNO board... It the FDTI chip that I am worry about. I will do an experiment to see what happen... I will cross my fingers.... :roll_eyes:

mrnick1234567:
Thanks for the answers everyone. So to follow up, if I did want to keep the USB attached to read serial output or whatever, would there be a way to wire it?

No, not really.

mrnick1234567:
I guess using the Vin pin wouldn’t work as the external power supply voltage is < 7v.

No, it wouldn’t.

mrnick1234567:
As the only signals running between the LED matrix board and Arduino are data, could I run the Arduino off the USB, the matrix off the external supply, and just tie the grounds together?

That’s your best option.

Ok guys, I got this "crazy" idea here... what about a "transfer station" ?

Here what I mean :

When you connect a USB to your Arduino board and use the serial monitor, I call this : Direct subway line

But when you want the serial monitor to a "live" board using the USB directly, you may have problem. So here come the "transfer station" to change subway train and take an another line.

Here what I will do : I will need a second Ardiuno board - UNO is fine...to become the "transfer station". It job will be to received the data from / to the Mega board using Soft.Serial and re-send the data using serial connect the computer USB.

So it like : Subway train A - transfer station - Subway train B

Arduino board A - using TX / RX - Arduino board B - Soft.serial - in - serial - out -- USB computer.

Yeah that would work. A FTDI cable or something similar would be as effective and much (much) cheaper.