# Tall Aluminium Heatsink & Fan for Raspberry Pi Compute Module 4 (CM4)

**Type:** Product page · **SKU:** CE08375 · **Brand:** [The Pi Hut](https://core-electronics.com.au/brands/the-pi-hut)
**Page:** https://core-electronics.com.au/tall-aluminium-heatsink-fan-for-raspberry-pi-compute-module-4-cm4.html ([markdown](https://core-electronics.com.au/tall-aluminium-heatsink-fan-for-raspberry-pi-compute-module-4-cm4.html.md))

This tall heatsink + programmable fan combo for the Raspberry Pi Compute Module 4 is the ideal choice for those looking for the ultimate cooling aid for...

## Pricing

- **Price:** $23.60 (inc GST) — $21.45 AUD, exc GST
- **Quantity discounts:** 10+ $20.60 (exc GST) · 25+ $19.95 (exc GST)

## Availability & dispatch

- In stock, ships same business day if ordered before 2PM (Australia/Sydney).
- We can dispatch 2 today, and up to 500 more in 5–8 days.

## Description

This tall heatsink + programmable fan combo for the [Raspberry Pi Compute Module 4](https://core-electronics.com.au/raspberry-pi/boards/compute-module-4.html) is the ideal choice for those looking for the ultimate cooling aid for their CM4 whilst having control over fan noise via code.

Standing at 17mm tall (from the base mounting points), this unit will cool your CM4 silently until your set temperature threshold, at which point the fan will kick in as the heatsink's trust sidekick! The CM4 heatsink comes with fixings, thermal tape and a mini-screwdriver.

The fan has three wires, 5V, GND and a signal wire that is intended for GPIO18 (Physical pin 12) to allow PWM (code) control of the fan speed/activity. The heatsink is intended to be installed on the [Raspberry Pi Compute Module 4 IO board](https://core-electronics.com.au/raspberry-pi-compute-module-4-io-board.html) as this provides a pin connection.

**Features**

- Designed for the Compute Module 4
- Ultimate cooling with both a heatsink and fan
- Easy to install
- CNC machining
- Excellent heat dissipation
- Adjustable speed fan
 
**Package Contents**

- 1 x Aluminum Alloy CNC Heat Sink with Fan for Raspberry Pi CM4 Module
- 1 x Screw Driver
- 4 x M2.5 Screw
- 4 x M2.5 Nuts
- 4 x Thermal Pad
 
**CM4 and IO board not included**

**Assembly**

- Apply the thermal pads to the CM4 module
- Fix the heatsink as per the image below
- Fit the CM4 module into the IO board
- Connect the Red wire to 5V on GPIO Pin
- Connect the Black wire to GND on GPIO Pin
- Connect the Blue wire to GPIO14 (TXD) on GPIO Pin (physical pin 8)
- **NOTE**: Please beware of the direction of the screws and nuts
 
![Raspberry Pi Compute Module 4 heatsink and fan assembly](https://core-electronics.com.au/attachments/localcontent/raspberry-pi-4-cm4-tall-heatsink-and-fan_7_1024x1024_75905caa061.jpg)

**Enable Automatic Fan Adjustment**

- Turn on Raspberry Pi and log in
- Open a terminal and type:
 
 ```
sudo raspi-config
```

- Navigate to (4) Performance Options &gt; P4 Fan and select YES &gt; Input or keep it as 14 &gt; OK &gt; input temperature in degrees should the fan turn on, for example: I'd like to turn on the fan when the temperature reacheds 65 degrees, input 65 and press Enter
 
**Enabling the Fan via Programming**

- Make sure the RPi.GPIO library has been installed
 
 ```
 pip freeze |grep RPi.GPIO 
```

- If the feedback is similar to below (showing a version number), it means the library is installed:
 
 ```
RPi.GPIO==0.7.0
```

- Open a terminal and create a file named: pwm-fan-control.py
- Copy and paste the following code into the file and save it:
 
 ```
import RPi.GPIO as GPIO import time import subprocess  GPIO.setmode(GPIO.BCM) GPIO.setup(14, GPIO.OUT) pwm = GPIO.PWM(14,100)  print("\nPress Ctrl+C to quit \n") dc = 0 pwm.start(dc)  try:     while True:         temp = subprocess.getoutput("vcgencmd measure_temp|sed 's/[^0-9.]//g'")         if round(float(temp)) >= 65:             dc = 100             pwm.ChangeDutyCycle(dc)             time.sleep(0.05)         else:             dc = 0             pwm.ChangeDutyCycle(dc)             time.sleep(0.05) except KeyboardInterrupt:     pwm.stop()     GPIO.cleanup()     print("Ctrl + C pressed -- Ending program")
```

- Execute it by typing:
 
 ```
python3 pwm-fan-control.py 
```

- The fan will turn on when the CPU temperature reaches 65 degrees

## Images

- [Product image 1](https://core-electronics.com.au/media/catalog/product/i/m/image_12877.jpg)
