Skip to content

How to Use a Raspberry Pi as a Computer Status Monitor

The amazingly versatile Raspberry Pi mini computer can serve countless functions. Today‘s guide focuses on configuring your Pi as a dedicated monitoring device to visualize your computer‘s critical statistics like CPU usage, memory usage, network data, temperatures, and more in real time.

Introduction to the Raspberry Pi

The Raspberry Pi was conceived as an affordable computing solution to promote teaching of basic computer science. Since the initial Model B released in 2012, various incremental upgrades have boosted the capabilities while maintaining minimal size and low cost.

Several models now comprise the Raspberry Pi lineup:

Raspberry Pi 4 Model B – Current flagship. four 1.5 GHz Cortex-A72 CPU cores, up to 8GB RAM, full gigabit ethernet, USB 3.0, two micro HDMI ports
Raspberry Pi 400 – Pi 4 compute module integrated into compact keyboard with 4GB RAM option
Raspberry Pi Compute Module – System on Chip (SoC) boards for integration into end products
Raspberry Pi Zero – Tiny $15 model capable of basic computing, suitable for portable projects

All models run various Linux distributions and can be used independently or networked with a main computer for remote monitoring or management.

The 40-pin GPIO (general purpose input/output) interface along the edge of the board grants extensive hardware connectivity for electronics projects.

SoC Broadcom Processor 1.5 GHz 64-bit quad-core ARM Cortex-A72 (BCM2711)
GPU VideoCore VI handle 4Kp60 HEVC decode
RAM Options 1GB, 2GB, 4GB, or 8GB LPDDR4
Wireless 2.4 GHz and 5.0 GHz IEEE 802.11ac, Bluetooth 5.0, BLE
Ethernet Gigabit Ethernet
USB 2x USB 3.0, 2x USB 2.0
Video Outputs 2x micro HDMI ports (up to 4Kp60)
Audio Output 3.5mm headphone jack, HDMI
Storage MicroSD card slot for OS, apps, data
GPIO Interface 40-pin for connecting electronics, sensors, add-on HATs
Size 88mm × 58mm × 19.5mm for Pi 4 Model B

Accessories called HATs (Hardware Attached on Top) further expand capabilities by stacking onto GPIO pins. Options like speaker HATs, motor controllers, analog sensor arrays, and battery packs enable even more advanced projects.

As the Raspberry Pi ecosystem matures, OSes and software gain new features for simplifying setup and configuration. The newest Raspberry Pi OS release debuts an easy first-run wizard for partitioning cards, connecting to networks, updating software, and enabling accessibility options.

Advanced graphical tools provide point-and-click control over WiFi, Bluetooth, audio devices, display and regional settings, keyboard layouts, Appearance themes, and more. Or access the command line to tweak things manually.

Setting up the Raspberry Pi

For starters you‘ll need basic components like:

  • Raspberry Pi 4 Model B or 400
  • Official case or third party enclosure
  • 16GB+ MicroSD card
  • 5V 3A USB-C power supply
  • HDMI cable and USB input devices

Operating System Installation

You have a choice between NOOBS or Raspberry Pi Imager for installing your OS. NOOBS provides a simplified multi-boot loader that downloads images on first startup. Imager requires downloading ISOs ahead of time but allows easier preconfigured imaging. I recommend Imager for getting up and running quicker.

For monitoring duties, default Raspberry Pi OS (32-bit) works great but Ubuntu Server 22.04 or Debian also run well if you prefer an apt-based distro. Media centers like LibreELEC cater to entertainment setups. And advanced users can configure the experimental 64-bit OS.

OS Base Interface Use Case
Raspberry Pi OS (32-bit) Debian Bullseye Desktop LXDE Compatible default
Raspberry Pi OS (64-bit beta) Debian Bullseye Desktop LXDE Advanced usage
LibreELEC Linux Kodi Media Center Entertainment rigs
Ubuntu Server 22.04 Ubuntu Command line General server tasks

The Pi 4 Model B scored 2206 in SysBench single-thread tests, and 4617 for multi-threaded. Quad-core ARM processing and up to 8GB RAM deliver respectable performance for a tiny $75 computer.

Once your OS is imaged onto the MicroSD card, insert it into the Pi and apply 5V USB-C power to boot up. You may connect a display via HDMI and attach USB keyboard and mouse during initial setup.

The default graphical desktop environment includes an intuitive first-run configuration wizard for stepping through basics like:

  • Changing default password
  • Setting your WiFi country
  • Connecting to available wireless networks
  • Configuring regional settings
  • Updating packages list from repositories
  • Enabling accessibility options
  • Hostname and username customization

After finishing the wizard, your Pi should have internet connectivity. Now install software.

Headless Config and Remote Access

To conserve desk space or safely tuck away the Pi, you can set up the OS and access the device "headless" without a keyboard or display attached.

