I'm trying to find a way to connect a DC motor to a IRF520 MOSFET Driver to a Raspberry Pi 2 to then to control the DC motor. I'm new to electronics and I haven't found any clear solutions.

What do I need to do?

  • Which part is causing the problem? It would be a courtesy if you gave links to the items you are using rather than expecting people to search.
    – joan
    May 11, 2016 at 10:41
  • here is driver module gearbest.com/sensors/pp_226185.html
    – JGF1994
    May 11, 2016 at 10:48
  • It's best if you edit your question and add useful information there.
    – joan
    May 11, 2016 at 10:51

1 Answer 1


That's not really what I would call a motor driver board.

For low current operation I'd be looking at L298N, or L293D, or L9110S based boards. They let you drive a pair of motors forwards and backwards.

The IRF520 does have the advantage of providing more power which may be why you want to use it.

Anyhow connect V+ and V- to your DC motor (if the motor doesn't spin in the direction you want you will need to swap the leads).

Connect VIN to the motor power supply +ve. Connect GND to the motor power supply -ve.

Connect VCC to a Pi 3V3 pin (pins 1 or 17). Connect GND to a Pi ground (say pin 6) and connect STG to a Pi GPIO (say 4 on pin 7).

To start the motor (full speed) set GPIO 4 high. To stop the motor set GPIO 4 low. To control the motor speed send PWM pulses on GPIO 4.

A PWM pulse just means switch the GPIO rapidly on and off, varying the ratio of on to off to control the speed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.