Arduino Mega 2560 disable USB power

Hello is there a way to force power supply only from external source and use the usb connection only for programming purposes on a mega 2560 rev3? Thx

mozqwe:
Hello is there a way to force power supply only from external source and use the usb connection only for programming purposes on a mega 2560 rev3? Thx

That is how the mega2560 board works already. If there is both USB and external DC power available to the board, the auto-voltage selection circuit uses the external DC power and isolates the USB power via a FET switch.

Lefty

The thing is that I would like to have the arduino shutdown as soon as I unplug the external power supply. The way it works by default, as you have described, is that it auto selects the power source so this means that if both the usb and the external supply are plugged in when I unplug the external supply the arduino remains on because it receives power from the usb. I would like to have it off in this situation.

mozqwe:
The thing is that I would like to have the arduino shutdown as soon as I unplug the external power supply. The way it works by default, as you have described, is that it auto selects the power source so this means that if both the usb and the external supply are plugged in when I unplug the external supply the arduino remains on because it receives power from the usb. I would like to have it off in this situation.

That would take some hacking of the board, or possibly get a spare USB cable and hack into it and install a on/off switch on the USB +5vdc wire, or just leave it cut open so that only the USB ground, D+, and D- wires run to the arduino end of the USB cable.

Lefty

Hmmm, yeah I was thinking about that. Is usb communication unaffected by the absence of the V+ connection?

mozqwe:
Hmmm, yeah I was thinking about that. Is usb communication unaffected by the absence of the V+ connection?

Don't know for sure, I've never tried it. The USB ground, and two data lines are all that's need for the USB to function, assuming the USB device has it's own +5vdc voltage source and it's power source ground it wired to the USB ground wire. But possibly the PC side needs to see a minimum amount of current flow to decide that something is trying to attach when you plug the cable into the PC?

You may have to wire say a 50 or 100 ohm resistor from the USB +5vdc wire to the USB ground wire on the PC side of the USB cable where you cut the +5vdc USB wire open. That should work for sure.

Lefty

OK, thx for the help.

Cheers.

The most straight forward solution would be to remove fuse F1 (to the right of the USB connector, towards the external power connector, ca. 5x3mm. Keep it in case you ever want to reverse the change.