-1

I'm trying to make a wearable motion sensor using ESP32 board and ADXL335 Accelerometer.

Presently when I'm serial printing the output I'm getting the tilt value as well, which have different values at different orientation (I'm printing average of the X,Y & Z). So when I try to light up an led by setting a threshold the average value is different in different orientation.

Is there way to get values only during vibration and be zero when there is no vibration/body movement.

Thanks in advance guys for the help.

  • 1
    i think that your question needs to be about recognizing movement – jsotola Jan 9 at 7:03
1

Acceleration is a vector quantity. Therefore, instead of looking at the average values of X,Y, and Z, you should probably look at the magnitude of the acceleration vector, that is (X^2+Y^2+Z^2)^0.5. Then, you can set an acceleration threshold below which you would send no data.

The benefit of using the magnitude of the acceleration vector is that it is independent of the orientation of the device. For example, if you placed the device on a table along the X-axis, the accelerometer would read something like X = -g, Y=0, Z=0, where g is the gravitational acceleration. Similarly, if you placed the device on a table at 45 degrees between X and Y axes, the accelerometer would read something like X = -g sqrt(2)/2, Y=-g sqrt(2)/2, Z=0. In both cases, the magnitude of the acceleration vector is just g. On the other hand, the average values would be -g/3 and -g sqrt(2)/3, respectively, as you observed in "...the average value is different in different orientation."

  • Thanks a lot for the help @Kavka. I'll try this way. – aadi_k Jan 15 at 5:03
  • Still the magnitude is different with different orientation. – aadi_k Jan 24 at 9:24
0

Yes.

Linear Acceleration at given axis = Actual Acceleration - Gravitational Acceleration

Gravitational Acceleration across any Axis = Magnitude of Gravity Vector x Cosine of axis angle with the Gravity Vector

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.