Skip to content

Sensor interfacing of 6 axis MEMS inertial sensor MPU6050 with ARM Cortex M4 Texas Instruments Tiva C series TM4C123GH6PM.

Notifications You must be signed in to change notification settings

ShwetaKiranTotla/Gesture_Recognition_Tiva_C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

The Project

This repository contains files for gesture recognition (in C) using the TM4C123GH6PM MCU and MPU6050 6 axis IMU using TI CCS.

This project was done when I had a fairly good grasp on programming the ARM Cortex core and Tiva C series microcontroller. Thanks to Abhijit Sir, I am not dependent on libraries and have directly accessed the registers.

The Journey: From Idea to Code

As this was the first time with MPU6050, I started with understanding the register from the official documentation of the sensor. Based on this a header file containing register address was compiled.

Simultaneously I was also working on configuring I2C with the microcontroller as the MPU uses I2C to communicate (there are other involved options as well).

There were erratic samples in the data being read (the values of linear and angular acceleration would be quite high even when the device was stationary). Considering the possibility of oversampling, a delay was added after each iteration but that did not help (because the data wasn't being oversampled!). Nor did changing the sensitivity from 2g to 4g. After initializing the arrays to 0, the values of ax, ay were not visible (that were previously visible) in the expression of CCS debugger. Then, after some brainstorming, to filter noise from the samples, a Parks McCollen filter was simulated in MATLAB, but I did not implement it, instead I implemented a combination of two facts: one, when the values of acceleration is erratic, so is the value of temperature, so only those samples which have a reasonable temperature were read and a moving average filter over these data. I also used the data ready interrupt of the MPU to read samples and it helped.

References

  1. Github Library for various applications of MPU6050 with Arduino

  2. Github Library for MPU6050 and ESP8266 based gesture recognition program on Adafruit ARM core using Arduino IDE

  3. Interface MPU6050 Accelerometer and Gyroscope Sensor with Arduino
    An in depth explaination of the working of the sensor, it's measurements and its interfacing on Arduino.

  4. MPU6050 source C file for Tiva C series

  5. The MPU6050 Explained by Programming Robots
    Arduino code for the MPU6050 along with sensor calibration.

  6. About the Digital Motion Processor on MPU6050 by stackexchange

  7. I2C device Library

  8. I2C communication with Tiva C series

  9. Another Github Library of MPU6050 with Arduino

  10. Arduino and MPU6050 on Github with Error Calculation

  11. MPU6050 Tiva C Launchpad

  12. Mpu6050: Utilizing Tiva C Direct Register Mode for Power Management of MPU6050

  13. Interfacing MPU6050 with STM32

  14. Electronics Stack Exchange topic on inconsistent MPU6050 values

Releases

No releases published

Packages

No packages published