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