cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12

bennanbei
Associate II

Guys, I ran into a strange problem while debugging LIS2DH12, someone help me.

I configured the high-precision mode, using 12 bits, with a range of +-4g, that is, when I placed the table (the chip with the sign facing up, the positive direction described in the instructions) it should have been subject to neutral acceleration and the converted value should have been -1g, but the result I got was +1g, I verified the other two axes, The resulting acceleration value is the opposite of the direction indicated in the manual, that is, when I always accelerate in the opposite direction of each axis, the resulting conversion value is indeed positive

bennanbei_0-1711373762150.pngbennanbei_1-1711373806843.pngbennanbei_2-1711373822879.png

bennanbei_3-1711373830515.png

 

Moreover, I read out the register value directly using lis2dh12_from_fs4_hr_to_mg function for conversion, and the size is close to 1g, but its direction is reverse, at this time I am the chip marked up, the acceleration value should be gravity acceleration downward is negative, it is positive.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @bennanbei ,

So everything works fine now, right?

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.

View solution in original post

4 REPLIES 4
bennanbei
Associate II

I see. It's the accelerometer and the direction of acceleration. I didn't get it. I should have looked at how the accelerometer works

Hi @bennanbei ,

So everything works fine now, right?

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.

yes

Hello, I have recently encountered a new problem that I cannot understand. Now I read the original data in three directions. I set lis2dh12 to 25hz high-precision 12-bit mode range +-4g, and then I put the three axes stationary on the table to read the original data. I changed the measuring range to +-2g or +-8g. Every time the original acceleration data changed, it was a multiple of 16. My understanding should not be such a coincidence, why?

bennanbei_0-1717224752616.png

bennanbei_1-1717224764660.pngbennanbei_2-1717224779405.png