Disclaimer: This project provides a foundational framework of minimal, educational applications designed to demonstrate the Raspberry Pi SenseHAT's capabilities. These initial implementations serve as a strategic starting point for developers, students, and hobbyists to explore and expand sensor data visualization and interactive programming.
Purpose and Potential: The modules presented here are intentionally kept simple and focused, serving as a launchpad for innovation. They are not meant to be final products, but rather inspirational blueprints that invite creativity and personal enhancement. Each component is engineered to be:
- Easily understandable
- Straightforward to modify
- Extensible with advanced features
- A learning resource for sensor interaction and data visualization
Developers are encouraged to:
- Experiment with more complex visualization techniques
- Implement advanced data processing algorithms
- Design more sophisticated user interfaces
- Add machine learning predictions
- Create novel interactive experiences
This project is a multi-component application designed to leverage the capabilities of the Raspberry Pi Sense HAT Version 1.0, providing interactive sensor data visualization and engaging interactive experiences. The system is architected as a client-server application that enables real-time sensor data retrieval, processing, and visualization across different modules.
The project consists of several key modules:
-
Gyroscope Module:
- Provides real-time orientation data through a Flask server
- Implements advanced quaternion-based smoothing for fluid 3D visualization
- Enables precise tracking of device orientation in three-dimensional space
-
Snake Game Module:
- A sophisticated implementation of the classic Snake game
- Utilizes SenseHAT's LED matrix for rendering
- Features multiple difficulty levels with progressively complex game mechanics
- Includes dynamic wall generation and adaptive game speed
-
Accelerometer Module:
- Real-time seismic activity monitoring and visualization
- Advanced Peak Ground Acceleration (PGA) calculation
- Interactive graphical interface with:
- Precise 3-axis acceleration data display
- Dynamic earthquake intensity estimation
- Real-time acceleration plotting
- Customizable data visualization controls
- Earthquake intensity classification based on acceleration metrics
- Robust error handling and connection management
-
TPH (Temperature, Pressure, Humidity) Module:
- Comprehensive environmental parameter monitoring
- Real-time data collection from SenseHAT sensors
- Dual-view interface:
- Current values display with dynamic color-coded indicators
- Detailed time-series graphical representations
- SQLite database integration for persistent data logging
- Automatic database initialization
- Continuous sensor reading storage
- Configurable update intervals
- Adaptive UI with error state handling
- Advanced data visualization using custom time-axis plotting
git clone https://github.com/Dmytro-Malets/SenseHAT.gitcd SenseHATcp .env.template .envEdit the .env file and replace YOUR_RASPBERRY_PI_LOCAL_IP with your Raspberry Pi's local IP address.
python3 -m venv venvsource venv/bin/activatepython -m venv venvvenv\Scripts\activatepip install -r requirements/client/requirements.txtpip3 install -r requirements/raspberry/requirements.txtOn your Raspberry Pi, execute the following commands:
git clone https://github.com/RPi-Distro/RTIMULibcd RTIMULib/Linux/pythonpython3 setup.py buildpython3 setup.py installcd ../../..To run the server components for different modules, use the following commands:
python3 gyroscope/server.pypython3 accelerometer/server.pypython3 TPH/server.pypython3 snake/snake.pyOn your client machine, launch the respective client applications:
python gyroscope/client.pypython accelerometer/client.pypython TPH/client.py- Ensure network connectivity between devices
- Verify IP address in
.envfile - Check Python and library versions
- Confirm SenseHAT is properly connected
SenseHAT/
│
├── accelerometer/
│ ├── client.py
│ └── server.py
│
├── gyroscope/
│ ├── client.py
│ └── server.py
│
├── TPH/
│ ├── client.py
│ ├── server.py
│ └── environment_data.db
│
├── snake/
│ └── snake.py
│
├── requirements/
│ ├── client/
│ │ └── requirements.txt
│ └── raspberry/
│ └── requirements.txt
│
├── .env
├── .env.template
├── .gitignore
├── README.md
Contributions are welcome! Please submit pull requests or open issues for any improvements or bug fixes.
- SenseHAT Documentation - https://pythonhosted.org/sense-hat/