I have a Virtuabotix MMA7361 Three Axis Accelerometer Module that I am trying to use to detect tilt. It works, but only for two axes at a time. It doesn't matter which way I try to flip or turn the board, but no matter what, the "Output Axis"(shown in the picture below) will not work. Am I mixing an axis up or messing up the orientation somehow? The spin and and the input axis seems to work no matter the orientation. I've tried twisting it and turning it, but out of X,Y and Z, only two of them work at any given time, with the last one staying near-constant.

The second picture is of the board I have. I am using an Uno to read the values.

enter image description here

enter image description here

| improve this question | | | | |
  • \$\begingroup\$ What do you mean by 'work'? What values are you getting for the three axes, and which one is 'up'? Are you taking into account gravity? The axes parallel to the ground will typically have a mid value, and the vertical axis will be showing the impact of gravity. \$\endgroup\$ – gbulmer Sep 19 '14 at 22:53
  • \$\begingroup\$ Do you have ST at GND? \$\endgroup\$ – venny Sep 19 '14 at 23:20
  • \$\begingroup\$ Nope, should I have ST at GND? Actually, now that you mention it, if you mean what you think I mean, then yes, it is parallel to the ground. For example, if you were to take that picture and lay the board in exactly the same way, with the blue part facing up. Then superimpose the other picture on it, that WOULD be the output axis....How would I go about correcting that? It usually get between 500-700 for the axes between its 0 to 180 degrees for its respective axis. \$\endgroup\$ – nadjatee1996 Sep 19 '14 at 23:27
  • \$\begingroup\$ What do you imagine gravity will measure as? For the axis (usually Z) which is up/down, one way up, it will be very low, then as you slowly rotate the PCB around X or Y, Z rises to a mid value, then as you flip the PCB upside-down, Z will get even larger. You are measuring gravity. That is correct, it is working. If you hold the board so another axis is up/down, then rotate the board around a different axis from a low value, though a mid value, to high, it is measuring gravity. \$\endgroup\$ – gbulmer Sep 19 '14 at 23:42
  • \$\begingroup\$ That makes sense....is there still a way to measure tilt along that axis though? \$\endgroup\$ – nadjatee1996 Sep 19 '14 at 23:45

You could use either a magnetometer, or a gyro to detect rotation around an axis parallel to the Earths surface.

If you offset an accelerometer from rotation axis, you could get some information to estimate a rotation angle, but it would be quite hard to do adequately (depending on how good it needs to be), and inferior to the other two sensor types.

I strongly recommend watching Sensor Fusion a google tech talk by InvenSense.

Among many things, it explains how to do what you describe.

There are some issues with sensors for only one of the phenomena (e.g. only magnetometer, or only gyro) for example drift from integrating gyro's. So "Sensor Fusion" is an approach, using a set of algorithms which derive better results by using values from different types of sensors together.

You don't need to buy an InvenSense sensor, though they are pretty low-cost on 'sales' web sites, often from China. Other companies make comparable devices, and there Open Source algorithms on the web.

| improve this answer | | | | |

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.