Go Down

Topic: How to: tilt measurement with an accelerometer? (Read 774 times) previous topic - next topic

madepablo

Oct 29, 2009, 09:45 pm Last Edit: Oct 29, 2009, 11:42 pm by madepablo Reason: 1
I have an adxl335 accelerometer working with an arduino duemillanove.

I used a example sketch, included in the arduino 0017 software, to read acceleration. It seems to run, but i am interested on tilt measurement.

There are different post at this forum related to this and other accelerometers, but in any case is explained how to measure tilt by this sensor.

Any idea?

Thanks in advance!

madepablo

#1
Oct 30, 2009, 01:25 am Last Edit: Oct 30, 2009, 09:05 pm by madepablo Reason: 1
I saw this equation on internet, but i am not sure if it is correct and how to apply it...

Quote

Vout = Voffset + [(AV/Ag)x1gxsinB]


where:
Vout is the voltage readed into the analogical pin (calculated from the lecture from the 1024 levels)
Voffset is the voltage at 0g acceleration
AV/AG is the sensibility
g is the gravity on earth
and B is the tilt angle.

I suppose that Voffset is the voltage when the sensor is not in movement and the lecture in arduino is 512 --> 2.5Volts. Is it correct?

Other problem is how to know the sensibility AV/Ag. is it located in the datasheet?

i suppose that g could by 9.8 m/s^2, although an aprox. of 10 m/s^2 could be also valid.

So, in theory, the final equation to derive B is:

Quote
B = arcsin [(Vout-Voffset)/(AV/Ag)]


In theory we obtain the tilt angle B in degrees for one of the axis. If we repeat the calculation taking into account the values of the different pins, we could obtain the tilt for x, y and z

So, is it right?

UPDATE: here it is where is saw the equation:
http://www.freescale.com/files/sensors/doc/app_note/AN3107.pdf

UPDATE 2: here there is more information
http://www.freescale.com/files/sensors/doc/app_note/AN3461.pdf

AWOL

Quote
Other problem is how to know the sensibility AV/Ag. is it located in the datasheet?

300mV per g (VS = 3V) from the datasheet.
http://www.analog.com/static/imported-files/data_sheets/ADXL335.pdf

Make sure your input data is well filtered - the sine of a small angle is also very small.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

madepablo

Thanks AWOL,

I will try to develop an sketch along this weekend and post it here soon.

Go Up