2018-02-05 10:54 AM
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!
2018-02-05 11:37 PM
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
.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
2018-02-06 01:29 AM
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..
2018-02-06 02:15 AM
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...
2018-02-06 02:20 AM
Regarding the power consumption:
Here is an extract from
:And similar for the
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
2018-02-06 04:22 AM
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
, section 4.3 High-pass filter. This will remove the DC value from the readings.David
2018-02-06 06:03 AM
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..
2018-02-06 01:02 PM
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.2018-02-06 01:18 PM
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.
D.
2018-02-09 12:08 AM
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!