HELP Scouting project

hi I want to control a 12v motor with a PWM signal. i want the speed to vary according to the speed of an wheel turning. For measuring the speed of the wheel ill use an IR speed sensor (image attached)
can someone please help me with the code and mosfet selection. The pump draws 1.5A at 12v max

greetings jim vogelzang

If the wheel were turning at 10% speed, what will the pump speed be, in per cent (0 ~ 100%)? At 100% speed (0 ~ 100%)?

Use a logic MOSFET, not any MOSFET. Connect the MOSFEET to the negative side of the motor. The other pole of the motor connects to +12.