May 31 2025

SparkFun Qwiic Sensor Dashboard – Developed Using Gemini


Author: Shafeeque Olassery Kunnikkal | Category: Raspberry Pi, Sensor Dashboard, Sprakfun QWiic Sensors | Leave a Comment

1. Introduction / Objective

This project showcases the integration of various SparkFun Qwiic sensors into a unified, interactive dashboard. The entire application was developed using Gemini, and it allows real-time visualization and logging of raw sensor data.

It provides a user-friendly and customizable GUI built in Python, specifically designed for single-board computers like the Raspberry Pi. The dashboard supports real-time monitoring, interactive data visualization, and comprehensive logging of environmental data collected from multiple SparkFun Qwiic sensors.

🔗 Project Download

You can find the complete source code and installation instructions on GitHub:
Download SparkFun Qwiic Sensor Dashboard

2. Methodology / Approach

Modular Components

The application is structured into dedicated Python modules, each handling a specific functionality:

  • sensor_interface.py – Interfaces with physical sensors via I2C. Includes mock data generation for testing.
  • data_manager.py – Stores historical sensor data using collections.deque for efficient filtering and plotting.
  • data_logger.py – Manages disk logging per sensor with archiving support.
  • sound_manager.py – Optional audio feedback using the pygame library.
  • gui_widgets.py – Custom Tkinter widgets, including a real-time GaugeWidget.
  • sensor_reader.py – Background thread for polling sensors and pushing updates.
  • gui_app.py – Main GUI built with tkinter and styled using ttkbootstrap.

Multi-threading for Performance

A dedicated SensorReader thread handles data acquisition and logging to keep the UI responsive. Thread-safe queues manage communication between threads.

Interactive Data Visualization

matplotlib enables dynamic plots for time-based data, with tabs for individual and combined sensor graphs.

Modern and Responsive UI

The GUI uses ttkbootstrap for a clean, responsive layout optimized for small screens like the Raspberry Pi touchscreen.

Error Handling and Mock Mode

If sensors or dependencies are unavailable, the dashboard switches to mock mode, simulating sensor data for development and demos.

3. Hardware and Software Requirements

Hardware

  • Single-Board Computer: Raspberry Pi recommended
  • Supported Sensors:
    • SparkFun BME280 – Temp, Humidity, Pressure, Altitude
    • SparkFun SGP40 – VOC Index
    • SparkFun Qwiic Proximity – Distance, Ambient/White Light
    • Adafruit/SparkFun SHTC3 – Temp & Humidity
  • Qwiic HAT or Adapter for I2C
  • Display: 800×480 minimum recommended

Software

  • Python 3.7 or newer
  • Required Python packages (via pip):
    • ttkbootstrap
    • matplotlib
    • pygame (optional)
    • sparkfun-qwiic packages
    • adafruit-circuitpython-shtc3
    • adafruit-blinka
  • Enable I2C via sudo raspi-config
  • Optional sound files: alert.wav, up.wav, down.wav

4. UI and Plot Previews

The dashboard includes tabs for individual and combined sensor plots:

BME280 – Temperature, humidity, pressure, altitude trends

SGP40 – VOC index over time

SHTC3 – Real-time temperature and humidity

Proximity Sensor – Distance and light levels

5. Conclusion

The Qwiic Sensor Dashboard can be used as custom environmental monitoring tool. It combines live sensor data visualization, efficient data logging, and a modern UI, all in a lightweight Python application suitable for Raspberry Pi.

Its modular structure makes it easy to extend with new features or sensors, while its mock mode allows experimentation without hardware. The use of multithreading ensures a smooth, lag-free experience even under continuous data acquisition.

Future enhancements could include:

  • Custom alert thresholds
  • Data export to CSV or JSON
  • Enhanced plotting features (zoom, pan, annotations)

🔗 Project Download

You can find the complete source code and installation instructions on GitHub:
Download SparkFun Qwiic Sensor Dashboard

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

Tags

Archives