We are preparing your download, please wait.
USB Relay Power Switch
A cheesy way of providing massive power to a USB peripheralGadget
Creative Commons Attribution Share Alike
Commercial use is allowed, you must attribute the creator, you may remix this work and the remixed work should be made available under this license.
This is a relay power switch for USB devices. It forms a sort of "pass through", with power boost. That is, the device on the receiving end of this device can pull as much current as an external power supply can deliver - not whatever the host can deliver.
The switch works really simply. The host provides power to energise the coil of a 5V relay. The relay switches the power from the power supply to the "downstream" side device. The downstream device and host can negotiate whatever they like, can send whatever data they like, but the actual amps come from an external power supply and not the host. The external power supply is never connected to the host, and is disconnected from the peripheral when the host is switched off or disconnected.
Note: you can do the same thing with a powered hub. Indeed, such hubs conform to USB standards, where as I doubt this little device does ;-)
Materials and methods
I made this using things I already had, so YMMV. You will need:
1 x 5V relay (eg. https://smile.amazon.co.uk/gp/product/B013ER8OMQ/)
1 x USB type A connector (eg. https://smile.amazon.co.uk/gp/product/B07MM5X2J6/)
1 x USB type B connector (eg. https://smile.amazon.co.uk/gp/product/B07R9SQW3Y)
1 x 2.1mm barrel jack socket
1 x diode (eg. 1N4001)
Some wire, solder, soldering iron etc.
Some M2.3 x 5 screws
Make the plastic box, and check all the pieces fit inside it. Then:
- Wire the two connectors D+ lines together, and then the D- lines (ie. D+ to D+ and D- to D-).
- Solder on some wires for V+ and GND on both connectors.
- Fit the two connectors into the box, and screw them down
- Solder some wires onto the barrel socket and then fit the socket (there was just enough room to turn the retaining nut on mine - YMMV)
You need to know which pins on the relay are the coil, common, Normally Closed (NC) and Normally Open (NO).
Now connect everything up as follows:
- put the diode between the pins of the coil on the relay. It can go on either way around, but the pin nearest the stripe on the diode becomes the "positive" pin. The diode is used as a "flyback diode" here - it's very important!
- Connect all the ground wires from both USBs and the power socket together and solder them to the negative coil pin on the relay.
- Connect the V+ from the Type B connector to the positive side of the coil on the relay
- Connect the V+ from the Type A connector to the "Normally open" (NO) pin on the relay.
- Connect the V+ from the power connector to the common pin on the relay
Now you can test. I'd try this in a USB power supply rather than your shiny new computer. Plug the cable into USB hub/power supply and the other end into the Type B connector. You should hear the relay click as you push the connector in, and click again as you take it out.
Next, try a device in the Type A connector (eg. a lamp). Obviously, with nothing connected it should be off. Plug in the USB power supply - the lamp should still be off. Unplug the USB power supply and put a 5V supply into the barrel jack connector. The lamp should stay off - but turn on as soon as you plug in the USB power supply again.
Issues are used to track todos, bugs or requests. To get started, you could create an issue.