LIS3MDL

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
PhysicsUTK
 
Posts: 12
Joined: Fri May 07, 2021 10:36 am

LIS3MDL

Post by PhysicsUTK »

My LIS3MDL Magnetometers are not showing per my Reference magnetic field frame the + - for the magnetic field.
For example, the MX position of the LIS3MDL in relation to the BX should show in one direction +40 then in the other direction -40 +-1. However, in rotation of the magnetometer, it stays negative showing a -40, and then after rotation, it shows a -1. Using my iPhone as a baseline it shows the MX as +30 and then a -20 after the rotation in relation to my arbitrary lab magnetic BX setup.
I had my own script but it still is doing this with the LIS3MDL example. Should it not change the MY and MZ seem to be working as they should just not the MX.

With my, iPhone is am using the physics toolbox and the magnetometer program within the software.

Any help as to why this is happening would be helpful

User avatar
PhysicsUTK
 
Posts: 12
Joined: Fri May 07, 2021 10:36 am

Re: LIS3MDL

Post by PhysicsUTK »

Ok, so what I am trying to do is get an accurate reading of the magnetic field as I flip the chip. As I get when flipping the Spectromag 6 Magnetometer. The Spectromag is Fluxgate magnetomter. So in one position, I get a reading of the x, 40 uT, Z 12 uT, and the y is pointing down giving 30 uT. When I move the X 180 so pointing the other direction I will get -40 uT Z -12 uT and Y reads the same 30 uT. I need to have the LIS3MDL behave the same way. Currently, no matter what position I put the chip it will not change and reads all negative or all positive. Is this possible to set the LIS3MDL single unit to perform the same task as the Bartington when reading the magnetic field? So far it does not. It seems at this point I would have to use three units to get similar values when rotating. That being said I do know the Magnetometer is ST and use magnetoresistive (AMR) so maybe that could be why it is not behaving the same. Any suggestions would be helpful.

User avatar
sj_remington
 
Posts: 997
Joined: Mon Jul 27, 2020 4:51 pm

Re: LIS3MDL

Post by sj_remington »

For reasonably accurate measurement of magnetic fields, all MEMS magnetometers need to be calibrated before use. Zero offsets and scale factors must be computed for each axis.

The best overview and tutorial on magnetometer calibration is this one: https://thecavepearlproject.org/2015/05 ... r-arduino/

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”