LEDs much dimmer with MOSFET

I'm trying to build a wifi dimmer for an LED 24v strip and have it working with a IRF540N MOSFET, but even at the brightest setting, it's much dimmer than if I hook the strip directly to the 24v/2a power supply.

Please post according to the forum guidelines.
We need more information to answer this question.

The IRF540N is not a logic level mosfet, and can't be fully opened with a 5volt Arduino, and maybe not at all with a 3.3volt Arduino. All also depending on the length (current draw) of the (unspecified) LED strip.
Leo..

WiFi? So are you using an esp chip (esp-01, Wemos D1 mini, nodeMCU etc) rather than an Uno/Nano? If so, analogWrite(pin, 255) is only 25% brightness. Try analogWrite(pin, 1023).

If that does not help (and I don't think it will because of what Wawa says), try an ordinary npn transistor between the Arduino and the MOSFET, such as bc337. Connect its base to PWM pin with 10K, collector to the MOSFET gate, emitter to ground, 10K from the MOSFET gate to 24V. This will invert the dimming, ie. analogWrite(pin, 0) will be full brightness and analogWrite(pin, 255) or analogWrite(pin, 1023) will be off.

One more thing: you must connect the Arduino ground to the 24V PSU ground.

I'm using a NodeMCU wired to a LED strip with dual LEDs (warm and cool) so that I can control the CCT. LED strip is 24V/2A, 1A per LED circuit: LED strip

I'm roughly following the layout described in wiring model.

The plan is to implement these with PoE, so the wifi might not be necessary, but also contemplating simpler LV wiring to power the board and LED with a centralized transformer. Just keeping the options open.

The dimmer is working, but not bright so I suspect the issue is that I have analogWrite() with 255 as full brightness.

Thanks for the help.

analogWrite(pin,1023) improved it but still not as bright as full 24v. Switch to a IRLB872 and all is good.

Thanks again for the help.