FXOS8700 Magnetometer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FXOS8700 Magnetometer

1,712 Views
michaelchapman
Contributor I

Hi, I'm using the NXP FXOS8700 and a FXAS21002C on a Adafruit breakout board that uses I2C comms. Each device can be configured and the status read using single and multi-byte transfers as shown in the attached document. However the magnetometer gives an output that seems odd that is to say it doesn't make sense to me.

I have tried degaussing the sensors too try and get rid of any residual magnetic field. One of my boards has a massive offset.

I was expecting the magnetic sensor to give and out similar to the accelerometer, i.e. the output when pointing:

  1. towards magnetic north would be +ve
  2. in the opposite direct (point south) would be -ve and approximately 60uT
Tags (2)
0 Kudos
2 Replies

1,159 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Michael,

Yes, the magnetometer requires calibrating not only for its own offset but usually also against spurious magnetic fields resulting from any nearby ferromagnetic components on the PCB. The AN4246 discusses it in more detail. 

A simple software calibration of magnetic hard-iron offset is to rotate the board in a figure of eight twisting motions for a few seconds, record the minimum and maximum magnetometer readings, and compute the hard-iron calibration from their average. Have a look at my simple example code where I illustrate it.

Hope it helps.

Best regards,

Tomas

0 Kudos

1,159 Views
michaelchapman
Contributor I

Thanks Tomas I will try the calibration process that I’ll adapt from your code.

I think the way the magnetic sensor is a mystery to me!

Regards

Mike

MJ Chapman

Tel: 01483 504136

Mob: 07768 585894

Email: <mailto:mjachapman@subcraft.co.uk> mjachapman@subcraft.co.uk

0 Kudos