# How do I control a small dc motor with a mosfet?

I'm trying to figure out how to use a mosfet in order to allow me to use a small voltage to switch a larger voltage / current driving a motor. My son wants to write a program to control his small rc car, and controlling the motors via something like this seems like a good way to go.

I read this page, https://oscarliang.com/how-to-use-mosfet-beginner-tutorial/ -- and I got some irf520n mosfets, connecting them up as pictured.

The large battery pack positive output is connected to the source on the mosfet, and the then I have a wire from the drain to the motor, then from the motor to the negative output of the large battery pack.

I have the small battery pack, intended as a switch, connected positive to the source, and negative to the gate.

At least from reading that page, and trying this, I believe that's what I've set up, but it's not working. When I turn on the large battery pack, the motor runs, regardless of whether the small one is turned on or not. Pretty new to all this, so any tips are much appreciated.

I did notice while researching this question that irf520n mosfets are not logic level mosfets, so the 3v I'm applying might not be enough, but the data sheet here: http://www.infineon.com/dgdl/irf520npbf.pdf?fileId=5546d462533600a4015355e340711985 looks to me like it the switch should work with between 2 and 4 volts (it has VGS(th) min of 2 and VGS(th) max of 4 on the data sheet).

• For an N-channel MOSFET, the positive battery terminal goes to the motor, the other motor terminal goes to the DRAIN, and the source is connected to ground. That will make it easier later to hook it up to other circuits. Feb 11, 2017 at 0:45
• If your big battery pack is less than 20V, you can just use the + voltage from your big pack to control the gate. If you can't get it to work, check all your wiring, but MOSFETs are very susceptible to getting destroyed from static shocks while handling -- you may want to try a fresh one. Feb 11, 2017 at 0:47
• thanks for the tips Daniel, after reading your 2nd comment to use the + voltage to control the gate, I realized that I was connecting the negative to the gate on the smaller pack. When I switched to positive to the gate, all works :) if you want to post an answer, I'll be happy to accept it. Feb 11, 2017 at 0:56
• You probably want a flyback diode or some kind of snubber across that motor. Feb 24, 2017 at 18:32