2019-12-06 12:59 PM
Hello all,
I am having an issue with single-click detection. I am getting false click detections at certain threshold values. I found this out yesterday when I had an MCU register lots of clicks repeatedly, but the device was not being shaken.
To test, I set up the LIS2DH as follows (using I2C):
Now LIS2DH is set up at 10Hz ODR, with INT1 triggering on click and driving INT1 line high. Then I have a polling function that changes the CLICK_THS value every 5 seconds, and normal polling (more frequently) that watches for INT1 interrupts.
The 5-second poll increments CLICK_THS value up to 127, then sets it to 0 and sets ODR to disabled, then sets to 1 and ODR back to 10Hz, then increments CLICK_THS every 5 seconds from 1 to 127 again.
I have tested 4 devices so far (our manufactured devices with LIS2DH accel onboard. Each one detects false clicks at certain values of CLICK_THS:
Has anyone seen anything like this before?
All these boards were tested sitting on my desk, with no actual bumping/clicking going on. Also, if there is an actual bump, they will detect it at all but the highest thresholds.
Solved! Go to Solution.
2020-01-03 07:51 AM
Ok, I found the source of the clicks.
It was not a problem in the accelerometer or code, it was just gravity!
Between all the boards, the most common false-positive clicks happened between 61 and 69 (threshold counts).
The accelerometer was set to +/-2g, and the threshold can go between 1 and 127. When set in the 60s, it is right around 1g (half-scale at +/-2g), and the sensor noise was triggering the click interrupt (it moves 2-3 counts when still, the way I have it set).
I fixed the false positives by turning on HP filtering, which the LIS2DH supports, and my problem is solved!
2019-12-06 01:01 PM
My issue seems similar to this question:
2020-01-03 07:51 AM
Ok, I found the source of the clicks.
It was not a problem in the accelerometer or code, it was just gravity!
Between all the boards, the most common false-positive clicks happened between 61 and 69 (threshold counts).
The accelerometer was set to +/-2g, and the threshold can go between 1 and 127. When set in the 60s, it is right around 1g (half-scale at +/-2g), and the sensor noise was triggering the click interrupt (it moves 2-3 counts when still, the way I have it set).
I fixed the false positives by turning on HP filtering, which the LIS2DH supports, and my problem is solved!