Controlling cooling fan for Raspberry Pi 4

Did someone manage to use PWM on the shim fan with hass.io? I’m also no fan of turning it on and off all the time.

Please have rpi4 B and x735 v2.5 board and it doesn’t work for me.
Maybe I have a bad pin. Don’t know what is the right pin to control the fan?

According to the X735 documentation, GPIO13 (pin 33) is used to control the fan. I would also be interested because even if this pin is set in Rpi-Home Assistant, the fan does not work. Documentation link: https://wiki.geekworm.com/X735_V2.5_Hardware

I have pin 33 connected and the fan doesn’t work.
Is there any other solution ??

Has anyone gotten this to work with the Argon 1 V2 fan yet? The existing software is not the best.

My pi is not running HA, so remote integration is important to me. This looks like it regulates very well. This is 48 hours with the Argon script running.

image

I found a script that uses the X735 board to control the fan, but I have no idea how to use it in Home Assistant. Can it be used at all?
Script link: x735-v2.5/pwm_fan_control.py at 8f170d6bc964eb58f6cc97a01371ab60a4fa24c5 · geekworm-com/x735-v2.5 · GitHub

I implemented the code as instructed and the fanshim works well on my Pi 4. The only issues I can see is that when I reboot, any change to the target temperature is lost and it resets back to 55. Editing the “target temperature” setting fixed that.

BTW, if you are having issues with the fan not turing off even when the card says idle it could be the fanshim connection to the GPIO pins. I had this issue so I gave the pins a tweak and it has been reliable for a few days now.

I’m done and it works. If you only have hasio, then you have to enable i2c and pin 13 in the data code and it will work. Tested pi4 8G x735 v2.5

You were a little faster, I already have it in operation :grinning:
According to the documentation, I found out that ports refer to the real GPIO and not to the PIN

1 Like

It may work without I2C permission, but I’m not sure …

I didn’t try it either. I enabled I2C right away.

Ports: = GPIO
Ports: no PIN!!

It is so?

Yes, that’s right.

Is this thread still going, I have a Pi 4-8mb running HASSIO and the fans are failing due to them running constantly, has anybody managed to get the PWM going satisfactorily using generic fans.
My current Pi Case is a standard Labists case with dual fans but I have purchased an Argon 1 M2 case with a SSD and want to get it all working before changing over to the new Argon case.

anybody knows if fan shim is working with raspberry pi 3b? or is only for 4? it should work right?

I have it working on my RPI3B+

1 Like

I have this working on a RPi 4 with the official case & fan. But only sort of. I can turn the fan on & off from the UI, so the controller is working. A couple of things I note:

  1. the official fan recommends GPIO pin 14. Easy change.
  2. the min/max/target temps are in deg F for me (maybe they’re regionalized?); since you want to keep the Pi 4’s CPU temp below 80 deg C = 176 deg F, the target, min and max should be set accordingly.
  3. Changes to the target temp in the UI don’t persist after a reload/reboot. Does anyone know how to do that? (I’m still new to HA.)

I have my system set to metric under configuration - General. maybe you missed that setting.
If you have it configured in your configuration as a climate, you can set the default target temp. it will go back to that post reload.

climate:
  - platform: generic_thermostat
    name: RPI Cooling Fan Controller
    heater: switch.rpi_cooling_fan
    target_sensor: sensor.cpu_temperature
    min_temp: 55
    max_temp: 80
    ac_mode: true
    target_temp: 70
    cold_tolerance: 0.1
    hot_tolerance: 0.1
    min_cycle_duration:
      seconds: 30
    keep_alive:
      minutes: 5
    initial_hvac_mode: "cool"

I want to control the relay with it and the relay will control the fan.
Will it ok?
if it will work then I can control the high voltage fan.

This is my 5v relay from flyrobo.in

Yes is it possible.
In fact you’ll control the relay through Pi’s GPIO.
But the relay will control anything you want.