Best way to control a 12v PC fan with raspberry pi?

My wiring solution was just stuffing male-to-male jump wire into the holes on the fan connector, and then into the screw terminals of the Automation HAT. I think if you were going to do things properly, you’d strip and tin the wires to connect directly, or fine a little connector with bare wire tails.

@RacingtoMars your point about the built-in motor controller certainly sheds some light on why I was getting my PWM signal superimposed on the hall-effect sensor output. In retrospect, I don’t know where I thought the sensor was going to be getting power :D

If full tilt isn’t essential, then I guess it becomes a case of picking a constant voltage that drives the fan at the appropriate speed.

For switching on/off you could use either the sinking output driver (ULN2003A) or the relay on Automation HAT. Or just any similar board with a relay.

Wire your fan up as normal to the power supply, but route the positive side through the relay’s COM and Normally-Open terminals.