MOSFET and Resistor selection


New member
Just looking for a quick gut-check on choosing an appropriate MOSFET and calculating the resistors properly. I'm a software guy and never really "got it" with electronics.

I have done this same setup with an older Teensy 3.x and a TIP120 MOSFET, but am now using a Teensy 4.0 and notice that the max pin current is lower so I'd rather not fry it (and my research suggests that the TIP120 is not the best choice for several reasons aside from lack of availability).

I'm using the PWM pins for dimmable lighting using white 3.3v/20mA LEDs varying from 6 at a time up to 40 so I need up to 800 mA (my diagram only shows 3 for simplicity).

I'm using an external 5V/6A power supply, and landed on this MOSFET:

Have I selected an appropriate MOSFET and have I calculated the resistors correctly?

And follow-up, If I wanted to do the same thing with a 24V RGB LED strip, I'd be looking at this MOSFET:

TIA for your input!

In terms of the FETs, yes, both of those should be good. In fact both should be OK for either use, the second one is a little better but either would do.
If your LEDs are 3.3V and 20mA and your power supply is 5V then you need to drop 5 - 3.3 = 1.7V in the resistor. 1.7V at 20mA means the resistor should be 1.7/0.02 = 85 ohms or more. So 100 is good.

The 600 ohm resistor between the FET gate and the PWM output is not needed, you can ditch that. You need that for a bipolar transistor, for a FET it's not needed.
The 1k pull down on the PWM output could be a lot weaker (say 10k-47k), the only need for that is to turn the LEDs off when the processor isn't running / during startup.

If current through the FET is a concern you an always use more than one. Put half the LEDs on each FET and connect the gates together.

Also not for this instance but to give a more general solution, if your power supply is more than twice the LED voltage (not the case with a 5V supply and 3.3V LEDs) then putting two or more LEDs in series reduces the part count, gives more consistent brightness and is lower power. So generally a win-win if you can do it.