Skip to content

A complete solution for Raspberry Pi PWM fan control, featuring a web-based dashboard to monitor CPU temperature, fan speed, and system performance — with support for monitoring multiple Raspberry Pis in real time.

Notifications You must be signed in to change notification settings

JustASquirrelinAround/pifandashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi Fan Dashboard

🌬️ A multi-Pi dashboard to monitor and control CPU cooling fans using PWM, with real-time status, history graphs, and a responsive web interface.

💡 Recommended Hardware:
For best results, use Noctua NF-A4x10 5V PWM Fans. This setup is designed specifically for controlling fans via the Raspberry Pi's GPIO pins using PWM.

✅ Designed for Raspberry Pi 3B and B+ along with Raspberry Pi 4

❌ Does not work with the Raspberry 5 fan header


📸 Screenshots

Dashboard Overview Chart View Edit Pi List Modal

📚 Table of Contents

  • Wiring Guide
  • Installer
  • Dashboard Features
  • Optional Terminal Alias
  • Uninstaller
  • License
  • Credits
  • More Details

🔌 Wiring Guide

Connect your 4-pin 5V PWM fan to the Raspberry Pi using the following pinout:

| Fan Wire           | Connects To (GPIO Header)      | Description             |
|--------------------|--------------------------------|-------------------------|
| **Yellow (5V)**    | Pin **2** or **4**             | 5V Power                |
| **Black (Ground)** | Pin **6**, **9**, **14**, etc. | Ground                  |
| **Green (Tach)**   | *(NOT USED)*                   | *(NOT USED)*            |
| **Blue (PWM)**     | Pin **8 (GPIO14)**             | PWM Control Signal      |

✅ Only 3 wires are needed for this project: Yellow, Black, Blue

🔧 Fan Mounting

🛠️ A proper fan mount is required to securely attach your PWM fan to the Raspberry Pi or your case.
There are many 3D-printable and off-the-shelf options available depending on your Pi model and enclosure.

🔎 Tip: Search online (e.g., Thingiverse or Printables) for "Raspberry Pi fan mount" to find one that suits your setup best.


📥 Installer

You can use the guided setup script to automatically install everything needed for your Pi Fan Dashboard.

Run this on any Raspberry Pi:

curl -LO https://github.com/JustASquirrelinAround/pifandashboard/releases/latest/download/fandashboardsetup.sh

sudo bash fandashboardsetup.sh

The script will guide you through:

  • 🌀 Installing the fan controller and API for Pis with fans
  • 🖥️ Setting up the web dashboard (on a main Pi or web-only Pi)
  • 📦 Cloning only the required files
  • ✅ Automatically handle DietPi or Raspberry Pi OS
  • 🧼 Optionally cleaning up install files

🔁 Updating the Dashboard

To update the web interface, simply run the Web Only option in the setup script again. This will refresh the frontend files without affecting existing settings or the Pi list.


🖼️ Dashboard Features

  • ✅ Live CPU Temp & Fan Speed per Pi
  • ✅ Pie chart for CPU & Memory usage
  • ✅ Colored online/offline status dot
  • ✅ Toggle line chart for historical graph
  • ✅ Red shading on chart when Pi is offline
  • ✅ Mobile-friendly Bootstrap layout
  • ✅ Summary: Online/Offline count and last updated time

🖥️ (Optional) Terminal Command to Check Fan Status

You can add a simple shell alias to quickly view the current CPU temperature and fan speed from the terminal:

echo "alias fanstatus='cat /var/log/fan_status.txt'" >> ~/.bashrc
source ~/.bashrc

Then just run:

fanstatus

Output:

CPU Temp: 40.9°C | Fan Speed: 28%

❌ Uninstall Instructions

If you ever need to remove the Pi Fan Dashboard components, you can use the following uninstall script. This will allow you to selectively remove the fan scripts, Pi manager, and web interface depending on your setup.

Run this on the Pi you wish to uninstall from:

curl -O https://raw.githubusercontent.com/JustASquirrelinAround/pifandashboard/main/fandashboarduninstaller.sh

sudo bash fandashboarduninstaller.sh

This script will:

  • 📋 Ask what you'd like to uninstall (Fan scripts, Pi manager, Web interface)
  • ✅ Automatically handle DietPi or Raspberry Pi OS
  • 🧼 Clean up related files and services

📜 License

MIT License. Free to use, modify, and contribute.


🙏 Credits


🧠 More Details

See DETAILS.md for a full explanation of how the system works, including:

  • Architecture diagram
  • Description of each script and service

About

A complete solution for Raspberry Pi PWM fan control, featuring a web-based dashboard to monitor CPU temperature, fan speed, and system performance — with support for monitoring multiple Raspberry Pis in real time.

Topics

Resources

Stars

Watchers

Forks