cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DH as movement/tilt sensor

Id At
Associate II
Posted on February 05, 2018 at 19:54

Hi ALL, I bought the LIS3DH development kit.

I want to use it as a sensor that will wake my MCU with interrupt when someone moved my board or tilt it.

I have some constrains:

1. I need low consumption current with my current bat.

2.I can't assume what is the initial condition that the board will be.

3.I want to control the sensitivity.

 I tried a lot of option with the development kit but all of them didn't give me the desiered situation.

will you help me understand if the LIS3DH is the right choice for this task and suggest solutions?

thank you!

10 REPLIES 10
Legacy member
Not applicable
Posted on February 06, 2018 at 08:37

Hello,

If you want to separately detect movement (acceleration) and tilt, one of

http://www.st.com/en/mems-and-sensors/inemo-inertial-modules.html?querycriteria=productId=SC1448

 might be a better solution.

LSM6DS3, for example, features power consumption: 0.9 mA in combo normal mode and 1.25 mA in combo high-performance mode up to 1.6 kHz.

However, it is also possible to measure tilt using just an accelerometer, see this

http://www.st.com/content/ccc/resource/technical/document/application_note/d2/d6/22/4f/b9/8f/45/59/DM00119046.pdf/files/DM00119046.pdf/jcr:content/translations/en.DM00119046.pdf

.

It all depends on your requirements and then the device setup. The interrupt can be generated for any range, but there is also a time variable, for how long the value is above the acceleration / tilt threshold. (For example if you set 4 g for 1 second, it might be difficult to do, unless you are in a fighter jet.)

In your situation, I would suggest a step by step approach. Set the device into continuous measurement mode and try moving the device, estimate some acceleration threshold that is meaningful for your application. Then try to set an interrupt (with proper time duration) for this threshold. If you have any difficulties, paste all your setup code and describe the specific behaviour, so we can see what might be wrong.

David

Posted on February 06, 2018 at 09:29

first of all - thank you.

1. I aimed to 10-20uA power consumption..even if the rate will be low.. does 

LSM6DS3 will be ok? 

2. I did the experiment but the problem is that if the initial conditions.. when the initial g is 0 i set the threshold to 0.1g for 20msec and it worked well.. but now I started with 0.8g and the interrupt recognized i passed the 0.1g.. so i tried to put 0.9.. but i want that it work with 0.7 too.. so... it didn't work well..

Id At
Associate II
Posted on February 06, 2018 at 11:15

i put the system where the acceloration in the axis will be x=0, y=1000, z=0 mg

now i set the threshold to ~+-100mg at z axis and when i tilt it, it was ok.

next time, i put my system at x=0, y=0, z=1000mg.

now i set the threshold to 100mg and it allways on... I should want to set the threshold to >1100, <900... but i can't do that...

Legacy member
Not applicable
Posted on February 06, 2018 at 10:20

Regarding the power consumption:

Here is an extract from

http://www.st.com/content/ccc/resource/technical/document/datasheet/3c/ae/50/85/d6/b1/46/fe/CD00274221.pdf/files/CD00274221.pdf/jcr:content/translations/en.CD00274221.pdf

:0690X00000609cwQAA.png

And similar for the

http://www.st.com/content/ccc/resource/technical/document/datasheet/a3/f5/4f/ae/8e/44/41/d7/DM00133076.pdf/files/DM00133076.pdf/jcr:content/translations/en.DM00133076.pdf

0690X00000609d1QAA.png

It seems that the gyroscope adds significant amount of power consumption compared to just an accelerometer. Also, as low Vdd as possible is needed.

I am not sure I fully understand the test situation you described. 0.1 g triggeres an interrupt, but 0.8 not? Could you share the code or values that you use to set the control registers?

David

Legacy member
Not applicable
Posted on February 06, 2018 at 12:22

Oh, now I understand. The gravity is triggering your interrupt, because 1 g is above your 100 mg threshold.

I think you need to enable a high pass filter in your device, please see

http://www.st.com/content/ccc/resource/technical/document/application_note/77/ed/e7/e1/28/5a/45/d6/CD00290365.pdf/files/CD00290365.pdf/jcr:content/translations/en.CD00290365.pdf

, section 4.3 High-pass filter. This will remove the DC value from the readings.

David

Id At
Associate II
Posted on February 06, 2018 at 15:03

oh thanks! I will try it.. just i didn't understand when i enable high pass with reference for example..which axis it takes place? we have 3 axis and only 1 reference..

Posted on February 06, 2018 at 21:02

The high pass filer is the right way how to make it working as you expect.

You can enable high pass filter, using normal mode HPM1 = 1, HPM0 = 0, it will remove the DC component from the signal, witnout need to set the reference.

Otherwise the reference is valid for all three axis.

You can also consider usign

http://www.st.com/content/st_com/en/products/mems-and-sensors/accelerometers/lis2dw12.html

which is super low power.0690X00000609cNQAQ.png
Legacy member
Not applicable
Posted on February 06, 2018 at 21:18

I haven't tried that mode myself, but according to the diagram, it seems that the filter works for the ADC which is a source for all the output registers.

0690X00000609dLQAQ.png

D.

Id At
Associate II
Posted on February 09, 2018 at 09:08

Thanks! it works as i wanted! the software to the development kit is awesome!

I have 2 more questions please:

1. by the data sheet the maximum vdd is 3.6v but the maximum abselute is 4.8. i wish to use a li-ion bat (4.2v) without a voltage regulator. is it avaliable? the LIS3DH will work fine?

2.when I set the INT1_CFG register to put an interrupt when X,Y,Z will go high or low on events (0x3f at this register) the device allways make an interrupt.. only when I used interrupt at 'high' event (0x2a) it works fine, so - why is that? i want interrupt when it changes - low or high..

thanks!