Arduino MOSFET Project

If you’re familiar with Arduino, you’re likely aware of the frequent need to incorporate motors into projects, especially those involving robotics. In a previous tutorial, we discussed using a transistor to control small motors. But what if you find yourself needing to control a larger motor? The solution to this requirement lies in using a MOSFET. As defined by Wikipedia:

A type of field-effect transistor (FET). It has an insulated gate, whose voltage determines the conductivity of the device. This ability to change conductivity with the amount of applied voltage can be used for amplifying or switching electronic signals.

Put simply, a MOSFET is a specific type of transistor that employs a Gate rather than a Base (contrary to the bipolar transistor). Notably, the Gate in a MOSFET is isolated, rendering it considerably safer for use with Arduino. While there is more to the intricacies of MOSFETs, we won’t delve into those details in this session. For our purposes, we’ll be working with the IRF44N MOSFET, a highly economical and widely used field-effect transistor.

Arduino Mosfet

mosfet

Here is the list of parts we will need for this project:

You can use any other transistor, check out its pinout and datasheet to ensure that it can be used with the rating needed for this project.

If you have all of the components that we need, you can connect them using the schematic below.

arduino mosfet diagram

To power this circuit, we need an external power supply of 12V, but a 9V should be ok as well. You can connect it to Arduino with the DC jack.

It is very useful to use cables with crocodile clips to connect jumpers to the motor; they will hold safely and help you avoid soldering.

Connecting Arduino with a mosfet

arduino mosfet project

arduino mosfet

We can use the analogWrite function to control the motor speed with a PWN signal.

If you use a relay to control your motor, you will not be able to control it with the PWM signal. Relay responses will be too slow for such applications.

The code will increase the motor speed, slow it down, and do that over and over again. Here is the code:

As you can hear, when it is not moving, it makes odd sounds. That’s because of the current that flows through the motor coils.

And here we go! Don’t hesitate to comment below if you need further information about this project.

Feel free to check other projects here.

You might also like:

3 thoughts on “Arduino MOSFET Project”

  1. Fritzing pictorials ARE NOT schematics! A pet peeve on the maker community is that misunderstanding.

    Too many of my electrical engineering students see articles like this, which are otherwise helpful, but leave thinking they know what a real schematic looks like. The pictorial may me ok for a novice with a simple circuit but it fails with larger more complete ones.

    Btw you did not label the fet pins. Gate to pwm, source to griund, drain to motor (load).

  2. We thought schematic might be too complex for beginners. So we decided to use Fritzing pictorials which turn out to work like a charm. I am still looking for a name that could describe it better than “schematics”
    Thanks Mark!

Leave a Comment

X