Fall detection using mpu6050

void loop() {

mpu_read(); // function used to read the data
//2050, 77, 1947 are values for calibration of accelerometer
// values may be different for you
ax = (AcX - 2050) / 16384.00; // AcX,AcY,AcZ are raw accelometer values and ax,ay,az is calibrated acc along its axis
ay = (AcY - 77) / 16384.00; // 2050,77,1947 calibration offset
az = (AcZ - 1947) / 16384.00; // 16384.00 is scaling factor

//270, 351, 136 for gyroscope
gx = (GyX + 270) / 131.07;
gy = (GyY - 351) / 131.07;
gz = (GyZ + 136) / 131.07;

// calculating Amplitute vector for 3 axis
float Raw_AM = pow(pow(ax, 2) + pow(ay, 2) + pow(az, 2), 0.5);
int AM = Raw_AM * 10; // as values are within 0 to 1, I multiplied
// it by for using if else conditions
Serial.println(AM);
// Serial.println(PM);
delay(500);

if (AM <= 7 || AM >= 11) {
Serial.println("FALL DETECTED");

} else {
Serial.println("NO FALL DETECTED");
Serial.println(AM);
}

delay(100);
}

Hello everyone, I'm doing project on MPU6050 for fall detection and I'm facing difficulties to minimize false alarm triggered by small movements.
so how to overcome this problem..
Can someone help me with the above code

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.