3D Printable Fan Mount Mod for the Open Enclosure + DT/Arduino Sketch for PWMing it
#1
Hi all,

As you all know, the ROCK64 runs notoriously hot for what it is. I've taken it upon myself to remedy some of that.

I've designed a 3D-printable top plate for the "Model B" open enclosure which allows you to mount a 40mm fan to it. Your fan will likely come with self-tapping screws, and the mounting holes are sized so that they should perfectly tap into them.

I know the board is mounted wrong in the photo, I've fixed it since

[Image: Model%20B%20Open%20Enclosure%20Top%20Fan%20Mount.jpeg][Image: model_b_top_cad.png]

I've used PETG as filament, and a 0.6mm nozzle. PLA and a different sized nozzle should also work perfectly fine though. The fan in question is a 5V Noctua NF-A4x10 5V PWM; it comes with self-tapping mounting screws, and a USB adapter which runs the fan at full speed. This is good enough for me to test it for now, but the end goal is to do proper pwm fan control with a modified device tree.

Cooling performance is "okay"; due to the SoC being directly in the centre of the fan where airflow isn't ideal, it's less than expected. But I can now run cpuburn-a53 on it continuously without throttling. I seem to top out at 75°C in fact. Before I installed a fan, the CPU would get to 85°C and start throttling down to cool off.

My next steps are to design a circuit to drive the 5V PWM and Tacho (speed sensor) from the ROCK64's 3.3V GPIO. Then, I'll look into modifying the device tree so I can provide a patch which will speed up and slow down the fan as required using the kernel's "pwm-fan" driver, instead of a userspace software solution.

Since the Model B Open Enclosure is used by what I presume is all other Model B sized PINE64 SBCs, this particular 3D printable mod can be used for those too.

You can download the STL and STEP file from the wiki, I've licensed it as CC-BY 4.0: https://wiki.pine64.org/images/9/9d/Mode...cutout.zip

I'll try to keep this thread updated as I make progress on the 5V fan control electronics and the device tree.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#2
Bit of a sad update, as it turns out the "secondary function" PWM pins on the Pi bus are not actually usable. They are assigned to vital rk805 functions, so the I2C which they are used for by default cannot be disabled.

On the plus side, I did finish the level shifting circuit:

[Image: 5vfan.png]

Theoretically, I can use this on any future SBC which does actually expose PWMs in a way (hello Quartz64 Model A) or on an SBC where a simple hack can be made to get a PWM (hello ROCKPro64 IR header)

For now though, I'm a bit bummed out. I can power the fan fine at full speed with just USB or the 5V and GND lines, so this still has a use of course. I might revisit this on a different SBC.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#3
I've discovered gpio-fan, which allowed me to use four GPIO pins on the ROCK64 to send a four bit signal to an external Arduino. The Arduino (a ATmega32U4 pro micro clone, you can get them for $3) is at 5V, so it first goes through a level shifter. Its job is to interpret the 4 bits of data as 2^4 (=16) PWM levels, and soft-PWM out a 25 kHz signal for the fan. This all works pretty well!

[Image: gpio-fan.jpeg]

You can find the dts changes I needed to make in this gist, simply apply it to a kernel tree and run make dtbs, then copy the resulting rock64 DTB somewhere into /boot/dtbs and use it in your bootloader. The arduino sketch can be found in the same gist. If you are using a different fan, you may have to adjust the RPM values, but they're really only for show since the ROCK64 has no way of knowing how fast the fan is really running. Noctua's PWM to RPM relation is almost linear, so I went with a linear conversion here. The fan starts at 1000 RPMs because that's the minimum it can do according to Noctua.

The 3.3V to 5V level shifter I'm using is from SparkFun (but you can easily find cheaper clones of it all over eBay), simply wire the 5V side to the HV pins, and the 3.3V (ROCK64) side to the LV pins. The Arduino can be powered from the ROCK64 5V pin. Make sure to also run a ground between the Arduino and the ROCK64.

The whole thing can be improved for sure, e.g. changes to the hysteresis and the threshold at which the fan turns on, and obviously getting the whole thing on something that's not a breadboard would be ideal. But for now, I'm quite happy with the results. And yes, using 4 GPIO pins for this is very silly, especially without more fine-grained fan levels in the device tree, but if I've got a 4 channel logic level converter I might as well go full silly.

I've also oriented the fan around the other way so that it now blows onto the heatsink.

Overall cost of project:
  • 1x Arduino clone, 5V: ~$3
  • 1x level shifter: ~$1
  • 1x Noctua 5V PWM fan (or similar 5V fan): $10 to $20
  • 3d printer filament: negligible (<$1)
  • jumper wires, breadboards, pin header rows: I assume you already have this, but <~$10 if you don't
Total: $14 to $35, depending on how good of a deal you get on the fan and how many jumper wires and other consumables you need to buy

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  3D-Printable Button Pegs for the ROCK64 Aluminium Case CounterPillow 2 3,367 08-04-2022, 01:31 AM
Last Post: Vicky Weimann PhD
  Which Voltage and Amper to supply both Rock64 + External drive enclosure ? prog-amateur 0 2,469 08-21-2020, 09:16 PM
Last Post: prog-amateur
Lightbulb Mount a HeatSink on the Rock64 using 3M Thermal Tapes MarkHaysHarris777 22 44,366 11-29-2019, 03:14 AM
Last Post: ab1jx
  Recommendation for external hdd enclosure majortom 1 2,674 05-16-2019, 04:54 AM
Last Post: davidm
  ROCK64 STEREO AUDIO DAC ADD-ON BOARD Sketch killor 4 6,581 11-12-2018, 07:37 AM
Last Post: killor
  ROCK64 Acrylic Enclosure Assembly ironhand 2 4,116 08-27-2017, 10:26 AM
Last Post: ironhand

Forum Jump:


Users browsing this thread: 1 Guest(s)