I have the MMA8652 working but I have a problem at what angle the motion interrupt fires.
So currently with the sensor on a flat table solder side down, the interrupt will fire when moved in X, Y or Z directions, and when motion is stopped, the interrupt will stop firing. This only works correctly when the chips is solder side down.
However, if I turn the senor from solder side down, to standing on its side, the interrupt will constantly fire.
I would like to use the sensor, so that when turned on and initialized at any position, all interrupts are zero, and when moved in any X, Y, or Z direction the interrupt fires, and reset to zero when motion is stopped.
Is motion detect not suitable for this application and that is why it constantly fires on its side, or am I configuring the sensor incorrectly?
Would it be best to use acceleration g interrupts for this application?
Thanks in advance.
Thank you for your help.
How can I contact you?
When I try to message you it displays, "You can only send messages to your Friends / Connections (people following you). You must remove users marked with an exclamation point before your message can be sent."
So can you therefore message me.
Could you please post here your complete source code or send me a direct message if you would like to keep it confidential?
However, it sounds like your threshold value for motion detection is less than 1g. And since the accelerometer also measures the projection of the gravity vector on the sensing axis, the threshold value might be exceeded when the device is placed vertically:
To eliminate the DC tilt offset (gravity), I would recommend using the the transient detection function which uses the high-pass filtered data by default (HPF_BYP bit = 0). Have a look at our AN4071 for more information.
I hope it helps.
PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.