cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH - wrong Z reading - has something to do with power supply

Posted on June 15, 2016 at 17:15

Hello,

I'm working with LIS2DH on SPI, where also some other SPI slaves are connected. The supply power is 3.0V, VDD and VDD_IO are connected.

I configure it and keep reading the accelerations x,y,z just fine.

But in certain circumstances the z acceleration is wrong or the values are frozen.

I identified the following:

The behavior depends on the power supply cycle.

If I disconnect my device from power supply when the rest voltage on the capacitor did not drop bellow around 0.3V, it will work.

If the device is disconnected for some time, the voltage drops bellow 0.3V. Then the z accelerometer does not work correctly. It reads some 1g instead of -1G and 3G instead of 1G and it seems to be linear. Another device reads some 1.2G instead of -1G and some other value instead of 1G. So it is not the same as in the first case.

When connected when the value is around 0.3V the readings sometimes freeze in all 3 axis.

The mentioned 0.3V does not to be a fixed value, it is somewhere around it and it can change slightly.

I tried change ODR, full scale, run the configuration in a different time, remove the code for other peripherals etc. but it did not help.

Does anyone have a clue what could cause the mentioned problem?

Thank you.

Lukas

#lis2dh
3 REPLIES 3
Mohit Gautam
Associate II
Posted on May 18, 2017 at 12:27

Hi,

I also observed the same issue, do you get any update on this? Thanks in advance.

Miroslav BATEK
ST Employee
Posted on May 19, 2017 at 15:22

I would recommend you reboot memory content by writing ''1'' in BOOT bit in CTRL_REG5 after power up sequence.

0690X000006073QQAQ.png
Posted on May 21, 2017 at 12:20

Hi,

I am using LIS2DH sensor for a project and facing some difficulties to read FIFO because the value return from the OUT_X, OUT_Y and OUT_Z registers are ranging between 50 and 127 which is not possible because 60*192(1LSb = 192 mg @ FS = +/-16g)=12g but the shaking of the device was not such severe , roughly it's about 2g to 3g. Below are some register configurations that has been set :-

1)ODR is set to 25 Hz.

2)Full scale is set to +/-16g

3)FIFO enable flag has been set

4)Click threshold is set to 1.8g

5)FIFO control register is set to 0x5f

6)Low power 8-bit mode has been used

The process to read the FIFO has described below step by step :-

1)Wait for the fifo to reach upto the watermark value i.e. 32

2)After the FIFO has been upto the watermark value we read OUT_X, OUT_Y and OUT_Z registers till the FIFO becomes empty.

3)After that we put the FIFO mode to bypass mode by writing 0x00 to the FIFO_CTRL register.

4)At last we again reload the  value of the  FIFO_CTRL register to the default value i.e. 0x5f.

So,  What may be the reason for the value to vary a lot in this scenario?