Okay, here’s my blog post about my experience comparing MOSFETs and relays:

So, I’ve been tinkering with a project lately where I needed to switch a higher-voltage DC load. At first, I reached for a relay, like I always do. But then, I thought, “Hey, I’ve got a bunch of MOSFETs lying around. Let’s see if those can do the job.” It was a bit of a learning curve, so I figured I’d share my whole messy process.
The Initial Setup (Relay Time)
First up, I went with my trusty relay. I grabbed a standard 5V relay module – the kind you see everywhere. Wiring it up was super simple. I connected:
- VCC of the relay module to the 5V pin on my Arduino.
- GND of the relay module to the Arduino’s ground.
- IN of the relay module to a digital pin on the Arduino (I used pin 7).
- One side of my load to the positive terminal of my higher-voltage power supply (12V in this case).
- The other side of the load to the COM (common) terminal of the relay.
- The NO (normally open) terminal of the relay to the positive terminal of my 12V power supply.
I wrote a quick Arduino sketch to toggle pin 7 HIGH and LOW every second. Click, clack, click, clack – the relay worked perfectly. My load (a simple LED strip, for testing) switched on and off without a hitch. It’s easy to set this, and I finished it soon.
The MOSFET Challenge
Next, I decided to try the same thing with a MOSFET. I dug through my parts bin and found an IRFZ44N, a pretty common N-channel MOSFET. This is where things got a little more complicated.

First, I needed to understand the MOSFET’s pins:
- Gate (G): This is like the “control” pin. Applying a voltage here turns the MOSFET “on.”
- Drain (D): This is where the current “flows out” of the MOSFET.
- Source (S): This is where the current “flows in” to the MOSFET.
I wired it up like this:
- Arduino’s digital pin (again, pin 7) to the Gate of the MOSFET. I added a 10k resistor between the Gate and Ground, to make sure the MOSFET turns off properly when the Arduino pin goes LOW.
- Arduino’s ground to the Source of the MOSFET.
- Negative side of my LED strip to the Drain of the MOSFET.
- Positive side of my LED strip to the positive terminal of my 12V power supply.
- Negative terminal of my 12V power supply to the Arduino and the Source pin, creating a common ground.
I used the same Arduino sketch as before. I flipped the switch, and…nothing. My LED strip stayed stubbornly off. Uh oh.
Troubleshooting the MOSFET
I spent a good hour scratching my head. I checked my wiring a dozen times. I even swapped out the MOSFET, thinking I might have fried it somehow. Still nothing.

Then, I remembered something crucial: MOSFETs need a sufficient voltage at the Gate to turn on fully. The Arduino’s 5V output might not be enough for the IRFZ44N, especially with a 12V load. This is called the “threshold voltage.”
This caused me a lot of trouble, and made me mad.
The Solution (and More Learning!)
I had two options: find a “logic-level” MOSFET (one that turns on fully with 5V), or boost the voltage going to the Gate. I didn’t have any logic-level MOSFETs on hand, so I went with the second option.
I use another way to boost it!

I grabbed an NPN transistor (a 2N2222, because that’s what I had) and used it as a simple switch to control the 12V to the MOSFET’s Gate. Here’s how I wired that up:
- Arduino’s digital pin (still pin 7) to the Base of the NPN transistor (through a 1k resistor).
- Arduino’s ground to the Emitter of the NPN transistor.
- 12V positive to the Collector of the NPN transistor.
- The Collector of the NPN transistor ALSO to the Gate of the MOSFET.
- The 10k resistor between the MOSFET’s Gate and Source stayed put.
- The rest of the MOSFET wiring stayed the same as before.
I rebuilt the circuit to the new one.
Basically, the Arduino now turns on the NPN transistor, which then allows the 12V to flow to the MOSFET’s Gate, turning it on. Finally! My LED strip lit up. Success!

The Result
I managed to use the MOSFET as a switch! I can control the switch with my command!
This whole experiment taught me a lot. Relays are definitely simpler for basic on/off switching, but MOSFETs offer advantages like faster switching speeds, no moving parts (so they’re more durable), and they can handle much higher currents if you choose the right one. But, you need to pay attention to things like threshold voltage and make sure you’re driving them correctly. It was a fun (and sometimes frustrating) learning experience!