📟 Embedded-Gyrometer
A Real Time Embedded Systems course project
New York University
Overview our Embedded Challenge submission. (a) is the initial screen that shows when the STM32 F429 DISCOVERY board is first powered on. The user is required to use the blue button to input their height. (b) is the next screen that is shown once the height is accepted. The user can use the data shown on screen for their own purposes.
Abstract
The core objective of our project was to design and construct a wearable speedometer, capitalizing on the capabilities of the STM32F429 Discovery Board's built-in gyroscope (L3GD20). This innovative approach required us to capture angular velocities and accurately convert them into linear forward velocity, subsequently computing the distance traveled. Such a device holds considerable promise in offering a compact and efficient solution for speed and distance measurement, particularly in fitness and health monitoring contexts. The solution we present requires no calibration step and is axis independent. We are able to estimate the velocity and distance travelled.
Methodology
Overview of the system architecture of our solution.
Distance traveled by the user is dependent on their physical strides. We can approximate this by taking in the height of the user as input in centimeters. The STM32F429 Discovery Board is interfaced with the built-in gyroscope (L3GD20) using the SPI (Serial Peripheral Interface) communication protocol. This involves setting up the SPI with the appropriate configurations (CTRL_REG1, CTRL_REG4, CTRL_REG3) to accurately capture the gyro data. Angular velocities are sampled every 0.5 seconds (SAMPLE_INTERVAL_MS) to get the raw data from the gyroscope in degrees per second. Subsequently, the scaling factor (SCALING_FACTOR) is applied to convert it into more meaningful unit for further calculations i.e., radians per second. Following the conversion, the data is passed through a low pass filter to remove the high-frequency noise.
In determining the direction of angular velocity along the user's movement, the approach involves selecting the axis with the largest variance among the three. This ensures the effectiveness of the solution irrespective of the board's alignment. The magnitude of linear velocity is calculated by using the absolute values of angular velocity along the axis of movement and the user's leg length as the radius of rotation. An assumption has been made that the leg length is approximately 45% of a person's height.
\[ v = \omega \cdot radius \]The calculation of the distance traveled involves integrating the linear velocity throughout the sampling period. This is accomplished by summing the average linear velocities over the 20-second data recording period and then multiplying by the sample interval.
\[ v = \frac{d}{t} \] \[ d = v \cdot t \]Citation
If you use this work or find it helpful, please consider citing: (bibtex)
@software{Gupta_Embedded-Gyrometer, author = {Gupta, Shubham and Zhu, Charles and Gupta, Sarthak}, title = {{📟 Embedded-Gyrometer}}, url = {https://github.com/synkathairo/embedded-gyrometer} }
Acknowledgements
The website template is inspired by Cavemen. The project uses components from the recitation lectures of Real Time Embedded Systems.