Electronic – Wiring LED light strips in car

ledusb

I'm trying to connect an led light strip in my car. The light strip is powered
via USB, however, just connecting it to the 12 socket with an adapter or a USB port would leave
the lights on all the time. So, I was wondering if it was possible to splice the
USB cable and put a mosfet in to be able to automatically turn the leds off. The source and drain be in between the 5 V USB power or ground and then
connect the gate to a 12 V accessory wire that is only hot when the key is in the
ignition, thus turning the LED strip on and off with the key being in the ignition.

Wondering if this is feasible or if anyone has any other suggestions for how to do this.

Thanks

Like so:

enter image description here

Best Answer

Your original schematic isn't clear but I think you're trying to use the N-Channel MOSFET as a switch. Since I don't know the current required by your LED strip you should spec one out yourself. This video gives a great introduction to MOSFETs. Below is an explanation for each of the components used.

R1 - current limiting resistor to limit the gate current to reduce voltage oscillations

R2 - pull down resistor to avoid spurious activations by creating a defined voltage level at all times

R3 - load resistor that represents the position of your LED strip in the whole schematic.

schematic

simulate this circuit – Schematic created using CircuitLab

As others have mentioned, it may be easier to just power the LED strip from a source that's controlled by the ignition. If it's a 12V supply you'll have to use a voltage regulator like the LM7805 to reduce the voltage. It's only rated for about 1A though. If your strip needs more consider a buck converter.