Official case fan raspberry pi 4 (lesson)

From regional-training
Revision as of 16:34, 25 August 2022 by Ralph (talk | contribs) (→‎instructions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

aim

  • to install a rasberry pi 4 official fan in an official case.

outcome

  • a successful deployment of a working fan.

overview

A raspberry pi 4 should have a heatsink to keep it cool, and may have a fan to assist with cooling[1].

The fan is alleged to cool by sucking air into the case through cracks near the USB connectors, but in my opinion that is far too restrictive.

Thus the standard pi 4 case does not have enough airflow making the fan ineffective. This is easily solved by drilling some holes above the fan and some exit holes on the end of the case near the sdcard and the LED windows.

(🚩 Hint: you may need to glue the LED view plastic with something like PVC water glue which dries transparent to stop the view plastic from falling out of the slot in the case.)

🚩 Note: I had to cut the RAM heat-sink down in profile so the fan does not hit. It might be easier to use a dremmel tool instead of tin-snips and a file.

The fan comes with Vcc, GND and a control line wires terminated with connectors for the GPIO header pins.

The fan is on by default, but can also be driven off with the gpio-fan overlay[2] just after booting-up. The fan will stop running while ever the temperature is below the set-point trigger after the pi has booted-up.

🚩 Note: I moved the control from GPIO 14 to GPIO 17 (pin 11):

dtoverlay=gpio-fan,gpiopin=17,temp=55000,hyst=10000

which causes the fan to cycle on at the cpu core temperature of 55C and off at 45C (a 10 degree range). GPIO pin 14 is the standard connection, in accordance with the diagram on the box of the official fan but I moved my control wire to GPIO 18 in case I needed the serial port at some stage.

🚩 Note: the standard fan wiring (on the box) employs GPIO PIN 14 which is used for RS232 TX; a better pin would be to use GPIO 17 (pin 11) or some other unreserved pin.

I also tried:

dtoverlay=gpio-fan,gpiopin=17,temp=60000,hyst=10000 

to cycle between 60 and 50C, which gives a longer interval of silence between turning the fan on.

instructions

  • cut and lay the paper out over the lid and identify where the fan is located.
  • mark the paper out with a 3 x 3 diamond pattern above the fan.
  • sticky-tape the paper in position
  • use a 1/8 drill bit to drill the centre of the holes using the paper mask as a guide and use a peice of wood as the backing to drill into.

🚩 Note: do not use your kitchen or dinning room table as a backing board, and do not press hard and keep your hands and legs away from the case.

  • remove the paper mask and turn the case lid right-side up and drill larger holes with the case right-way-up on the board (do not press hard)
  • take the bottom case, and carefully mark 5 evenly spaced holes leaving room for the LED view port etc, and high enough to clear the DPI camera connector.

🚩 Note: Do not drill the holes while the PCB is in the case.

  • drill these holes out to a larger size.
  • use a rat-tail file to deburr the holes.

Next activate the overlay by updating the card:

vi /boot/config.txt
  • insert
dtoverlay=gpio-fan,gpiopin=17,temp=55000,hyst=10000

Next you are going to wire up the fan in accordance with the GPIO pin assignment above.

Then test the fan while the case-lid is off:

  • turn the power on and the fan should run until the pi has booted-up. Then it will turn off.

🚩 Note: if the fan keeps running check your overlay and pin assignment.

  • power off
  • gently close the lid

🚩 Note: make sure the fan clears the RAM heatsink - do not press hard when closing the lid. If it is difficult it is quite likely that the fan is hitting the heatsink - do not force it!

Then test the fan

  • turn the power on and the fan should run until the pi has booted-up. Then it should turn off if the temperature is cold enough.

When the pi warms up (if it does), then the fan will turn back on.

You can force it to get warm by running an intensive shell loop:

for (( ; ; )) do echo .; done

testing

I just ran the following script to watch the temperature:

for (( ; ; )) do vcgencmd measure_temp; sleep 2; done

parts

hand tools

  • a dremmel tool and file to cut-down large heatsinks.
  • cordless hand-drill and bits
  • 2B pencil for markup
  • a rule or straight edge
  • paper, scissors and sticky tape.
  • a round rat-tail or semi-round/flat rat-tail file to deburr the holes.

references

categories