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?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
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.