Can I control the fan via GPIO?

I destroyed my Edge 2 4 pin fan connector so it now looks like this:

Of course, I ordered a new fan but it will take 2 weeks to get here. I cannot fix the old 4 pin PWM connector as it’s too small. Meanwhile, as I have the IO connector:


i am wondering if it possible to control the fan via the 16 pin GPIO connector

@codrut going through the datasheet and schematics you could write your own script to control the PWM effectively.

Electronically, it seems the fan connector has some filter capacitors for the 5v supply and a resistor for the PWM line:

You could attach those things in between the fan and the PWM pin of the I/O card.

Wiring: White: TACH, Black: GND, Gray: PWM, Red: +V

On the I/O extension, there is one PWM pin for usage: PWM14: PIN13
reference this: Edge2 PWM [Khadas Docs]

After that, its just making sure you get the appropriate timings for the PWM:
Nominal RPM is around 10600 RPM, so you would have an PWM period interval of 0.0028 Seconds or 2.88 Milliseconds and with 50% duty cycle mentioned by the datasheet of the fan.

putting these values into the PWM setup in the script should the do the trick, and your fan should be able to run.

1 Like