3D Printable Fan Mount Mod for the Open Enclosure + DT/Arduino Sketch for PWMing it
#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


Messages In This Thread
RE: 3D Printable Fan Mount Mod for the Open Enclosure - by CounterPillow - 06-17-2021, 12:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  3D-Printable Button Pegs for the ROCK64 Aluminium Case CounterPillow 2 3,517 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,523 08-21-2020, 09:16 PM
Last Post: prog-amateur
Lightbulb Mount a HeatSink on the Rock64 using 3M Thermal Tapes MarkHaysHarris777 22 45,023 11-29-2019, 03:14 AM
Last Post: ab1jx
  Recommendation for external hdd enclosure majortom 1 2,734 05-16-2019, 04:54 AM
Last Post: davidm
  ROCK64 STEREO AUDIO DAC ADD-ON BOARD Sketch killor 4 6,737 11-12-2018, 07:37 AM
Last Post: killor
  ROCK64 Acrylic Enclosure Assembly ironhand 2 4,198 08-27-2017, 10:26 AM
Last Post: ironhand

Forum Jump:


Users browsing this thread: 1 Guest(s)