Skip to content
iftyzubaerPublic

About

4-person IoT dashboard — React frontend polling a Node/Express + MQTT backend for a Wio Terminal sensor system. My contributions: dashboard, backend integration, CI/CD (GitLab CI).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

227 Commits

Folders and files

Repository files navigation

PetPal

A smart pet monitoring station for real-time environmental awareness.

CI License: MIT

PetPal is an IoT system that monitors your pet's environment using a Wio Terminal microcontroller. Sensor data — temperature, humidity, motion, sound, and food proximity — is streamed over MQTT to a web dashboard where pet owners can view live readings, set alert thresholds, and get notified when conditions fall outside safe ranges.

Purpose and benefits

Pets cannot tell us when they are too hot, lonely, or stressed. PetPal bridges that gap by giving owners continuous, objective data about their pet's environment — whether they are at home or away.

  • Real-time awareness — live sensor readings update every few seconds so owners always know the current state of their pet's space.
  • Configurable alerts — set custom thresholds for temperature, humidity, sound, and motion. A named alert banner appears the moment a value exceeds the limit, showing the exact sensor and current reading.
  • Activity detection — the PIR motion sensor detects whether your pet is active or resting, providing a simple welfare indicator.
  • Remote visibility — the dashboard runs in any browser, so owners can check in from any device on the same network.
  • Extensible by design — sensor configuration is centralised, so adding a new sensor requires a change in one place.

Architecture

PetPal consists of three layers: a Wio Terminal microcontroller reading Grove sensors, a Node.js/Express backend subscribing to MQTT topics and exposing a REST API, and a React dashboard polling that API every 3 seconds.

┌─────────────────────────────────────────┐
│             Wio Terminal                │
│  DHT11 · PIR · Loudness · Ultrasonic    │
│  Publishes to MQTT topics: wio/<sensor> │
└──────────────────┬──────────────────────┘
                   │ MQTT (Mosquitto)
                   ▼
┌─────────────────────────────────────────┐
│        Node.js / Express backend        │
│  Subscribes to wio/# topics             │
│  Exposes GET /api/readings              │
└──────────────────┬──────────────────────┘
                   │ HTTP polling (3 s)
                   ▼
┌─────────────────────────────────────────┐
│         React dashboard (Vite)          │
│  Live readings · Alerts · Thresholds    │
└─────────────────────────────────────────┘

Hardware

Component Role
Wio Terminal (Seeeduino SAMD) Microcontroller
Grove DHT11 Temperature and humidity
Grove PIR Motion Sensor Pet activity detection
Grove Loudness Sensor Ambient sound level
Grove Ultrasonic Ranger Food bowl proximity

Software stack

Layer Technology
Firmware Arduino / C++ via arduino-cli
Messaging MQTT (Mosquitto)
Backend Node.js, Express
Frontend React (Vite)
CI/CD GitLab CI on Chalmers shell executor

For detailed architecture diagrams, MQTT topic structure, and wiring, see the project Wiki.

Getting started

Prerequisites

  • A machine running macOS or Linux
  • Node.js v20+
  • Mosquitto MQTT broker (brew install mosquitto)

Run the system

  1. Start the MQTT broker
   mosquitto
  1. Start the backend
   cd backend
   npm install
   npm start

Runs on http://localhost:5000.

  1. Start the dashboard
   cd frontend
   npm install
   npm run dev

Open the URL shown in the terminal (typically http://localhost:5173).

  1. Power on the Wio Terminal. It connects to Wi-Fi and begins publishing sensor data automatically. Live readings appear on the dashboard within a few seconds.

Using the dashboard

  • Live readings update every 3 seconds — temperature, humidity, activity, noise, and food proximity.
  • Alert banners appear at the top when any sensor exceeds its configured threshold. Each banner names the sensor and shows the current value.
  • Dismiss an alert with the × button. It will only reappear if the sensor value changes again.
  • Monitoring status is shown if the Wio Terminal's onboard switch is turned off.

Developer setup

Clone the repository

git clone https://git.chalmers.se/courses/dit113/2026/group3/pet-pal.git
cd pet-pal

Environment configuration

Create backend/.env:

PORT=5000
MQTT_HOST=localhost
MQTT_PORT=1883

Create firmware/secrets.h (gitignored — never commit this):

#define WIFI_SSID "your-network-name"
#define WIFI_PASSWORD "your-network-password"
#define MQTT_HOST "your-broker-ip"

Building and flashing the firmware

arduino-cli compile \
  --fqbn Seeeduino:samd:seeed_wio_terminal \
  firmware/

arduino-cli upload \
  --fqbn Seeeduino:samd:seeed_wio_terminal \
  --port /dev/ttyACM0 \
  firmware/

Testing without hardware

You can simulate sensor readings via the terminal using mosquitto_pub:

mosquitto_pub -h localhost -t "wio/temperature" -m "22"
mosquitto_pub -h localhost -t "wio/humidity" -m "55"
mosquitto_pub -h localhost -t "wio/activity" -m "1"
mosquitto_pub -h localhost -t "wio/noise" -m "30"
mosquitto_pub -h localhost -t "wio/food" -m "12"
mosquitto_pub -h localhost -t "wio/switch" -m "true"

Branch and commit conventions

  • Branches: issue-XXX-short-description
  • Commits: #<issue> - <type>: <short description>
  • MRs are reviewed by @fatu before merging to main

See .gitlab-ci.yml for the full CI pipeline definition.

Team contributions

Group 3 — Ctrl Z

Member Main contributions
Ifty Zubaer React dashboard (live readings, alert banners, historical view), backend integration, CI/CD pipeline, wiki documentation, project management
Andra-Maria Fatu Temperature/humidity firmware, food and water level sensors, Wio Terminal display, firmware refactoring, MR reviews
Maryam Jamil PIR activity sensor, MongoDB database integration, food and water alert banners
Lucia Yetunde Malumi Noise level sensor, threshold configuration via MQTT

Demo video

📽️ Watch the PetPal demo on YouTube

The video demonstrates the full system — live dashboard readings, alert banners, threshold configuration, and the hardware setup — and covers the problem PetPal solves and its potential as a product.

Acknowledgements

Built as part of DIT114 Project: Systems Development (Spring 2026) at the University of Gothenburg.

About

4-person IoT dashboard — React frontend polling a Node/Express + MQTT backend for a Wio Terminal sensor system. My contributions: dashboard, backend integration, CI/CD (GitLab CI).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages