MMA8451Q Tilt

cancel
Showing results for 
Search instead for 
Did you mean: 

MMA8451Q Tilt

Jump to solution
473 Views
gaétanphilbiche
Contributor I

Hello,

I use a MMA8451Q to monitor a device that does not have to bend over x degrees to the vertical axis. Before I used a tilt switch CM1320-0 from Assemtech and wish to obtain the same result.

To do this , I thought used to detect portrait/landscape integrated. But I realize doing my tests that this mode is not the same if you turn around the Z axis or if the Z axis is tilted up or down.

Operation when turning around Z is perfect for my application, ideally I would have the same mode of operation on the other axis . But when I switch to the front ( Z down) , I have no hysteresis and backward (Z up) I hysteresis is too important! I tried to cheat the offset of the Z axis, but this is not enough.

I wonder if there is another solution that regularly read the MMA8451Q and make the angle calculation from the XYZ readings ? If there is no alternative , is there a sample source code?

Thank you

Best regards,

Gaétan

Labels (1)
0 Kudos
1 Solution
281 Views
gaétanphilbiche
Contributor I

Hi,

I finally meets self!

I chose to integrate the method provided in this datasheet: http://www.analog.com/static/imported-files/application_notes/AN-1057.pdf

On a PIC18 clocked at 8MHz, the computation time is 1.5ms, which is still reasonable.

Too bad, I have not found a solution to use the MMA8451Q with a interrupt, which would have saved me energy.

Rgards,

Gaétan

View solution in original post

0 Kudos
1 Reply
282 Views
gaétanphilbiche
Contributor I

Hi,

I finally meets self!

I chose to integrate the method provided in this datasheet: http://www.analog.com/static/imported-files/application_notes/AN-1057.pdf

On a PIC18 clocked at 8MHz, the computation time is 1.5ms, which is still reasonable.

Too bad, I have not found a solution to use the MMA8451Q with a interrupt, which would have saved me energy.

Rgards,

Gaétan

0 Kudos