Skip to content

About

Python-based gait analysis system using Raspberry Pi and IMU sensors for real-time event detection, gait parameter calculation, and automated clinical report generation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦶 Gait Analysis System using IMU Sensors

Python
Raspberry Pi

A Python-based gait analysis system built with Raspberry Pi 4B and LSM6DS3 IMU sensors.
This project enables real-time gait event detection, temporal-spatial parameter extraction, and automated report generation, designed to assist physiotherapists and healthcare professionals in monitoring patient rehabilitation.


🚀 Features

  • IMU Data Collection

    • Collects accelerometer & gyroscope data from multiple LSM6DS3 sensors via Qwiic multiplexer.
    • Controlled wirelessly using a Qwiic button (no HDMI needed).
  • Data Processing

    • Filtering, bias correction, smoothing of raw signals.
    • Removal of static/non-gait periods.
  • Event Detection

    • Detects Initial Contact (IC) & Final Contact (FC).
    • Uses peak-grouping strategy for accuracy.
  • Parameter Extraction

    • Step time, stride time
    • Stance time, swing time
    • Step length, stride length
    • Walking speed, cadence
  • Force Estimation

    • Calculates heel-strike impact force per step.
    • Configurable based on patient’s mass.
  • Automated Report Generation

    • PDF/PNG reports with:
      • Acceleration & gyroscope time-series plots
      • Event detection visualization
      • Stride-wise speed & cadence trends
      • Violin plots & summary tables

🛠 Tech Stack

  • Hardware

    • Raspberry Pi 4B
    • Qwiic Hat & Qwiic Multiplexer
    • IMU Sensors (LSM6DS3)
    • Qwiic Button
  • Software

    • Python (NumPy, SciPy, Pandas, Matplotlib, ReportLab)
    • pigpio (for I²C communication)
    • OpenSim (optional for biomechanical modeling)

🔌 Hardware Setup

  1. Connect LSM6DS3 sensors to the Qwiic Multiplexer (e.g., channels 1, 2, 3).
  2. Attach the Qwiic Button to channel 0 (start/stop trigger).
  3. Connect the multiplexer to the Qwiic Hat on Raspberry Pi 4B.
  4. Ensure pigpiod service is running for I²C communication.

📊 Example Output

  • Step Length (m): 0.712 ± 0.008
  • Walking Speed (m/s): 0.414 ± 0.056
  • Cadence (steps/min): 55.3 ± 21

Reports include:
✅ Time-series graphs of accelerometer & gyroscope data
✅ Event detection visualization
✅ Stride-wise gait parameter plots
✅ PDF summary tables for clinical use


🩺 Applications

  • Clinical gait assessment
  • Rehabilitation monitoring
  • Sports biomechanics
  • Research in human movement

👨‍💻 Author

Chinmay Mhatre

About

Python-based gait analysis system using Raspberry Pi and IMU sensors for real-time event detection, gait parameter calculation, and automated clinical report generation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages