I'm developing an automation board and want the facility to PWM dim a strip of LEDs up to 5-10 amps @12 V.

These are plain 2 wire LED strips, positive and negative, nothing special.

My esp32 will be powered via a buck converter from a variable input and I will also have a regulator to level out the 12 V supply.

I have seen projects using the TIP120 for this but I'm not too comfortable with it being at max capacity so I'm leaning toward a MOSFET. Any suggestions on the best way to power the MOSFET through PWM with 3.3 V logic?


1 Answer 1


I suggest using a N-channel MOSFET, connected between GND and the "-" of the LED.

There are 3 things to check when choosing the N-channel MOSFET :

  • that it is fully turned on with only 3.3V (this will eliminate many mosfets) : look for those with a low threshold voltage (well under 3.3V), and then check on the curves if it is really turned completly on at 3.3V
  • check that with 3.3V on the gate, the mosfet can carry enough current for your application
  • check that the mosfet can handle the heat without extra heatsink (or plan to add the heatsink, but be carefull that even that might not be enough). As a rule of the thumb, the bigger the current rating, the less risk of overheating


simulate this circuit – Schematic created using CircuitLab

Note that you will need the R1 resistor to limit current in your LEDs (excepted if they are already "12V LEDs", in which case they have it probably already included).

Optionnaly, you might want to add a resistor (something like 10k) between gate (ie the pin of the mosfet connected to PWM) and ground to make sure the mosfet is turned off when the esp32 is off (or resseting).

If you choose a really huge N-channel MOSFET, you might need to add a resistor in series between PWM and the gate to limit the current when switching the mosfet (huge N-mos have non negligible capacitance between gate and ground), but it you can avoid it, it's best (adding it makes the mosfet switching slower, therefore increasing the heat produced in it)

  • 1
    \$\begingroup\$ Please can you fix your answer: N-MOS is a technology, not a component type. These are N-channel MOSFETs, so MOSFET instead of N-MOS. \$\endgroup\$
    – TonyM
    Commented Jan 27, 2022 at 11:48
  • \$\begingroup\$ @TonyM : done. I was always thinking N-MOS was justthe short for N channel mosfet \$\endgroup\$
    – Sandro
    Commented Jan 27, 2022 at 12:20
  • \$\begingroup\$ I have seen suggestions about using a transistor connected to the 3.3v and 12v then from this into the mosfet, 1 extra component isn't too much hassle. Regarding the LED strips they have internal resistors and are suitable to be connected directly to 12v source. I had also read that i would need a resistor between 3.3 and ground to prevent it being pulled low? \$\endgroup\$
    – robbrown92
    Commented Jan 27, 2022 at 12:31
  • 1
    \$\begingroup\$ 3) Where do you get that information that you need a resistor between 3.3V and ground? It would be completly useless (excepted for waist some energy). What might be usefull, is a resistor between gate and GND or 3.3V, depending if you want the LEDs to be on or off by default (ie if the esp32 is not powered, during reset, ...). If you don't care, then no need for this resistor (nb : do not use 2 resistors : either you use one, or none) \$\endgroup\$
    – Sandro
    Commented Jan 27, 2022 at 12:46
  • 1
    \$\begingroup\$ @robbrown92 and a one more thing to add - you don't need a high frequency PWM for LED as the eye won't notice anything starting from around 100-200 Hz. So if you get a MOSFET with logic level gate and low gate charge (gate capacitance) when you don't need a series resistor and you can drive it directly from MCU pin. There are some models which fits your needs driving up to 10A @ 3.3Vgs \$\endgroup\$
    – NStorm
    Commented Jan 27, 2022 at 13:02

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.