user7326: I'm building a 3D printer and I'm using an ATmega2560 + RAMPS board.
The whole thing is powered by an ATX PSU (12v for motors and stuff, 5v for the Arduino), but when I plug in my USB cable, I can't shut the printer down, as it switches over to USB power.
Is there a way to make the Arduino never use the USB power, only the external power source?
Thanks!

user18489: you could do this if you cut the trace for the 5V line from the USB connector to the rest of the board. if you place the mega underside up on a bench in front of you, with the USB facing towards you, i believe it should be the top left pin of the 4 USB pins, but you should double check that first.

user4143: The best way of doing this, if you want your USB connection to still work, is to remove the P-channel MOSFET T1 from the board. 

You can't just disconnect the power from the USB port since that power connection goes directly to UVCC on the ATMega16U2 chip. That is used to power the internal USB peripheral (it goes to a 3.3V regulator inside the chip) and without it the USB interface won't have power.
The USB power is connected to the main 5V rail through that transistor, so if you remove that transistor the 5V from the USB remains connected to the ATMega16U2, but is no longer connected to the rest of the circuit. 

7326: <p>I'm building a 3D printer and I'm using an ATmega2560 + RAMPS board.</p>

<p>The whole thing is powered by an ATX PSU (12v for motors and stuff, 5v for the Arduino), but when I plug in my USB cable, I can't shut the printer down, as it switches over to USB power.</p>

<p>Is there a way to make the Arduino never use the USB power, only the external power source?</p>

<p>Thanks!</p>
 18489: <p>you could do this if you cut the trace for the 5V line from the USB connector to the rest of the board. if you place the mega underside up on a bench in front of you, with the USB facing towards you, i believe it should be the top left pin of the 4 USB pins, but you should double check that first.</p>
 4143: <p>The best way of doing this, if you want your USB connection to still work, is to remove the P-channel MOSFET <code>T1</code> from the board. </p>

<p><a href="https://i.stack.imgur.com/FWAXF.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/FWAXF.jpg" alt="enter image description here"></a></p>

<p>You can't just disconnect the power from the USB port since that power connection goes directly to <code>UVCC</code> on the ATMega16U2 chip. That is used to power the internal USB peripheral (it goes to a 3.3V regulator inside the chip) and without it the USB interface won't have power.</p>

<p>The USB power is connected to the main 5V rail through that transistor, so if you remove that transistor the 5V from the USB remains connected to the ATMega16U2, but is no longer connected to the rest of the circuit. </p>
