Disable USB power so when connected via USB without Ext power, Arduino is off

Hi,

I'm building a little control project that communicates with a PC via USB but uses (and needs) an external power supply to function, however I only want the board to be powered from the external supply - never from USB. If only USB is connected, I need it to be 'off' until the external power comes on.

It's using the Ladyada Motor Control shield, however due to some voltage leaks on the L293D chips (I think) causes the motors to be powered, from the USB supply (even with the power jumper disconnected) all be it without enough current to turn, but causing odd behaviour.

The Arduino automatically uses the external supply when it's connected, but I need to prevent it powering up without external power.

I'd rather it just didn't power up or draw any power from USB, but as a compromise, if I could detect the lack of external power in software and loop until external power becomes available I can be sure the motors don't get switched on.

Is there any way to disable the USB as a power source yet keep the data, or failing that, what's the best way to get an input based on the external power without just sticking a relay on it?

Thanks!

What you ask is data-only USB cable or powerless USB cable.

A data-only USB cable is a cable that only contains the + and the - data leads. It does not contain the +5V power lead. lt SHOULD contain the ground lead. This type of USB cable is what is known as "Data-Only". You CANNOT just assume since your USB device is plugged into a power source that you do not need the power lead on your USB cable! That is just plain wrong.

The application is high-end audio DAC and very pricey.

You need DIY the cable.

never from USB

Remove the USB polyfuse.

sonnyyu:
You CANNOT just assume since your USB device is plugged into a power source that you do not need the power lead on your USB cable! That is just plain wrong.

Yes, you're right - I wasn't planning on doing that and am aware the ground would be required. I would rather not rely on a custom USB cable though.

LarryD:

never from USB

Remove the USB polyfuse.

That's just what I was hoping for, could you describe where that is on the board so I know what to remove?

Thanks for your help.

Sam2D:
...
That's just what I was hoping for, could you describe where that is on the board so I know what to remove?
...

You didn't tell us which Arduino you have, You treat us as fortune teller?

Yes, we need to know the Arduino board you have.
Show us a picture of it.

That's just what I was hoping for, could you describe where that is on the board so I know what to remove?

It's generally the very large flat component (compared to the other 2-lead SMD components) located near the USB connector.

Sorry folks, it's an Uno.

Is it the golden one marked 501V?

Sam2D:
Sorry folks, it's an Uno.

It's that squarish component just below the USB connector and closest to the left card edge in the top left picture.

http://arduino.cc/en/Main/ArduinoBoardUno

Lefty

Thanks so much for your help, appreciated.

yes, 501V, or 501L

I want to do the same thing here. I have a Leonardo that connects via USB to a computer and acts as a keyboard. There is external power to the leonardo when the system is on and running. I want to be able to turn off the system and have the leonardo be powered down while it is still plugged into the USB port.

I removed F1 and now it does not connect to the USB on the computer. I suspect the computer needs to see some current draw to turn on the USB port.

Have others had experience with this and seen different results?

Thanks

Update...
I put the polyfuse back in and removed the FET. Now it does the right thing.
It is powered and connects only when the external power is on. When the external power is off it is inert and the PC does not know it is there. it also powers off and terminated the program. When it turns back on it is reset and ready to go.

For those searching for how to disable the USB power on an Arduino, the answer is: Remove the FET.

Marty

There is a simpler way than removing the FET etc. I am working with a Leonardo, but I understand the Due is similar?

If you cut the +5v line in the USB lead as before BUT then connect the Arduino 5v out into the micro USB side of the cut cable, therefore providing 5v to the USB controller. Now when I remove Vin (12v in my case) the 5v is removed from the USB too, powering down and disconnecting the Leonardo from the PC, even though the cable is remains connected. Providing power to Vin again, boots up and connects the Leonardo to my PC.

Easier than removing SMD devices and doesn't risk your board....