Raspberry fan control, Node-Red


Updated 2021-07-01 !

Do You want to have control over the Raspberry Pi(RPi) ? 

Functions
  • CPU Temperature
  • CPU Load %
  • Free RAM %
  • Disk Usage %
  • Shutdown and Reboot buttons
  • Fan PWM control via GPIO
Other NR posts on this site

Introduction
The above functions is implemented with Node-Red(NR) and I got inspiration from these sources
At the bottom, in the dashboard, there are functions to 
  • Shutdown
  • Reboot
  • Override the fan to 100% output
Fan control
The fan PWM control is realized with the circuit shown in the picture. The fan is connected to +12V DC since this is used in a boat application. You could use a 5V DC fan but then my recommendation is a separate supply, not using the RPi supply.


If the fan speed versus the CPU temperature don't match Your setup change the code in the "PWM Fan Control" node.

Measurements
The measures are made every 15 second and the CPU measure is "user space processes". A user space program is any process that doesn't belong to the kernel.

NR flow
Install the "node-red-dashboard" and "node-red-node-pi-gpio" node and then import the json file, from Github, to NR and check it out.

Remarks
2019-08-08 Refactored the Java code. OVERRIDE button code updated. Fan always on at least 20 %

Comments

JeremyY88 said…
Thank You so much for this. I'm running Pi5,Openplotter, Signal K and am very new to NR. I followed these instructions and got it working without any issues - brilliant!!
Pyssel i livet said…
🙏 Nice you liked it !

Popular posts, last 30 days

NetworkManager on Raspberry, easy start

Underfloor heating with PID controller, Node-RED

Home Assistant with VirtualBox or Proxmox or Linux KVM ???

Raspberry Pi OS Lite with GUI, RDP, VNC, Chromium

iCloud drive sync, or mount, with a Linux, Ubuntu, device

Homebridge made simple, HOOBS

Installing Ubuntu 24.04 or 24.10/25.04 on an old MacBook Air(2011)

AIS receiver and dispatcher ! The best ?!

Clone the Raspberry boot disk

Raspberry Pi 2, 3, 4, 5 USB SSD or USB drive boot