# Controlling a Pi fan on the Pi Pico W

**URL:** <https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778>\
**Category:** Raspberry Pi\
**Created:** [29 November 2022 04:38 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778 "2022-11-29T04:38:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doug27394](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/doug27394/32/7961_2.png) [@Doug27394](https://forum.core-electronics.com.au/u/Doug27394)\
**Post date:** [29 November 2022 04:38 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/1 "2022-11-29T04:38:27Z")

</div>

Hi I’ve got a Raspberry Pi Pico W and I’m running the [Cooling Fan for Raspberry Pi | Core Electronics Australia](https://core-electronics.com.au/cooling-fan-for-raspberry-pi.html) off 3V3(out), pin 36. I know it’s a 5V fan, but it runs well on 3.3V and it’s much quieter.

I’d really like to be able to turn it on and off, I tried connecting it to a GPIO as it’s also 3.3V, but with the load of the fan it drops to 2.2V and it doesn’t work. I’m also a little worried it would be a bit bad for the pi.

I also thought about putting the pi in deep sleep, but that leaves 3v3 high, and that’s probably a good thing for most uses.

Any suggestions on how to do it? Will I just have to live with it constantly on?

---

<div class="post-metadata">

**Author:** ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)\
**Post date:** [29 November 2022 05:19 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/2 "2022-11-29T05:19:30Z")

</div>

Hi Doug,

Awesome project!

You’ll want some sort of driver to allow for higher current and voltages to flow through the fan, I’d go for this MOSFET module:

> **[Freetronics N-MOSFET Driver / Output Module](https://core-electronics.com.au/freetronics-n-mosfet-driver-output-module.html)**
>
> This high-power N-MOSFET module lets you switch high-current loads using a tiny microcontroller. Perfect for controlling that set of traffic lights mounted in your...

A circuit like this will let you use a logic high signal to turn the fan on:

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/d/da1471a4b38674a6d69d940302a9b88597b4c3f7.png)

There is already a 10k pull-down, but to bring the gate below 1.5V you’ll need to add a parallel 680 ohm or thereabouts.

While it skips the fun part of designing a circuit this fan has an inbuilt control wire: [Raspberry Pi 4 Case Fan | Core Electronics Australia](https://core-electronics.com.au/raspberry-pi-case-fan.html)

Liam

---

<div class="post-metadata">

**Author:** ![Doug27394](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/doug27394/32/7961_2.png) [@Doug27394](https://forum.core-electronics.com.au/u/Doug27394)\
**Post date:** [29 November 2022 07:01 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/3 "2022-11-29T07:01:52Z")

</div>

what about somethign like this? [How to Build an N-Channel MOSFET Switch Circuit](http://www.learningaboutelectronics.com/Articles/N-channel-MOSFET-switch-circuit.php)

![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/6/6afb2dac18dfcc211d65bec7f50d3a597ce4afe9.png)

except that it’s 3.3V for the gate, and the fan instead of the buzzer… and possibly 3.3V instead of 6V

Advantages:

- smaller
- cheaper

Disadvantages:

- my electronics knowledge if pretty basic
- it might not work 😉

The “smaller” is helpful as I’m a bit tight on space

 ![Pi Pico W Housing with fan](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/7/74efdc49d320630ca763b18e9af9fd8b4d4eb6b3.jpeg)

---

<div class="post-metadata">

**Author:** ![Liam120347](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam120347/32/5003_2.png) [@Liam120347](https://forum.core-electronics.com.au/u/Liam120347)\
**Post date:** [29 November 2022 07:04 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/4 "2022-11-29T07:04:54Z")

</div>

Hi Doug,

Yeah that should work fine as well, its best practice to also include a resistor(~120 ohm) inline with the gate pin).

If you are super space constrained using the Pi fan might be the best way to go 🙂

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [29 November 2022 07:46 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/5 "2022-11-29T07:46:03Z")

</div>

Hi Doug  
Good if you want the thing to be on at all times. The Mosfet will stay on even if the 3V is removed. Pretty much forever unless the internal gate capacitor is discharged to source somehow.

So no, I don’t think this circuit as drawn would be successful.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [30 November 2022 00:30 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/6 "2022-11-30T00:30:21Z")

</div>

Hi Liam & Doug  
That extra resistor IS NOT required with that module. I believe the Pico I/O should source and sink. A high will turn the Mosfet ON and a low turn it OFF. The module has a 1kΩ resistor in series with the gate to limit I/O current to a safe value and a 10kΩ resistor from gate to source to make sure the gate capacitor is discharged when power is removed. It is not a “pull down” in the true sense where it would be necessary if the driving I/O did not sink.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Doug27394](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/doug27394/32/7961_2.png) [@Doug27394](https://forum.core-electronics.com.au/u/Doug27394)\
**Post date:** [30 November 2022 06:16 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/7 "2022-11-30T06:16:12Z")

</div>

Hey Bob & @Liam ,

Thanks for your help. It works like a charm.

One last question:  
I’d like to shorten the cables a bit, is there an appropriate connector/crimping tool to make the ends plug into the header pins? I checked my local Jaycar and Altronics and they sayd they had nothing.

Ideally, something that’d let me do individuals, pairs (like jst), or 3 or 4

Thanks again

---

<div class="post-metadata">

**Author:** ![Liam120347](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam120347/32/5003_2.png) [@Liam120347](https://forum.core-electronics.com.au/u/Liam120347)\
**Post date:** [30 November 2022 07:15 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/8 "2022-11-30T07:15:06Z")

</div>

Hi Doug,

If its a permanent fixture could you solder directly to the pin? Otherwise female headers have worked for me in the past (and are usually on-hand).

A more formal approach may be to use these style of connectors: [Polarised Headers Australia](https://core-electronics.com.au/connectors-sockets/polarised-headers.html)

Most will work as long as they have the same pitch

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [30 November 2022 07:19 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/9 "2022-11-30T07:19:43Z")

</div>

These also have the advantage of 2.54mm pin pitch which means they will fit most things that have holes for “standard” headers.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![Rooppoor212784](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@Rooppoor212784](https://forum.core-electronics.com.au/u/Rooppoor212784)\
**Post date:** [6 December 2022 14:52 UTC](https://forum.core-electronics.com.au/t/controlling-a-pi-fan-on-the-pi-pico-w/15778/10 "2022-12-06T14:52:40Z")

</div>

You may find this helpful too:[How to control 5V fan speed using Raspberry Pi Pico PWM and MicroPython? - Raspberry Pi Stack Exchange](https://raspberrypi.stackexchange.com/questions/138791/how-to-control-5v-fan-speed-using-raspberry-pi-pico-pwm-and-micropython)
