Electronic – n-channel mosfet as motor controller

mosfetraspberry pi

I am new to electrical engineering and I am trying to run an n-channel MOSFET (this one) as a PWM switch to a motor. Following some tutorials online I have this setup for my circuit.

schematic

simulate this circuit – Schematic created using CircuitLab

When I try to run this circuit, even with no input to the gate, the motor always runs and the MOSFET heats up. The source-drain voltage is 30 max and I'm only running 24V.

Best Answer

When I try to run this circuit, even with no input to the gate, the motor always runs and the MOSFET heats up.

With no gate input, it will float and quite possibly turn on the MOSFET - do not run a MOSFET with a floating gate. So, it's quite possible you may have damaged the MOSFET and it will act like a partial short circuit thus the motor always runs.

The next problem is your general circuit. You have wired the MOSFET as a source follower and this is no good for what you want. With an N channel MOSFET this is the best configuration: -

enter image description here

Picture taken from here

Note the use of a diode or snubber network connected across the motor to prevent back-emfs destroying the MOSFET. You also need to pick a MOSFET that adequately turns on with only 3.3 volts gate-source drive.