• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Magnetometer help needed!

charles98

New Member
Hello,

First off, I have to say I am relatively new to magnetometers.


I have been working in a project for the detection of magnets (they can be different sizes) in a three dimensional space around the sensor.


The magnets and sensor positions are not strictly defined and they can be in any orientation in space. I am now using the LIS3MDL board to try and accomplish this.


I am able to use SensorLab library with MotionCal to obtain relatively good values for calibration. I then use the calibrated magnetometer output values to calculate the magnitude of the magnetic field. By continuously reading the sensor, I check for the increase or decrease in the magnitude value which occur when a magnet approaches from any direction.



The problem I have is that over time the sensor will experience drift in the measurements.

This will cause the magnitude value, which before was relatively stable, to change a lot as I rotate the sensor :(



Is there any way to solve this problem?


I have by now done some research and have not reached any answer. Any tips or knowledge would be appreciated.


Thank you in advance for any help, really!
 

gophert

Well-Known Member
Most Helpful Member
This will cause the magnitude value, which before was relatively stable, to change a lot as I rotate the sensor :(
how much is "a lot"? Fractions of a gauss? Or several gauss?
 

charles98

New Member
I am using the values in uT for each axis.

When calibrated I get a magnitude of around 41 give or take 1 or 2 uT when rotating the sensor.

After some time this magnitude starts drifting a lot more, from 30 to 50uT while rotating.
 

gophert

Well-Known Member
Most Helpful Member
That is to be expected - the earth's magnetic field is 30 to 60 uTesla so your base measurement of 42 is to be expected. Rotating your compass (I mean magnetometer) will cause that as you turn it.
 

gophert

Well-Known Member
Most Helpful Member
That would be kind of like a second microphone on a noise cancelling microphone. If the second microphone (not pointed at the singer picks up the same thing as the singer's microphone, it is cancelled with a difference amplifier.
In the case of magnetometers, I think (Think) the idea is that if x = y the effect is background noise and only the z-axis changes are real signal to detect a field. The math (relation) between x and y is probably more complicated than x = y. I think there is a square in there somewhere to cancel +/-. I'm sure more details are on the web somewhere.
 

EE World Online Articles

Loading
Top