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

  1. 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!!

    ReplyDelete

Post a Comment

Feel free to leave a comment ! ... but due to a lot of spam comments I have to moderate them. Will reply ASAP !

Popular post, last 30 days

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

NetworkManager UI and access point, hotspot

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

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

Signal K quick install, Raspberry Pi, Ubuntu

Clone the Raspberry boot disk

SeaTalk1 to NMEA 0183 converter, DIY

Volvo Penta NMEA 2000 Gateway

Waveshare CAN hat with Signal K & OpenPlotter

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