# Motor activation using MOSFET

I need to switch a motor on and off by cutting it's battery connection and even though I could use a relay, I would rather to use a MOSFET, so things will be smaller and quieter.

The problem is, I am not sure about the best way to activate the MOSFET. It will be connected directly to he battery, so the load will be just after the MOSFET, which prompts me to use a P-Channel MOSFET...BUT the battery will be around 10V (7 cells of NiMH) and the MCU controlling the MOSFET will have a 5V signal, so the MCU won't be able to turn the MOSFET off, since 5V will still left the P-Channel MOSFET conducting.

The first thing that comes to my mind is to use a BJT to control the MOSFET and the MCU will control the BJT...but I wanted to ask in here first if there are other options out there, and ask for recommended circuits.

I am also concerned about flyback diodes, because since the motor is in a sealed box, there is no way I can place a diode in parallel with it to avoid voltage spikes around the MOSFET, so alternatives are most welcome (but please avoid saying "hey what about a relay", because this option I already know, and I am looking for new ones :D ).

• MOSFETs already have a parasitic reverse diode. Aug 22, 2013 at 3:59
• Yes, but it won't function for this case, since it will not be in parallel with the load, or providing a return path Aug 22, 2013 at 5:29
• @Ignacio: the parasitic diode would have to be a zener to limit the drain voltage. You really need a diode parallel to the motor. Aug 22, 2013 at 8:10

Depending on the current needed by the motor, select a suitable N-channel MOSFET as a low side switch:

simulate this circuit – Schematic created using CircuitLab

The flyback diode need not be physically at the motor coil - if the motor is not accessible, using a diode on the control board will work too - subject to somewhat greater EMI. Depending on the parasitic diode of the MOSFET for flyback voltage inhibiting is a really bad idea: Those body diodes typically have poor characteristics - High Vf and slow switching.

The MOSFET indicated here, IRLML2502, is a really inexpensive logic level MOSFET which turns on quite well at 4.5 Volts gate voltage, for motor current of ~ 3.4 Amperes. If you need greater current, alternatives like the OnSemi NVTFS5826NL can be used instead (20A @ 60V).

The low value gate resistor inhibits ringing, and limits current spikes from the GPIO pin. The pull-down ensures that the MOSFET remains off while the microcontroller is starting up or in high impedance state.

• How's the diode in the control boad circuit? Aug 22, 2013 at 5:33
• Oh, the diode's very well... and how are you? :-) (Sorry, please clarify what you mean by that comment) Aug 22, 2013 at 5:35
• Hahaha...well you said "using a diode on the control board will work too"...so my question was "how this circuit looks like, since the diode will not be in parallel with the load?"....or simply, can you post another image showing the diode in the control board? Aug 22, 2013 at 12:11
• Notice that the diode (marked "Power Schottky"), is in parallel with the load i.e. the motor. I have added a dotted line to indicate where the board ends and the motor's leads begin. Aug 22, 2013 at 12:48
• Oh I see...well maybe I can do it this way...I didnt remember the sealed box after all the modifications will be just the motor leads... Aug 22, 2013 at 12:56

The N channel drive is the preferred option but using a P channel device with a BJT is also good so no problems there. A third option is this: -

If the MCU output is 5 V, the zener will not be conducting anything other than a handful of micro amps. The pull-up resistor (about 2k2) will ensure no more than 10mV is biasing the P channel gate i.e. it is turned off.

When MCU line goes to 0V there will be about 4.4V across the MOSFET's gate and this will turn it on. Caution - if the supply can drop to (say) 8V this should still work providing the MOSFET $V_{GS(threshold)}$ is suitably low.

• Interesting...that's why I like to ask things in here, always a good opportunity to learn new stuff... Aug 22, 2013 at 12:17