I have a device I'd like to turn off when power is available via a USB socket. The device that needs to be turned on/off is powered by a 12v DC 0.5 amp adapter. USB sockets should have a max 5v 0.5 amp power output.

Would it be safe to wire this up to a simple spst nc 5v relay such as:


Coil Resistance:    125ohm
Coil Voltage:   5VDC
Contact Configuration:  SPST-NO, SPST-NC
Contact Current:    5A
Contact Voltage VAC:    250V
Contact Voltage VDC:    30V
Product Range:  OMRON - G6B Series
Relay Mounting:     Through Hole
SVHC:   No SVHC (16-Jun-2014)

Would a usb 2 device to able to provide enough power to trigger the relay?

  • \$\begingroup\$ Probably, and as external interfaces USB ports tend to be somewhat robust, but it would be good to put the usual catch diode on the relay coil anyway. Also beware that USB bus power is sometime on when a system is in some suspend modes. \$\endgroup\$ Feb 8, 2015 at 18:01

1 Answer 1


The relay coil will draw (5 V)/(125 Ω) = 40 mA. If the rest of your device only draws 60 mA, then there should be no problem. If the rest of the device draws more, then it has to negotiate for the higher current, and be prepared to shut down if it doesn't get it.

In practise, any desktop computer that runs from line power is very likely to always grant you the 500 mA.

  • 1
    \$\begingroup\$ The power coming from USB port will be doing nothing other than powering the relay, so I assume this will be fine? The 12v device controller by the relay is a simple infrared illuminator. \$\endgroup\$ Feb 8, 2015 at 16:29
  • \$\begingroup\$ Whoever downvoted this: What exactly to you think is incorrect, misleading, or badly written? \$\endgroup\$ Feb 8, 2015 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.