ST accelerometer uses the basics - single click, double click


LIS3DH chip integrates a click and double-click functionality, which provides convenience for many applications, such as in wearable devices, not only reduces the challenge to the compact arrangement of the key structural design brings, for the user, this greater The operation of freedom is a pleasure to enjoy. Let's take a look at this feature below.

To understand the settings of these two functions, you need to understand the relevant registers:

There is a threshold setting register, and a three-time window setting register ( timelimit , time latency, time window ) . Later, when we introduce single click and double click , we will talk about their respective roles.

a single click

As shown in the figure below, the sensor determines the action of a single click by checking whether the change in acceleration exceeds a predefined threshold, and then determines whether the time limit is less than the threshold. The threshold and time limit are defined. Accelerated waveform change. In the figure below, a satisfies both the threshold and time limit conditions, is the identification of a successful action, and then generates an interrupt. b only satisfies the condition that is greater than the threshold, but does not fall below the threshold within the specified time limit, so the condition of recognition is not satisfied.

Two Double click

As shown below, the double click is actually the identification of two singleclicks , but at the same time it also meets the requirements of the other two time windows ( timelatency , time window ) . When the first click is recognized , the sensor will not do in the time latency window. For any recognition, the second click is recognized in the time window window to determine whether the acceleration value at this time is greater than the threshold . If the second click is successfully recognized , an event that interrupts outputting a doubleclick is generated .

Practical skills:

1) The setting of the time window, each minimum time unit of the register is LSB=1/ODR (output data rate), assuming that the ODR is 100 HZ, the minimum time unit is 10ms, assuming that the time you want to set is t, then The corresponding register should be set to X=t/(1/100).

2) The threshold setting is related to the range, 1LSB= FULL SCALE/128.

3) Data collection, in order to set a reasonable time window and threshold, data collection is required, because different applications, structures, materials may be different, resulting in some differences in the final tapping waveform. It is recommended to use the system when collecting data. The maximum sampling frequency supported so that the acquired data can fully reflect the actual waveform. The figure below is a double-click waveform. It can be seen that the waveform is sharper and the latency window is significantly larger than the timelimit window.

4) Reasonably evaluate the recognition rate and false trigger rate according to the design requirements, and finally configure reasonable parameters.

1000 Kw Biogas Generator

1000 Kw Biogas Generator,190 Series Biogas Engine,1600Kw Biogas Engine,Biogas Electric Generator

Jinan Guohua Green Power Equipment Co.,Ltd. , https://www.guohuagenerator.com