I've build a LED strip controller using NodeMCU and a transistor STP16NF06FP according to the schematic below:
enter image description here

LEDs were powered with 24 V power supply and I want to regulate it by changing the voltage using PWM on mcu. So for the simplicity's sake I output 255 on PWM pin D5 and the voltage output is ~16 V instead of ~24V also LEDs are flickering.

When I power NodeMCU from USB instead of voltage stabiliser then it is not flickering, but the voltages remain the same.

How to get rid of flickering and get a higher voltages? Max power output from power supply is 0.5 A and it is enought to power LEDs.

When I mount IFRZ44N instead of STP I get ~16 V but the LEDs barely light.
With TIP120 there is no flickering but the output is ~16.7 V (so still a voltage drop, I wanted to replace to MOSTFET as these should have less voltage drop than NPN).

Here is the code for NodeMCU https://bitbucket.org/mdczaplicki/smarthome/src/master/node_mcu/node_mcu.ino

  • \$\begingroup\$ Is the LED strip rated for 24 VDC operation ? \$\endgroup\$
    – Russell McMahon
    Jul 26, 2019 at 14:00
  • \$\begingroup\$ @RussellMcMahon correct \$\endgroup\$
    – Marek
    Jul 26, 2019 at 14:13

1 Answer 1


The STP16NF06FP requires 10V Vgs to drive it reliably fully on. You are giving it 3.3V approximately.

You either need to find a logic-level MOSFET that is rated for 3.3V or lower Vgs or make a gate driver circuit to give more voltage to the gate.

  • \$\begingroup\$ According to my datasheet Vgs is 20 V, but I see now. Is it smart to use second transistor to control this one or is it an overkill and I should buy for example: PSMN2R7-30PL? \$\endgroup\$
    – Marek
    Jul 26, 2019 at 14:20
  • \$\begingroup\$ If your PWM frequency is slow you could use a jellybean NPN BJT with a base resistor and pullup to +12. Eg. 1K for each resistor. 1/4W for the pullup. PWM logic is reversed (high = off). \$\endgroup\$ Jul 26, 2019 at 14:23
  • \$\begingroup\$ I've got no 12 V in my circuit, though isn't TIP120 an NPN BJT? I think I will go with logic level mosfets, maybe I will buy more of them just to have them. Is there any you could recommend for my specification? \$\endgroup\$
    – Marek
    Jul 26, 2019 at 14:41
  • \$\begingroup\$ You could add a 78L12 or 78M12 etc. For only 0.5A I'd probably use a AO3400A because I happen to have a reel of them on hand, but the SOT-23 is pretty easy to fry if anything bad happens (like input floating) so a 10K-100K gate-source is a good idea. \$\endgroup\$ Jul 26, 2019 at 14:45
  • 1
    \$\begingroup\$ Marek, the 20V spec on Vgs for the 16NF06FP is the absolute max voltage. The recommended drive voltage to turn the FET fully ON is 10V. \$\endgroup\$
    – rothloup
    Jul 26, 2019 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.