Not really. The IRF540 requires around 10v to fully turn on. Look for a logic level mosfet. The L in IRL indicate logic level.
Google IRL540 alternative or logic level mosfet, there are many suitable ones.
This reply was modified 1 year, 10 months ago by Martyn.