Tutorials
Raspberry Pi Dashboard

Raspberry Pi Sensor Dashboard

Turn a Raspberry Pi into a monitoring station. The Plexus Python agent auto-detects connected I2C sensors and streams everything to a live dashboard — no code required.

What You'll Build

A dashboard streaming:

  • I2C sensor data — temperature, humidity, pressure, IMU, light, power
  • System health — CPU usage, memory, disk, CPU temperature
  • Camera feed — USB or Pi Camera (optional)

What You Need

ItemNotes
Raspberry PiAny model with WiFi (Pi 3B+, Pi 4, Pi 5, Pi Zero 2 W)
I2C sensorBME280, MPU6050, INA219, SHT30, BH1750, or any supported sensor
Plexus accountFree at app.plexus.company (opens in a new tab)

Step 1: Enable I2C

If you haven't already, enable I2C on your Pi:

sudo raspi-config
# Navigate to: Interface Options → I2C → Enable

Reboot if prompted. Verify with:

sudo i2cdetect -y 1

You should see your sensor's address (e.g., 0x76 for BME280, 0x68 for MPU6050).

Step 2: Install the Plexus Agent

pip install plexus-agent[sensors]

This installs the agent with I2C sensor drivers. For additional capabilities:

pip install plexus-agent[sensors,system]    # Add CPU/memory monitoring
pip install plexus-agent[sensors,camera]    # Add USB camera support
pip install plexus-agent[all]               # Everything

Step 3: Get Your API Key

  1. Go to app.plexus.company (opens in a new tab)
  2. Click Add Device
  3. Copy the API key (starts with plx_)

Step 4: Start Streaming

Run a single command:

plexus start --key plx_xxxxx

The agent scans your I2C bus and shows what it found:

Scanning I2C bus 1...

Found 2 sensors:

  [1] BME280       temperature, humidity, pressure
  [2] MPU6050      accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z

Stream all? [Y/n]:

Press Enter to start. That's it — data flows to your dashboard.

Step 5: Add System Metrics (Optional)

To also monitor CPU, memory, and disk alongside your sensors:

plexus run --key plx_xxxxx --sensor system --name rpi-lab

This streams sensor data plus cpu_percent, memory_percent, disk_percent, and cpu_temp.

Step 6: See Your Dashboard

Open app.plexus.company (opens in a new tab). Your device appears and metrics populate in real time.

Create a dashboard with:

  • Line charts for temperature and humidity over time
  • Gauges for current CPU temperature
  • Multi-series plot for IMU accelerometer data (accel_x, accel_y, accel_z)

Running as a Service

To keep the agent running after you close the terminal:

# Create a systemd service
sudo tee /etc/systemd/system/plexus.service << 'EOF'
[Unit]
Description=Plexus Agent
After=network-online.target
Wants=network-online.target
 
[Service]
User=pi
Environment=PLEXUS_API_KEY=plx_xxxxx
ExecStart=/home/pi/.local/bin/plexus run --name rpi-lab --sensor system
Restart=always
RestartSec=10
 
[Install]
WantedBy=multi-user.target
EOF
 
sudo systemctl enable plexus
sudo systemctl start plexus

Check status with:

sudo systemctl status plexus
journalctl -u plexus -f

Using the Python API Directly

If you want programmatic control instead of the managed agent:

from plexus import Plexus
import time
 
px = Plexus(api_key="plx_xxxxx", source_id="rpi-lab")
 
while True:
    # Read your sensors however you like
    temp = read_temperature()
    humidity = read_humidity()
 
    px.send("temperature", temp)
    px.send("humidity", humidity, tags={"room": "lab"})
 
    time.sleep(2)

Supported Sensors

The agent auto-detects these I2C sensors:

SensorMetricsI2C Address
BME280temperature, humidity, pressure0x76 / 0x77
MPU6050accel_x/y/z, gyro_x/y/z0x68
INA219voltage, current, power0x40
SHT3xtemperature, humidity0x44 / 0x45
BH1750light_lux0x23 / 0x5C
ADS1115adc_ch0–ch30x48
VL53L0Xdistance_mm0x29

Troubleshooting

"No sensors found" — Run sudo i2cdetect -y 1 to verify your sensor is visible. Check wiring (SDA, SCL, 3.3V, GND). Make sure I2C is enabled in raspi-config.

Permission denied on I2C — Add your user to the i2c group: sudo usermod -aG i2c $USER then log out and back in.

Agent exits immediately — Check your API key. Run with --debug for verbose output: plexus run --key plx_xxxxx --debug.

Next Steps