Temp controlled fan
-
I am sure this has been done before. I have a fan on my rpi plugged into gpio pin 4 and ground. As a 5v pin the fan is always on. I planned to write a piece of code that sets gpio pin 4 to off and then checks the temperature every second and if the temp rises above a set limit it will turn gpio 4 on. I plan to have this script run on startup and always be running. My question is will having something like this running in the background constantly checking the temp every second create issues for me while playing games in emulation station?
-
@crimson0087 said in Temp controlled fan:
My question is will having something like this running in the background constantly checking the temp every second create issues for me while playing games in emulation station?
Depends on the script - if it's running in a tight loop, then it will use one CPU at 100%, but if you space out the temp reading every 5-10 seconds, it shouldn't have any meaningful impact.
Run the script without anything started (well, just with EmulationStation running, doing nothing) and loop at the CPU utilization using the
top
command. See how % of the CPU your script is using and you'll see the overall impact on the performance. -
I think is not a good idea to connect, directly, a fan to the gpio pins. This, may hurt the Pi.
Also, recently raspi-config, offer options about fan control. But I don't know if they will work with your fan setup.
-
@windg I hadn’t seen this before in config- it could be really handy but I can’t find that much info on it, specifically does it work with an ordinary fan or do I need a pwm fan.
-
You can find fan control options here:
raspi-config > Performance Options > Fan .
If you can't find this option, update the RetroPie-Setup script and then choose to update RetroPie and the underlying OS packages also. I think pwm fan is a better option because you can control the fan speed.
I had a fan hat in the past but i replace it with a aluminium case(passive cooling) because the noise was annoying.
-
@windg Thanks- I can find it, good to know it will work with the ‘normal’ fan I’ve got running all the time, I don’t overclock so it rarely gets hot, hence this is a nice feature.
-
I tried this first and it didn't seem to work with pin 4. I told it run at 70 degrees and it was running at 36 degrees... I know pin 4 is a 5v pin which is why I chose it. If I use any of the 3.3v pins the fan will run more slowly
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.