On first boot, the Pi broadcasts its own wifi network that you can connect to from another device to access the web-based configuration menu seen above.

Once configured, enable SSH in Interfaces to allow command line control from another machine on your network over TCP port 22. Popular tools like PuTTY facilitate secure remote terminal access.

For full desktop control, enable VNC in Interfaces which opens a graphical desktop over TCP port 5901. VNC Viewer apps are available for all major platforms.

Installing Monitoring Software

With your Raspberry Pi operational, it‘s time to install the monitoring software. There are a few good Linux options to choose from:

Software Interface Special Features Config Method
Glances Terminal or Web Remote client-server, alerts Config file
Grafana Web Extensive graphing, annotations Web forms
netdata Web Custom health alarms YAML config
Status Monitor Desktop Widget Minimalist, theming GUI menu

I recommend Glances for its balance of slick terminal and web interfaces, intuitive layouts, theming options, and handy client-server architecture. Install the latest release (v3.2.4 at time of writing):

sudo apt update
sudo apt install glances

When first launched in terminal using the glances command, you‘re presented with a two column view showing live utilization metrics on the left and a history graph on the right. Pres h to view a full list of keybindings.

The Glances web app provides similar data views accessible from other devices on your network. And extensions called Glances Plugins add capabilities like temperature readings, folder monitoring, schedulers, and exporting stats to external time series databases.

Glances relies on a config file located at /etc/glances/glances.conf where you specify refresh rates, server ports, and customize the information displayed.

Connecting External Sensors

While software sensors provide visibility into CPU, memory, disk, network, andgpu metrics, connecting physical hardware lets us monitor ambient environmental conditions and case fan speeds.

Temperature
Popular thermocouple sensors like the DS18B20 provide decent accuracy analog readings using just one wire. Affix probes around potential hotspots.

Voltage
Divide a voltage divider circuit to measure currents flowing to components. For example, monitor 12v CPU power.

Air Quality
Boards with integrated gas, humidity, and air quality sensors detect potentialy harmful particulate matter and dangerous gases.

Noise Level
Small microphone boards enable audio monitoring to check for increases in ambient decibel levels.

Motors
Motor HAT accessories allow PWM control and RPM monitoring for case fans and pumps.

The key is utilizing affordable integrated circuits, analog to digital converters (ADCs), and supporting electronics to modulate signals into digital values readable by the Pi GPIOs. Check the GitHub topic Raspberry Pi Sensors for sensor programming guides.

Constructing a Display Case

Housed in a custom encloser with integrated touch display, your Pi monitor transforms into a dedicated appliance for placement anywhere.

Display Options

Screen Size Resolution Touch Price
Tontec 7" 7 inch 1024×600 Yes $70
Eleduino 3.5" 3.5 inch 480×320 No $30
Waveshare 10" 10 inch 1280×800 Yes $180

Enclosures

Waterproof cases with pre-cut ports for access keep things protected. Search for "raspberry pi case" on sites like Amazon.

Those with 3D printers can design fully customized enclosures. Many free STL files are available on Thingiverse. Ensure sufficient airflow and wire routing space.

For commercial products or permanent installations, injection molded cases add polish. Companies like OKdo provide batches of custom orange Pi enclosures.

Aim for low profile right-angle cables and mount your display cleanly with wire raceways for clean builds. Enable one-touch power via GPIO cut-off switches.

Applications and Use Cases

  • Gaming Rig Monitoring – Keep an eye on temps, clocks, framerates, fan speeds
  • Network Node Stats – Check utilization and bandwidth of routers, switches, servers
  • Data Center Monitoring – Visibility into rack environmentals with distributed sensor nets
  • Industrial Systems – Integrate monitoring into equipment and devices
  • Automated Notifications – Trigger alerts on too high temps or abnormal sensor readings
  • Portable Appliance – Battery-powered Pi with LCD screen for mobility

Raspberry Pis present affordable monitoring options for home users but also hold promise for large scale deployments. Their low power draw enables flexible battery powered application.

Students can leverage Pi stats dashboards to learn about compiling system resource metrics and presenting time-series data visually.

Closing Thoughts

The Raspberry Pi has proven itself an amazingly capable little computer ideal for single board computing projects. Configuring one to operate as a dedicated real time system monitor is straightforward thanks to the breadth of available operating systems and software tools.

With a compact all-in-one display enclosure, your Pi monitor moves anywhere for convenient stats checking. Need portability? Build a battery-powered mobile status panel. Have a server rack or NAS you want insight into? Access remote systems via the network.

The tiny footprint, expandability via GPIO, and flexibility of the Raspberry Pi enable it to fulfill just about any niche. So if you think a Pi would make your life easier, don‘t hesitate to pi one up!

Additional References