cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3MDL orientation

Acuario
Associate

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).

2 REPLIES 2
Federica Bossi
ST Employee

Hi @Acuario ,

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

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
HughDavenport111
Associate II

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.