2
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ I had it backwards in the drawing originally when Andy posted. The current configuration is how I have it wired. I think it matches the current flow of the image in the answer below. \$\endgroup\$ – DSchana Feb 17 '18 at 19:44
  • \$\begingroup\$ Yea it is. I can flip it. Make it easier to read. \$\endgroup\$ – DSchana Feb 17 '18 at 19:54
  • \$\begingroup\$ Is the wiring still incorrect? \$\endgroup\$ – DSchana Feb 17 '18 at 19:56
  • \$\begingroup\$ That's better. Now add a pulldown keeper resistor on the gate. If the motor still spins with the pi unconnected to the gate, the FET is blown and needs to be replaced. Though with only 3.3v drive to work with, the FETs which are likely to be the best choices may only be available in surface mount packages; fortunately often fairly large and easy to solder ones. What sort of motor is involved? \$\endgroup\$ – Chris Stratton Feb 17 '18 at 19:58
  • 1
    \$\begingroup\$ @DSchana - In addition to the comments and answer(s) already given by others, I recommend you research MOSFET gate drive ICs. These ICs are available with inputs that are compatible 3.3 VDC logic. Try an Internet search using keywords like "MOSFET gate driver" and "MOSFET IGBT driver". Various semiconductor manufacturers publish application notes (a.k.a., white papers) on this topic and related topics--e.g., high-side vs. low-side switching, bootstrapping, etc.--that are well worth reading. \$\endgroup\$ – Jim Fischer Feb 17 '18 at 22:52
3
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Datasheet check: this MOSFET is not rated for 3.3V gate drive (contrary to what the seller's website says...) so the 74HCT gate is indeed necessary... \$\endgroup\$ – peufeu Feb 17 '18 at 13:57
  • \$\begingroup\$ @peufeu the datasheet says max gate threshold voltage is 2.35. Am I looking at the wrong spec for gate voltage? \$\endgroup\$ – DSchana Feb 17 '18 at 15:32
  • 2
    \$\begingroup\$ At the "threshold voltage" the transistor only begins to turn on. The useful spec is the maximum RdsON "Static Drain-to-Source On-Resistance" which is given at Vgs=10V and Vgs=4.5V in the datasheet. There is no guarantee for 3.3V, so it may work, or maybe not, depending on luck. If the transistor turns partially on, it will act like a resistor, overheat, then burn. Then as everything melts inside, the gate will short circuit to the drain, and your Raspi will get the full 24V on its IO pin and also die. \$\endgroup\$ – peufeu Feb 17 '18 at 15:55
  • 1
    \$\begingroup\$ "TTL" refers to the logic levels this chip uses, which are the same as oldskool TTL chips from previous century. Since your Pi outputs 0-3.3V and you need to drive the MOS with 5V, you will use a chip powered from 5V as gate driver. A 74HC chip running on 5V may not consider the 3.3V level output by the Raspi to be a logic "1". So instead use a 74HCT logic gate, which respects TTL logic levels (thereshold voltage is lower), and will interpret 3.3V as a logic "1". \$\endgroup\$ – peufeu Feb 17 '18 at 15:59
  • 1
    \$\begingroup\$ Additionally you can put a resistor between the Pi and the driver, perhaps 22k, so if the FET burns, it will probably kill the driver, but the resistor will protect the Raspi. \$\endgroup\$ – peufeu Feb 17 '18 at 16:00

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.