Maker Pro
Maker Pro

USB close circuit

Erez

Oct 13, 2014
5
Joined
Oct 13, 2014
Messages
5
Hi

I am looking for a solution or a small device that can help me close or open an electric circuit with USB.
What I mean: I got led strip that get power from my car plug. It stay open all the time since the car plug always working even if the car is not running. But O also got a USB port that is close when the car is stopped. So I want to use the USB as a power controller for the led strip and open the circuit when the car is running and close it when is stop. The led strip will get it electrical power of 12v from the car power plug but the USB will control the circuit.

Does anyone got an idea or can build this kind of small device?

Thanks
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Will a transistor not work which is switched in when the USB has power. A simple NPN or MOSFET switch should work I would have thought.
Adam
 

Erez

Oct 13, 2014
5
Joined
Oct 13, 2014
Messages
5
Hi

I don't know how to build that. Is there a place I can buy this kind of device ready to work? I need from one end a USB connector and tow lines out of it, so I can use them to close the LED circuit.

Thanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Simply use a relay (normally open) with a 5V coil. Connect the coil contacts to the USV_power and USB_ground lines. Make sure you have a diode (e.g. 1N4141 across the coil such that the cathode (ring on diode's housing) points to USB_power (+5V). Your relay should draw less than 100mA deom the USB power port.
Connect the LED string to 12V power using the relay contacts.

relay-gif.15971


This relay is suitable for up to 10W load (LED string). If your LED string uses more power, you'll have o find a relay rated for the required load.

I wasn't able to locate an off-the-shelf solution.
 

Attachments

  • relay.gif
    relay.gif
    4.3 KB · Views: 265

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Simply use a relay (normally open) with a 5V coil. Connect the coil contacts to the USV_power and USB_ground lines. Make sure you have a diode (e.g. 1N4141 across the coil such that the cathode (ring on diode's housing) points to USB_power (+5V). Your relay should draw less than 100mA deom the USB power port.
Connect the LED string to 12V power using the relay contacts.

relay-gif.15971


This relay is suitable for up to 10W load (LED string). If your LED string uses more power, you'll have o find a relay rated for the required load.

I wasn't able to locate an off-the-shelf solution.

You beat me to it Harald, I was just thinking a relay will also work and give some isolation also.
Thanks
Adam
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
You can also get USB to 12 Volt boosters, that might work depending on the amount of power required.
Adam
 

Erez

Oct 13, 2014
5
Joined
Oct 13, 2014
Messages
5
Simply use a relay (normally open) with a 5V coil. Connect the coil contacts to the USV_power and USB_ground lines. Make sure you have a diode (e.g. 1N4141 across the coil such that the cathode (ring on diode's housing) points to USB_power (+5V). Your relay should draw less than 100mA deom the USB power port.
Connect the LED string to 12V power using the relay contacts.

relay-gif.15971


This relay is suitable for up to 10W load (LED string). If your LED string uses more power, you'll have o find a relay rated for the required load.

I wasn't able to locate an off-the-shelf solution.

WOW, that's great answer! I am not an electronics guy so I wont be able to build this. Can someone build it for me? I am willing to pay for that.

Thanks!
 

garublador

Oct 14, 2014
111
Joined
Oct 14, 2014
Messages
111
There probably isn't much to build. You just need the relay, a socket (the relay plugs into it and you get screw terminals for each pin) and the diode. The only tricky thing would be an enclosure if you wanted it, but you'd want someone who's good at building mechanical stuff for that. The one I found is DIN rail mountable, so mounting it will be easy, too.

I didn't look super hard, but here's one solution:

Socket: http://www.digikey.com/product-detail/en/AHNA21/255-1802-ND/700457

Relay: http://www.digikey.com/product-detail/en/AHN22005/255-1508-ND/570646

Diode: http://www.digikey.com/product-detail/en/1N4148TA/1N4148TACT-ND/1532747

The only electronics part is stripping wires and screwing them down like Harold shows. You'd need someone local to wire it for you. I assume 5A at 12V is probably enough for the LED's. That relay will have an extra pole, so you can switch two different things with the USB 5V if you want. It's probably not the cheapest solution, so you may be able to search for a slightly cheaper relay and socket, but it's super simple to assemble and mount.
 

Erez

Oct 13, 2014
5
Joined
Oct 13, 2014
Messages
5
Thank you vey much for the details answer. I will try it and update.
Thanks again! :)
 
Top