tags:

views:

1153

answers:

7

I have a very simple USB gadget that has a switch on it to turn it on or off manually. I would like to have the ability to keep it switched on at all times, and then write software to allow me to programmatically send power to it over USB.

I envison building a small device that plugs into the computer and then the USB gadget could plug into it. This device would be controllable to either pass through USB power, or prevent it from passing through.

When I google for custom USB IC devices that I could figure out who to solder/program to do this, I get lost in more complicated custom USB projects. Mechanically, this seems really simple, and so I assume there should be USB boards that already have this functionality.

Does anyone know of a simple USB device that is programmable to allow USB connections to pass through it or not?

+3  A: 

Use an arduino! Its easy and fast to develope, i undertand you could create a usb male to female that allowed you to "take the power" from it, then just use a relay and a arduino to controll when that happens!

DFectuoso
I am not much of a hardware guy. I looked at Arduino's site and it looks promising. Do you have any suggestions on which product(s) I would need. Would I need the Duemilanove, or could something smaller also work?
AmoebaMan17
The Duemilanove would be adequate. The Arudino plugs into a USB port on the PC for Power and communicates through that channel as well... If the end device just requires power, then making a female USB port connected to the relevant Power pins should be easy -- USB communication of the gadget through the Android would be another story!
Shadow
+1  A: 

An exact similar question was asked early.

Like i sad in my answer there is a hardware solution, i was laisy to google for it. Since it was asked twice i do googled:) The relevant hardware is here and i'm sure that there is more. Just google for it.

Ilya
I read that question and it sounded like the answer was it is not possible to do so by just using software (or if possible, you may not be able to specify a single port). That's why I was hoping to find out if a hardware solution already exists that someone knows about.
AmoebaMan17
Thank you for posting that link!! :) When I googled I couldn't find anything like this. However, I still am at a loss at how to build the circuitry to control this using software. But now that you pointed me towards a product, maybe I'll have some luck finding schematics using that control.
AmoebaMan17
let me know about the results :) It might be useful after all...
Ilya
A: 

I was just thinking that what I am asking for is even possibly a USB hub device that is controllable using software. I am a software guy and not a hardware guy so I was hoping the hardware already exists pre-fab so I don't have to do any lumpy soldering.

AmoebaMan17
A: 

There isn't a product that you describe that I know of, but DFectuoso is right - an Arduino is probably the way to go.

Personally, I really like SparkFun for their products. I've only ever used an Arduino, but learning to work on it is pretty easy. Both Arduino.cc and Sparkfun have excellent tutorials to start learning Arduino.

The device I envision you having would be a board (probably a breadboard to start) with a male and female usb port. You would wire the power lines to the Arduino, and you could control it programmatically to allow power to pass through or not. I know from playing around with my own projects (I've been tinkering with making an Ambient Orb-type device in C# and with the Arduino) that you can communicate with an Arduino over the Serial protocol.

I understand that you're not a hardware guy (I wasn't either, until recently), but it's fun and easy to get into - and once you start playing with the Arduino, you'll keep coming up with more reasons to play with it!

http://www.sparkfun.com/commerce/product_info.php?products_id=666

Jared Harley
I'll take a look at the Arduino. I was a little afraid this project may require me starting with another project before it grew legs. Thanks for the suggestion and maybe this will get me more into the hardware side of development.PS - I like your Noodley Appendaged image!! :)
AmoebaMan17
+2  A: 

According to the USB 2.0 specification (section 11.11),

Self-powered hubs may have power switches that control delivery of power downstream facing ports but it is not required. Bus-powered hubs are required to have power switches. A hub with power switches can switch power to all ports as a group/gang, to each port individually, or have an arbitrary number of gangs of one or more ports.

It does seem to be possible in practice to make use of this facility to turn USB devices on and off from software. See this recent blog entry, for example. The author specifically mentions a Linksys 4-port hub working where some cheap alternatives failed, and provides some information about how to query a hub's level of support for power switching (from Linux, looks like) and control the power switches from Python code posted to a mailing list.

zaphod
+2  A: 

I have such a device. It's probably not as elegant as it could be but it does the job. We needed to lose the power to our USB modems during a restart of the PC but the USB bus stays powered. Basically, we had a device made that uses the power from the serial port when open to allow power through to the USB device. Hence, opening and closing the port turns the device on and off. A simple Windows service also controls the port and I'm sure it's equally simple to write its equivalent on any platform. We commissioned a few hundred of these and are about to place a reorder. Let me know if you still have a requirement. Our unit cost is about 7 GBP or about $10US plus shipping and you'll need another A-B USB cable plus a serial cable (unless you want to plug it directly into the com port).

Regards

Derek

A: 

Take a look at [FTDI] products. They have USB-to-everything. Particularly, look at the FT245, which is a USB to FIFO chip. The drivers expose a COM port, or you can use their API to send data directly. With the FIFO chip maybe you can tie a transistor/MOSFET/relay to one of the pins and then just transmit the correct bit value to turn your devices on or off.

pelesl