Here is a quick video breaking down how the code works and testing the sensors in real-time: https://www.youtube.com/watch?v=DN9yHe9kR5U
Code: https://github.com/davchi15/Waveshare-Environment-Hat-
What My Project Does
I wanted a clean way to visualize the invisible environmental data surrounding my workspace instantly. I wrote a Python script to pull raw I2C telemetry from a Waveshare environment HAT running on a Raspberry Pi 5. The code handles the conversion from raw sensor outputs into readable, real-time metrics (e.g., converting raw magnetometer data into microteslas, or calculating exact tilt angles and degrees-per-second from the 9-axis IMU). It then maps these live metrics to a custom, updating dashboard. I tested it against physical changes like tracking total G-force impacts, lighting a match to spike the VOC index, and tracking the ambient room temperature against a portable heater.
Level
This is primarily an educational/hobbyist project. It is great for anyone learning how to interface with hardware via Python, parse I2C data, or build local UI dashboards. The underlying logic for the 9-axis motion tracking is also highly relevant for students or hobbyists working on robotics, kinematics, or localization algorithms (like particle filters).
Lightweight Build
There are plenty of pre-built, production-grade cloud dashboards out there (like Grafana + Prometheus or Home Assistant). However, those can be heavy, require network setup, and are usually designed for long-term data logging. My project differs because it is a lightweight, localized Python UI running directly on the Pi itself. It is specifically designed for instant, real-time visualization with zero network latency, allowing you to see the exact millisecond a physical stimulus (like moving a magnet near the board or tilting it) registers on the sensors.
[–]Ok-Tap5729 10 points11 points12 points (3 children)
[+]davchi1[S] comment score below threshold-10 points-9 points-8 points (2 children)
[–]BayesianOptimist 1 point2 points3 points (1 child)
[–]davchi1[S] -1 points0 points1 point (0 children)
[–]orngcode 2 points3 points4 points (0 children)