MOSFET to control DC computer fan speed?

I have an old 3 wire computer DC fan. Just for fun and learning sake I am trying to build a speed control circuit and corresponding software.

I already wrote some code to measure the RPM from the sense pin and that works fine. My next goal is to have an RPM setpoint in Arduino code and I want to be able to control the fan speed via software to continually adjust it and make sure the measure equals the set point.

At first my goal was to just use a fake PID approach but eventually I want to implement a true PID loop.

Can I use a mosfet to control the fan speed? And do I want to smooth out the Arduino PWM (with low pass filter) into a voltage before feeding it into the gate or do I want to feed straight PWM signal into the mosfet gate?

Good questions. Old computer fans don't allow a pwm signal on the 12V. In that case you need to smooth the pwm into a voltage. You can use a mosfet.

Search for AVR442, that is an Atmel application note for manufacturers of PC fans.

What would happen if I did put a PWM signal on the 12V line? Would it be like unstable or something?

Search for AVR442, that is an Atmel application note for manufacturers of PC fans.

Ok, I will take a look at this.