# USB cut off power

## Noxius

Hi,

i need to completly cut off power to USB connectors, is any way to do this by software? Why? Beacuse i have huawei e220 gps modem and this crap is very buggy. Most time is stacked or what ... The only possible solution for this ist to POWER OFF whole computer or PULL OUT usb cable ... but this is not for me, computer which is connect to this usb modem is too far from me and there is no other connection, which i could use.

So:

1. cut off any power to usb port

or

2. turn off usb hubs in bios and software restart and than turn on an restart again

Thx in advance for some clues

----------

## jvale

No idea if it works, but you can try this: http://lkml.org/lkml/2007/1/2/152

----------

## Jaglover

Cut that USB power wire and get power from a serial port. Serial port pins can be turned on and off (high and low).

----------

## eccerr0r

some motherboards and USB powered hubs connect power to the device all the time and cannot hard power off devices.  Not sure about soft power down though, which is a different thing.

----------

## kEiNsTeiN

jaglover: cool idea  :Smile: 

----------

## Jaglover

Yeah, I used to program certain PIC chips with self-built hardware using serial port power. If it's not sufficient (wattage) one can draw power directly from PSU and use one of serial port pins to drive a transistor switch (or relay).   :Cool: 

----------

## coolsnowmen

 *Jaglover wrote:*   

> Yeah, I used to program certain PIC chips with self-built hardware using serial port power. If it's not sufficient (wattage) one can draw power directly from PSU and use one of serial port pins to drive a transistor switch (or relay).  

 

It is also "dangerous" as the serial port was never meant to be used for that and you can blow it easily if you are not carefull. And if your serial port is on motherboard....simply: thats not good

--Electrical Engineer

----------

## Jaglover

How do you know? Nowadays outputs are protected, current is limited to a safe level. You can short a serial port pin which is "high" for an hour or as long as you want, no harm done.

--

Electronics Engineer

----------

## coolsnowmen

 *Jaglover wrote:*   

> How do you know? Nowadays outputs are protected, current is limited to a safe level. You can short a serial port pin which is "high" for an hour or as long as you want, no harm done.
> 
> --
> 
> Electronics Engineer

 

If that is true, then great, but because its not part of the serial specs and unless you have the board specs with you, you can't trust it, as it isn't part of the standard.  And I don't trust it because it would make serial ports more expensive and I know manufactures cut costs to the penny.

You are right, I don't know it isn't protected, but I don't trust it, and consider it wiser to pull power from somewhere else.  But then again, as you have done it, clearly I believe its possible, I just wanted to caution anyone who took the advice, as your post didn't.

--respectfully

----------

## Jaglover

 :Smile:   Protecting outputs is not expensive. Not protecting them is expensive. Imagine you must replace something as complex as a computer motherboard every time something goes wrong with montage or during maintenance. Not to mention outputs that are exposed to the "outside world" and bad users (like me). There is no need to build sophisticated protection schemes into a chip. Since TTL "high" has not to be full 5 V simply a serial resistor can be used. Now, that is not expensive, is it?  

See required output "high" levels here: http://www.interfacebus.com/voltage_threshold.html

----------

## eccerr0r

USB 5V is 2.5W max (powered) or 500mW (passive).

RS232 power ... I'd say you can draw maybe 20-30mW tops from it per pin.  With an appropriate diode network you can use multiple pins to grab more power.

Note also that adding resistors to protect outputs does come at a small performance cost as well, neglecting the cost of adding another component to the board, which could increase board space, which would...

----------

