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

**URL:** <https://forums.pimoroni.com/t/best-way-to-control-a-12v-pc-fan-with-raspberry-pi/4016>\
**Category:** Projects\
**Created:** [February 17, 2017, 9:16am UTC](https://forums.pimoroni.com/t/best-way-to-control-a-12v-pc-fan-with-raspberry-pi/4016 "2017-02-17T09:16:59Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [February 20, 2017, 10:24am UTC](https://forums.pimoroni.com/t/best-way-to-control-a-12v-pc-fan-with-raspberry-pi/4016/19 "2017-02-20T10:24:42Z")

</div>

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.

---

_[View the full topic](https://forums.pimoroni.com/t/best-way-to-control-a-12v-pc-fan-with-raspberry-pi/4016)._
