Measuring Inclination Angle with Arduino

I need to measure a static angle of inclination, in degrees, around XYZ axes.

I tried MPU-6050, but it seems that it only measures something if there is transitional or rotational acceleration. It just outputs zillion very different values, even when sensor is not moving.

Questions:

  • can MPU-6050 be somehow converted into inclinometer? Google search didn't really gave me anything useful.

  • can any other chip, cheaper than $4.0, give me XYZ angles with 0.5 degree accuracy?

DROBNJAK:
I need to measure a static angle of inclination, in degrees, around XYZ axes.

I tried MPU-6050, but it seems that it only measures something if there is transitional or rotational acceleration. It just outputs zillion very different values, even when sensor is not moving.

Questions:

  • can MPU-6050 be somehow converted into inclinometer? Google search didn't really gave me anything useful.

  • can any other chip, cheaper than $4.0, give me XYZ angles with 0.5 degree accuracy?

Your best bet is with an accelerometer, you will have to convert from the reading back to orientation. . if the X-axis reading is 0.5g the X-axis angle could be arcSin(0.5g/1g)=30degrees, but you have to calculate all 3 axis. you either have to provide correction guidance to the user to null the other axes. A calibration sequence that requires the user to adjust the position of the device until two axis have a zero reading would provide a local g value this 'local g' would be used to calculate the orientation.

Now many of the accelerometers have between 10 and 16bits resolution over a 2g to 16g range. These higher sensitivities can actually detect heartbeats from someone holding a sensor. If the device can be placed on a solid object these vibrations are reduced.

I use a Freescale MMA8451 accelerometer, 14bit 2g scale 0.25mg sensitivity, It can give me 800 readings a seconds in all 3 axis. but they are a bear to mount. They are a QFN (quad,Flat,NoPin 3mm x 3mm x 1mm with 0.5mm pad spacing) they cost $1.48 (qty 100)
Here is my little module mounted on a RJ45 socket with a I2C EEPROM and capacitors:

Chuck.

@chucktodd

Nice writeup, I hope it will help others as much as it helped me.

Thanks.

I am imagining these sensors as a little cantilevers sticking out from base. And if they are bent to maximum than they are horizontal and report 1g. If they hanging vertically there is no bending and cantilever reports 0g. And so on in-between.

So basically if X 'leg' of sensor its feeling full 1g, but say if X 'leg' is hanging straight down, towards the Earth, than sensor feels 0g.

DROBNJAK:
@chucktodd

Nice writeup, I hope it will help others as much as it helped me.

Thanks.

I am imagining these sensors as a little cantilevers sticking out from base. And if they are bent to maximum than they are horizontal and report 1g. If they hanging vertically there is no bending and cantilever reports 0g. And so on in-between.

So basically if X 'leg' of sensor its feeling full 1g, but say if X 'leg' is hanging straight down, towards the Earth, than sensor feels 0g.

Yep, they are MEMMS. they measure a capacitance change with there position change. This model has built in diagnostics and test procedures such that a failed or damage axis can be identified. They are pretty rugged sensors, they can read +-8g but can survive 5000g on any axis. So dropping is not a problem.

Chuck.

It is unlikely that you will get 0.5 degree accuracy without extremely careful calibration of the accelerometer. Even then, internal noise limits the accuracy, so you will have to average over a large number of readings.

This application note describes in complete detail how to measure tilt in 3D with an accelerometer.