Home
Softono
pifandashboard

pifandashboard

Open source Shell
19
Stars
1
Forks
0
Issues
3
Watchers
1 year
Last Commit

About pifandashboard

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.

Platforms

Web Self-hosted

Languages

Shell

Links

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