Skip to main content
Visitor II
November 28, 2024
Question

LIS3MDL orientation

  • November 28, 2024
  • 2 replies
  • 728 views

Hi,

I am developing a product that can be installed in either a horizontal or vertical orientation and uses the LIS3MDL as the source for a compass..

The PCB is common so the LIS3MDL will be in one of 2 orientations.

In a horizontal position everything is fine and I get the readings expected.

In vertical orientation it is not working.

My assumption was that the axes X,Y,Z were just names and that the data from each axis was relevant to that axis and that the data obtained would relate to the plane that axis was on.

It seems this is incorrect. I have run a test and see that the range of values (max-min) on each axis is very different, particularly on the Z axis.

Moving the sensor through 360 degrees on each axis I am getting X -59 to 25, Y -36 to 46, Z -86 to 0

I assumed I would get the same min to max for each axis.

So can the sensor be used in a vertical orientation? 

I need the Z axis facing forward (to replace X) and X axis facing left (to replace Y).

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    December 5, 2024

    Hi @Acuario ,

    Can you share the raw data? Just to understand the differences you saw.

    Visitor II
    December 6, 2024

    The sensor can be used in a vertical orientation. You need to adjust the data in your software to correct the magnetic field so that the sensor output is consistent with the actual direction.