LIS3DH Motion detection and interrupt
Hi,
I'm developing a wearable smart device with nrf52832 and LIS3DH. In order to shutdown the MCU when the device is not worn I want to use the motion detection feature of the LIS3DH with an interrupt, so if the sensor doesn't fire an interrupt event for n minutes the MCU turns off (enters very low power mode).
The users can set the interrupt threshold and the full-scale as configuration options.
Here my current configuration
CTRL_REG1 = 0x2F //10Hz, low power mode, ZXY enable
CTRL_REG2 = 0x0 // No HP filter
CTRL_REG3 = 0x40 //IA1 enable
CTRL_REG4 = 0x00 //2g default value, configurable by user
CTRL_REG5 = 0x00
CTRL_REG6 = 0x0
INT1_THS = 0x3A // 58 * 16mg = 928 mg
INT1_DURATION = 0x02
INT1_CFG = 0x2A
The first question is: In order to update the sensor's configuration according to user preferences, can the MCU write the INT1_THS and CTRL_REG4 registers, after the initial configuration, without physically rebooting the LIS3DH? Should I have to clean them before?
The problem: With the configuration above and with full-scale at +/-2G and threshold = 58, the sensor fires interrupt also for very small motions (I can see an interrupt also when the smart device is laying on the table), but if I set the threshold at 22 I have to shake wildly the device to generate an interrupt. According to datasheet with threshold at 22 I should have an interrupt for all motions greater than 16 * 22 = 352 mg that is less than 928 mg so I should detect very small motions. Where am I wrong?
Thank you
Fabio
