Tuesday, 29 July 2014

Arduino Libraries for MPU6050 and HMC5883L

In this article I am going to write about the different arduino libraries which i had developed as a part of Summer Internship project at National Institute of Oceanography Goa. My project was based on remote health monitoring system, part of which was to develop an IMU (Inertial Measurement Unit ) for an ambulance.


IMU is used for measuring the orientation of the body, acceleration, angular velocity, heading etc. This is calculated using Accelerometer, Gyroscope and Magnetometer.
For accelerometer and gyroscope we had used MPU6050 module by Robokits and for magnetometer we had used HMC5883L from Robokits.

Actually we can also use ADXL345 accelerometer and  L3G4200 gyroscope which are available in module mentioned in 2nd link along with magnetometer, but it will result in alignment error as both  are 2 different chips. So for highly sensitive applications it is not a sensible thing to use those 2 chips. and hence we had made use of  MPU6050 module which contains both accelerometer and gyroscope on a single chip. 

Libraries can be downloaded from following github link.


There are 2 libraries - 1 for MPU6050 and other 1 for HMC5883L.
Both contain functions for initializing the modules,  converting raw data in proper scale and displaying the data in various forms. 

Libraries are written in C++. So for using the libraries in your program first of all you have to create a class object and then you can access all public variables and functions used in the library.




No comments:

Post a Comment