PWM Fan Control of the Raspberry

197 views
Skip to first unread message

Marc Hamilton

unread,
Sep 5, 2023, 11:37:44 PM9/5/23
to PicoChess
Here's video showing a Noctua PWM fan installed on a Ice Tower of a Raspberry Pi 4b that comes on when a temperature threshold is reached, and shuts off again when its 10C lower. 
This fan can be purchased off Amazon for about $16.99 USD. 
Make sure you source the 4-Pin model with PWM control. The 3-Pin model will not work. 

The GPIO wiring is fairly simple and I have it in the both the description of the video and an inset at the conclusion of the video. 


Marc
Message has been deleted

Marc Hamilton

unread,
Sep 7, 2023, 10:27:42 PM9/7/23
to PicoChess
Here's a second video where a the fans RPM's is controlled based on temperature.  I used a Python script, I downloaded (source is in the description of the video) and call it into memory in from the rc.local at bootup. 

Andrea Gatti

unread,
Oct 12, 2023, 9:51:42 AM10/12/23
to PicoChess
Hi Marc,

I've just received my Noctua 4-wires fan, and I'm about to implement your solution to control the fan speed, based on temperature.

One question: is your solution monitoring and varying the fan speed continuously? Shall put the script in cron?

(Sorry I haven't looked at the script yet, just wanted to understand if I need to take any specific steps to make sure it run continuously. )

Thanks

Andrea

m371...@gmail.com

unread,
Oct 12, 2023, 11:42:43 AM10/12/23
to pico...@googlegroups.com

I’m playing on chess.com… I’ll answer your question in a few minutes…

 

 

Sent from Mail for Windows

 

From: Andrea Gatti
Sent: Thursday, October 12, 2023 6:51 AM
To: PicoChess
Subject: Re: PWM Fan Control of the Raspberry

 

Hi Marc,

 

I've just received my Noctua 4-wires fan, and I'm about to implement your solution to control the fan speed, based on temperature.

 

One question: is your solution monitoring and varying the fan speed continuously? Shall put the script in cron?

 

(Sorry I haven't looked at the script yet, just wanted to understand if I need to take any specific steps to make sure it run continuously. )

 

Thanks

 

Andrea

Il giorno venerdì 8 settembre 2023 alle 04:27:42 UTC+2 m371..@gmail.com ha scritto:

Here's a second video where a the fans RPM's is controlled based on temperature.  I used a Python script, I downloaded (source is in the description of the video) and call it into memory in from the rc.local at bootup. 

 

 

On Tuesday, September 5, 2023 at 8:37:44 PM UTC-7 Marc Hamilton wrote:

Here's video showing a Noctua PWM fan installed on a Ice Tower of a Raspberry Pi 4b that comes on when a temperature threshold is reached, and shuts off again when its 10C lower. 

This fan can be purchased off Amazon for about $16.99 USD. 

Make sure you source the 4-Pin model with PWM control. The 3-Pin model will not work. 

 

The GPIO wiring is fairly simple and I have it in the both the description of the video and an inset at the conclusion of the video. 

 

 

Marc

--
You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/IEH2Y4uo7Ew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/e21ad693-2ec9-4930-ba68-cbdadd00fd1an%40googlegroups.com.

 

m371...@gmail.com

unread,
Oct 12, 2023, 11:51:01 AM10/12/23
to pico...@googlegroups.com

Yellow on pin 4  5v

Black on pin 6     Grnd

Green on pin 8   RPM

Blue on pin 10    PWN   (This is GPIO 15 by BCM numbering) … if you use something different, change the pin number in the python script.

 

The fan comes with a different configuration with the plug… I think the yellow and black are reversed.

 

 

Sent from Mail for Windows

 

From: Andrea Gatti
Sent: Thursday, October 12, 2023 6:51 AM
To: PicoChess
Subject: Re: PWM Fan Control of the Raspberry

 

Hi Marc,

--

Andrea Gatti

unread,
Oct 12, 2023, 11:56:12 AM10/12/23
to PicoChess
Yes, I connected the wires as you indicated. My question is on the script. Does it run continuosly? Shall I use cron?

m371...@gmail.com

unread,
Oct 12, 2023, 12:59:27 PM10/12/23
to pico...@googlegroups.com

crontab -e: @reboot python3 <filename> &

 

Runs continuously in memory  because of the ampersand

I compiled the script… probably doesn’t make much difference.

I have other scripts you may like better… all running off of GPIO 15

m371...@gmail.com

unread,
Oct 12, 2023, 1:10:15 PM10/12/23
to pico...@googlegroups.com

 

 I attached more fan scripts… the read_data.py will show rpms, temperature and frequency

 

Fan.zip

Marc Hamilton

unread,
Oct 12, 2023, 2:53:02 PM10/12/23
to PicoChess
Whoops... I thought it was just me and Adrea conversing by email, didn't realize it was being posted... I was trying to play chess on chess.com
and answer the questions in a quick manner.
Not all PWM fans are alike and some will "whine" when you change their frequency/load. I'm hoping the ones shipped with the RPi5 are not subject to this.   

Frequency control is like someone spinning a bicycle tire with their hand... The more often you use your hand to rotate the wheel, the faster it will go, and the converse is true. 

Randy Reade

unread,
Oct 12, 2023, 3:01:12 PM10/12/23
to pico...@googlegroups.com
All good info, Mark. I'm sure others will benefit from it.

Randy

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/9019e16c-25bb-40bb-a944-f34c12eab2ebn%40googlegroups.com.

Andrea Gatti

unread,
Oct 13, 2023, 3:44:54 AM10/13/23
to PicoChess
Thank-you Mark, I'm about to try the various scripts and solutions to find the best match with my setup.

Thanks!

Andrea

Reply all
Reply to author
Forward
0 new messages