Questions and discussions about the software that runs on the TD RF module itself.
thomas110594
 
Posts: 6
Joined: Thu Jun 09, 2016 7:09 am

Free-fall detection with accelerometer

by thomas110594 Thu Jun 16, 2016 10:02 am

Hi everyone!
I'm a new user of td1204 module. I would like to implement a fall detection. I saw in the datasheet of the accelerometer LIS3DH in part 6.4 the configuration of free fall detection :

LIS3DH datasheet says :

" This paragraph provides the basics for the use of the free-fall detection feature. In particular, the SW routine that configures the device to detect free-fall events and to signal them is the following:
1 Write A7h into CTRL_REG1 // Turn on the sensor, enable X, Y, and Z // ODR = 100 Hz
2 Write 00h into CTRL_REG2 // High-pass filter disabled
3 Write 40h into CTRL_REG3 // Interrupt driven to INT1 pad
4 Write 00h into CTRL_REG4 // FS = 2 g
5 Write 08h into CTRL_REG5 // Interrupt latched
6 Write 16h into INT1_THS // Set free-fall threshold = 350 mg
7 Write 03h into INT1_DURATION // Set minimum event duration
8 Write 95h into INT1_CFG // Configure free-fall recognition
9 PollINT1pad;ifINT1=0thengoto10 // Poll INT1 pin waiting for the free-fall event // Event handling
10(Free-fall event has occurred; insert your code here)
11 Read INT1_SRC register // Clear interrupt request
12 Goto9

The code sample exploits a threshold set at 350 mg for free-fall recognition and the event is notified by the hardware signal INT1. At step 7, the INT1_DURATION register is configured like this to ignore events that are shorter than 3/DR = 3/100 ~= 30 msec in order to avoid false detections.
Once the free-fall event has occurred, a reading of the INT1_SRC register clears the request and the device is ready to recognize other events. "

I have several questions:
- Can I configure the registers directly in my program using the lis3dh.h file?
- Do you have an idea, a track, to manage the polling of the INT1 pin ?
- Are we forced to use TD_ACCELERO_MonitorEvent of TD_ACCELERO_DataEvent function with their callback ?


Thanks you,

Best regards, Thomas110594.
Return to Firmware

Who is online

Users browsing this forum: No registered users and 30 guests