Skip to main content
Visitor II
June 6, 2018
Question

Is there a way to detect overflow with LIS2MDL?

  • June 6, 2018
  • 2 replies
  • 886 views
Posted on June 06, 2018 at 19:15

Greetings

I am using the LIS2MDL to build a magnetic field sensor for the education market.  When the magnetic field being measured exceeds the maximum allowed value, I notice that the LIS2MDL returns unpredictable data rather than 0x7fff (32767) or 0x8000 (-32768).

Is there a way I can detect a magnetic field measurement overflow so that our visualization software can let the user know the measurement data is invalid?

Thank you

Scott Wild

    This topic has been closed for replies.

    2 replies

    Visitor II
    July 10, 2018
    Posted on July 10, 2018 at 12:24

    Hi,

    You can check the MROI bit in INT_SOURCE_REG. This flag alerts if a measurement range overflow has occured. Make sure that the interrupt generator is active (IEN bit = 1). Latched MROI bit is reset by reading INT_SOURCE_REG.

    Greetings

    Maciej

    Visitor II
    July 30, 2018

    Hi, I have the same behaviour with LIS2MDL and also with a LIS3MDL.

    My application is to detect the proximity of a magnet. Under about 1cm the measures are unexpected.

    I have done some experiments with some other sensors but with only one axe and the behaviour is as expected : the closer the magnet, the higher the measurement until saturation, which stays saturation...

    I have tried the Maciej's proposition but this process comes too late, the measures are already false.

    Scott did you manage to get a correct operation ?

    Thanks

    Peter