FEZ HAT Accelerometer returns varying values while at rest. Is this normal?

I am trying to detect vibration and slight movement with the FEZ Hat and when I call the GetAcceleration() method the X, Y, and Z values change during each read even when the Raspberry Pi 2 is sitting on the table untouched. Is this normal? How do you detect movement if the values don’t stay the same when it is not moving?

When you say change, what actual values are you reading? They are normally a little noisy so you can expect some output change when resting.

remember, sitting on a table is still possibly moving :slight_smile:

@ Dave McLaughlin -I have attached an image of the first values that were returned from the GetAcceleration() method. The device is resting on a table on the other side of the room and there is no movement going on over there.

So if this noise is always there, there is no way to use this to check for slight movements or even vibrations? I figured that being at rest that the output would be 0 until it was moved.

See the datasheet of the sensor. The expected noise is about 2 milligal.

@ SouthernStars - Where do I find the datasheet? All I have seen is a Developer’s Guide and Schematic.

The procedure for getting more details is to look at the schematic. You will see that the accelerometer is an MMA8453Q. Googling that gives this link: http://www.nxp.com/files/sensors/doc/data_sheet/MMA8453Q.pdf
Here you will find all the specs. This way GHI does not have to copy material, possibly violating copyright.
Also, in your data you will notice several unique reappearing numbers for each X,Y,Z. This indicates that you are seeing “bit noise”, and gives an idea of the minimum change that each channel can register.

@ Matronix - Most sensors have noise. Do some moving average calculations on the values, and then left shift the final value to the right one time to remove a bit of precision. Then test your solution again to see if it’s still picking up enough movement data.a

@ Mr. John Smith - It makes sense that most sensors have noise… I guess I just expected for the noise to be consistent is all. Sitting at rest I am getting so many different values.

@ Matronix - No, the noise is just that, random values at rest. You’ve got to filter it out. Note the lager the size of the moving average buffer the longer the system will take to respond to new values. Further, how do you know that the device is at rest? Just because it looks like it’s not moving, what if it is? Is the ground moving…