Ground level noob here, started to tinker with electronics at the beginning of this year after I couldn't get any electronics shop in my town replace my bike's gauge cluster SMD LEDs.

I learned few things last few weeks and now I'm at the mosfet stage. I want to control the headlight with mosfet and I managed to assemble a code for Arduino IDE that controls the LED the way I want, tested the 12V 25W LED bulb on my desk with bench power supply and Arduino hooked to buck converter, with the LED bulb controlled with a breadboard size pushbutton and a mosfet. I bought the wrong (high Rds, not logic level) nMOS at first, but learned to read some specs and got IRL2203 that operates the light and keeps cool with no heatsink.

The challenge is how to install it in the vehicle while keeping the original controls intact and without adding anything extra. I am going thru YouTube vids on schematics and trying to figure out where in the "headlight circuit" should I tap in with the Arduino and mosfet. One thing that kind of worries me now, I'm starting to think I planned this wrong going with the nMOS and all, I highlighted all the headlight-relay wires and it seems that pMOS would be the correct choice to tap into these wires, and accessing ground wires for nMOS would be too challenging?

As I'm not well versed in these, please let me know what can I do here.

One idea I had was completely remove headlights from the circuit, from the relay and everything, and run a separate circuit from headlight fuse? Just thinking out loud :D Let me know how would I go about solving this, cheers

enter image description here

  • \$\begingroup\$ Arduino, MOSFET, motorcycle and headlights are words that do not go together well. Your headlights should be considered safety critical system. Please be careful. \$\endgroup\$
    – Transistor
    Commented Mar 25, 2021 at 22:55
  • \$\begingroup\$ Be advised, if your headlights turned out later to be even a factor in a car crash, your insurance would likely be void for using non/substandard parts. \$\endgroup\$
    – K H
    Commented Mar 26, 2021 at 8:57

1 Answer 1


I would say yes to your last thought.

enter image description here

Just keep those two separated from the whole circuit and hook your arduino and mosfet there. Keep the connections from the rest of the circuitry as little as possible.

For example you can take the output from this "LIGHNING SWITCH" and use it as an input to your arduino. When you press the switch, the arduino will sense it, the lights will turn on.

enter image description here

Something like this will do the trick:


simulate this circuit – Schematic created using CircuitLab


Regarding the N-mos, P-mos, this is a picture of my noted regarding those:

enter image description here

N-mosfets have lower internal resistance (Rin) (look in mouser.com for the mosfets, play with the N/P- chanel filters and check the Rin differences between the N channel and P-channel (Ignore the NPN, PNP etc options)

N-channel mosfets are easier to use when put on the low side (since you control Vgs, and you have a steady GND at source, you can play with the V at the gate. (This is why i have an "L" box on my notes, its where i put the "Load").

Also, enhancement type means it turns on when the Vgs is (lets say for logic mosfets) 5[V] or more. Depletion type means the fet turns on when Vgs is 0[V] or less.

Having said that, if you check on mouser, P-channels have easily 10 ohms of Rin (huge huge!) N-ch can easily have 0.009Ohms of internal R.

Also, if you check on Mouser the "Depletion type", you will notice that there are no P-channel mosfets with Depletion type. That is, becouse they are expensive to manufacture, they have higher Rin, no one wants them.

This leaves you with enhancement type P-channel mosfet. So, If you want to power your bulb with 12V, you put it on the low side, how will you turn it on? you need Vgs = 5V, you will need another supply of 12+5=17V, like this:


simulate this circuit

That is why, it ususally is a bad idea to use a P-ch. Only when you really need a device (load) to be connected to the GND directly, you would put a P-ch there (like if you wanted to power a computer, motherboard, MCU etc)

  • 1
    \$\begingroup\$ Yeah the more I dig into these things the more I appreciate how complex these things are, and how much thought and planning went into it - and how far I am from that methodical approach :D separating the circuit for headlights is good approach - what would be the problem if I went with pMos, logic level? \$\endgroup\$
    – Varonne
    Commented Mar 25, 2021 at 22:15
  • \$\begingroup\$ Hmm let me edit the answer to include what happens with pmos \$\endgroup\$ Commented Mar 25, 2021 at 22:18
  • \$\begingroup\$ Thanks a bunch for the detailed explanation! I'm looking at the wiring diagram...and the idea of separating headlights, what about actually tapping into headlight wires, just before the bulb connectors? Unplug the headlight relay and run two nMos from the headlight grounds? \$\endgroup\$
    – Varonne
    Commented Mar 25, 2021 at 22:58
  • \$\begingroup\$ something like this - i.imgur.com/gndCPCU.jpg \$\endgroup\$
    – Varonne
    Commented Mar 25, 2021 at 23:06
  • 1
    \$\begingroup\$ Bad idea to interrupt the grounds. By doing this you open up the possibility of ‘sneak circuits’ ie paths that aren’t obvious. The positive side is switched for a reason. I’d suggest using automotive relays and using small mosfets to drive the coils. One thing to note - the fuses protect the wire. If you short your average piece of wire across your battery (not suggested you do this) the wire will melt and smoke. You don’t want this to happen. So use a fuse or ensure your power is via a fuse and the wire is rated for the fuse current. \$\endgroup\$
    – Kartman
    Commented Mar 25, 2021 at 23:15

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.