Fall Detection using MPU-9250

I have 3 questions

Hi, i am trying to do a fall detection device using NodeMCU and MPU-9250 module. For a start I am trying to print out the acceleration values from each axis.
This is the code I programmed into the NodeMCU.

void loop() {
                                // put your main code here, to run repeatedly:
  IMU.readSensor();
  //Accelerometer data code
  Serial.print("Accelerometer X axis: "); 
  accex = IMU.getAccelX_mss();
  Serial.print(accex, 3);     // to get the accelerometer value from the data buffer in the X direction, these values are in meter per second square
  Serial.print("               Accelerometer Y axis: ");
  accey = IMU.getAccelY_mss();
  Serial.print(accey, 3);
  accez = IMU.getAccelZ_mss();
  Serial.print("               Accelerometer Z axis: ");
  Serial.println(accez, 3);
}

After I programmed this into the NodeMCU, I was able to get the acceleration values of each axis. as shown below.

  1. Why is the z axis acceleration -8, shouldn't it be 0 as well?

Another thing I noticed that, when hold the circuit upside down, the z axis acceleration becomes 11 as shown below.


2)Why did it go high?

3)Similarly, when I tilt it 90 degrees to left and hold it still the x axis acceleration went up to 11 as well. Shouln't it be 0 as well if I hold it still, why is it 11?

Please enlighten me on this. I am new to this MPU-9250 module.

Accelerometers measure the acceleration due to gravity as well as acceleration due to other forces.

They also need to be calibrated, in order to get accurate readings. See this tutorial: Programming and Calibration | ADXL345 Digital Accelerometer | Adafruit Learning System

It looks like gravity is working correctly where you are, even if it is a little low.

It does go all the way to 11, though.

1 Like

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