Fan control for Linux

So what do you think if this one will work on VIM2?


That fan exceeds the 150mA limit of the VIM2’s fan header.
That fan(picture below)shows 0.2A or 200mA, it exceeds the limit by 50mA
It is a wise practice to not exceed stated maximum current(amps).

The fan may never draw the stated 0.2A, but better to look for alternate.

From VIM2 schematic, available on

The PIN number on Kernel 4.9.40 for VIM2

PIN            NUM
GPIODV_14:     74
GPIODV_15:     75

1 Like

In the next days I will try to test different models of fans and will write the results.

What would the user does not have confusion. This limitation applies to a special connector for the fan on the Board VIM2. When you connect to the pins on 40-pin connector (e.g. contacts 3.3 V), is another maximum value.

Thanks for the info. I checked on the way DualOS (Ubuntu) - everything works. Now in Ubuntu also the same to control the fan. :slight_smile:

fan vim2

nice :grinning:

can you share the link where you bought a fan?


Checked on the way Armbian with kernel 3.14, the fan operates and is managed as needed. :slight_smile:

It is necessary to ask @Gouwa . :wink:
I got this fan complete with VIM2 (thanks Khadas for the supply kit). :blush:

As current arcylic case cannot assemeble the cooling fan, so we haven’t got the cooling fan launched for sale.

We are designing a new housing/case for both VIMs, and the new case can install the fan then.

Hi @Gouwa,

and if I want to build my own case what fan can I purchase (for VIM2) can you please share a link to fan?


You wanna build your own case? It will cost you a loooot I think :blush:

We have cooling fan for VIM2, but just cannot mount rightly inside the current arcylic case, and if you still want one just PM to me. :wink:

@Gouwa I was thinking of doing one as a hobby project :wink: nothing special (still thinking what material would be better, wood or acrylic or something else).


1 Like

The fan for the VIM2 is well suited to the housing cover, which comes complete with fan for VIM1. Almost everything fits need screws to screw in with little effort in the fan casing. The holes in the fan casing VIM2 slightly less than the diameter of the screws from the VIM1. I’ve in the photo is just such an option. Cover and screws from VIM1, fan for VIM2 . I also increased the height of the cover with the fan above the Board. For this I changed the distribution of plates from the housing (moved one from the bottom to the top) and added on top of the nuts from the kit that had sent from Khadas to my for VIM1. By the way, it is possible to set the radiator size 22х22х10. :slight_smile:


Yep, I saw the photoes you posted, just thought that it’s great for DIY or makers, but seems not as friendly enought for many other users, that’s the reason why we haven’t launched cooling fan for VIM2 (but seem that many users need it)

Yep, but it means that we have to designed a new one and the supplier will request a large quantity order from us first.

Actually we research many different fans with different dimension, but no luck for both tiny dimension and thin thickness. :frowning_face:

1 Like

I think it is possible to produce several different kit options for cooling the VIM2.

  1. The standard that is being developed Khadas.

  2. Universal-1. Which can enter. Pay attention, the fan is located on top of the cover (not inside the case).

a. Standard top cover with additional opening (40 mm) and 4 additional holes for fastening screws of the fan.

b. Fan, such as the link (his current consumption allows you to connect a standard fan connector to the VIM2).

I have VIM1 works almost the same fan but slightly less (35*35), but his passport a current of 0.2 when connected to the contacts “3.3 V” works without noise and with enough performance to turn on and off automatically when you turn on and off the VIM1.

c. Adapter, for connection to the connector on the Board VIM2 and connect the fan connector.
Alternatively, use the same as included for VIM1 , but with a mate for the connector on the Board VIM2. By the way, it is very desirable to produce a set of adapters to connect the three main connectors that are used for fans.

d. Heatsink with thermal pad. For example.





When you connect the fan to terminals “3.3 V” on 40-pin connector, the fan and the radiator, can be used on any model of VIM1 and VIM2 (in regular equipment). Enough to drill a hole in the top cover for the fan. The fan can be mounted without screws using a few drops of glue instead of screws.

Script for fan control on Linux (3.14 and 4.9).

1 Like

The firmware for the VIM2 with Ubuntu (kernel 4.9), I have trigger values 73 and 74. As it should be ?

The PIN number is 73 and 74 on 4.9.26 kernel
The PIN number is 74 and 75 on 4.9.40 kernel
I think it need to fix up. The same PIN number is necessary on different kernel version.

1 Like

Updated the script fan control. Default enabled auto control the temperature. Temperature parameters can be edited (this is the first variable in the script). For the startup script at system start, add in “/etc/rs.local” line to invoke it in the background “/boot/ &”

The script automatically tries to determine the kernel version and uses the appropriate variables. The script when run performs automatic testing of the fan in all modes.


Hello, The script is working well.
I set…
I set the TIMER_SEC=45.
So fan turns on MAX at 57c, fan will run for 45 seconds, if temp falls under 57c in this time, fan shuts off.

The idea was to turn fan on at the temperature threshold, but delay turning it off until the temp falls several degrees. This keeps the fan from turning on and off a lot.

Would it be possible to have the fan, once on, stay on until temperatures fall 6-7c below turn-on threshold?

Thanks balbes150. As usual, great work.:+1:


Adding hysteresis (temperature difference switch on / off) is planned in future versions.