2020-09-01 02:25 AM
Hello ST,
I am using LIS2DS12 sensor for step detection application. I read the step count register every 1 minute and reset the count value. I observe that even if the object is stationary, the step count register has a non-zero value (The value varies from 1 to 120). How can I ensure that the step count is zero when the object is stationary?
Here are the initial settings used for the sensor:
CTRL1_REG: 0xA0 (25Hz rate, +- 2g, Low power mode)
CTRL2_REG: 0x18 (Access to pedometer advanced configuration registers, Filter enabled)
STEP_COUNTER_MINTHS: 0xA8 (1.25 g)
FUNC_CTRL: 0x01 (Step counter routine enable)
****_DEB_REG: 0x6F (i.e Default debounce time: 1040 ms, Debounce threshold: 7 steps)
After every 1 minute, these are register operations performed:
Regards,
Anusha
2020-09-01 07:17 AM
Hi Anusha @AB.4 ,
can you confirm when the steps begin to be counted?
maybe reading the output registers more often can tell us where this data come from, so I would suggest to read the data without resetting the step counter.
can you share your results?
2020-09-01 09:30 AM
Hi Niccolo,
Thanks for your response. When the device boots up, LIS2DS12 is initialised with the register settings as mentioned in the previous post. Thereafter, the step counter registers are read every minute.
Alright, I will try your suggestion and share the results with you.
Regards,
Anusha
2020-09-02 03:37 AM
Hi Niccolo,
I think I understand why non-zero values were shown when the device was stationary. I would like to get your inputs too before confirming the cause of this behaviour.
Initially, I flashed a firmware on the device with LIS2DS12 settings as follows and read step counter value every 1 minute:
CTRL1_REG: 0xA0 (25Hz rate, +- 2g, Low power mode)
STEP_COUNTER_MINTHS: 0xA1 (1.03125 g)
FUNC_CTRL: 0x01 (Step counter routine enable)
With these settings, I was getting non-zero step count in stationary state probably due to the low minimum threshold value.
Thereafter, every time, I wanted to change LIS2DS12 settings such as increase min threshold, enable advance pedometer registers, Over the Air firmware update was done (i.e only soft-reboot of processor occurs) in which the new settings were just written to the registers. I am guessing that since no hard reboot of the sensor took place, the new settings did not take effect and the firmware was working with the initial settings itself? Is this possible? When new settings are written to the sensor, do we need to reset the pedometer algorithm?
Regards,
Anusha
2020-09-02 07:44 AM
Hi Anusha @AB.4 ,
yes, the minimum threshold could indeed be your problem.
Regarding the reset of the sensor, the step count does not reset when the devices is configured in power down mode or the pedometer is disabled (as it is stated on page 28 of the application note https://www.st.com/resource/en/application_note/dm00218428-lis2ds12-alwayson-3d-accelerometer-stmicroelectronics.pdf ).
So what you are saying is right, and you can confirm it by resetting the step counter and the FUNC_CTRL register alternatively and checking out thow the step counter works.
I still suggest to work (just while debugging) with a higher refresh rate of the step count, so you can figure what is happening.
2022-09-03 11:07 PM
hi @AB.4
I am having same issue can you tell me how to resolve this !