Code Monkey home page Code Monkey logo

magnetometer-calibration's Introduction

Magnetometer-Calibration

MIT

Overview

A MEMS magnetometer present in a smartphone needs to be calibrated before using it to measure the magnetic field. As an example, the process is demonstrated in the following YouTube video:

Youtube Video

The algorithm running behind this application has been implemented here. As the user moves the mobile in the specific motion, the data from the magnetometer is fit into a sphere. The center of the sphere is then subtracted from the subsequent sensor data to get the calibrated values.

Files

The following files/folders are present in this code:
[1] data : this folder contains the data from all the sensors, namely, magnetometer and accelerometer.
[2] mag_cal.m : this script performs calibration and produces 3 plots. The first one shows the rolling pebble as in the video, the second one shows the sensor data being read, and the third one shows the sphere that was fit using the data.
[3] emptyBuffer.m : this function creates a buffer for storing data on which calibration is performed.
[4] readSensData.m : this function was auto generated from MATLAB to read sensor data from text files present inside data folder.
[5] sphereFit.m : this function fits a sphere into a set of points and returns the fitting parameters.
[6] constants.m : this file stores the constants used in “mag_cal.m”.

Result Screenshot

image1

Note

[1] Code was tested on MATLAB 2014b.
[2] Data was collected by using an application on play store. (Link to app)

magnetometer-calibration's People

Contributors

kritiksoman avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.