Tilt sensing application of ADXL345 in a moving vehicle

Hi,

I'm working on a project which requires the determination of the inclination of a moving vehicle and i'm using an accelerometer (ADXL345 by Analog Devices) to do the same. For this, I'm using a 2-axis angle measurement system involving the Z- and X- axes. In a completely static mode of operation, the angle measurement by the accelerometer is very accurate and noise-free. However, as its application is in a vehicle exhibiting irregular motion, I tested it in my car and found that due to acceleration/deceleration of the car along the accelerometer's X-axis, there is a lot of noise being generated in the accelerometer's output. This is distorting the value of the true inclination by as high as 400%.

This is the first time I'm attempting to use noise cancellation and have no idea about it. In fact, I cannot even classify the type of noise mentioned above. Therefore, any help regarding how I can convince the accelerometer (or rather the Arduino Uno) to believe that it's at rest and measuring the tilt of the car would be greatly appreciated.

Thanks,
Nitin

The MEMS accelerometers are very sensitive to small vibrations.
A moving car will make the sensor data go wild up and down. The 400% seems to me even low. I would expect 1000%.
You can stabelize it, if you combine it with a gyro.
Or perhaps you can do some filtering in software.

Ideal MEMS sensors would not have that, but since accelerometers are very sensitive to vibrations and gyro sensors drift, they are often combined together.
That is why there are so many IMU and 6DOF and 9DOF boards, that combine a number of sensors.

More on MEMS, MEMS - Wikipedia

Thanks very much for your reply.

Hmm, can't I achieve this purpose using only an accelerometer? I only have to measure effectively between -4.4 and 15 degrees. Just wondering. If this is the case, I hope software filtering can be used to cut out the inertial acceleration element of the signal.

Could you help me understand software filtering better? And also which algorithms/methods are most suitable for this application. Thanks again!

Kalman filtering and MEMS sensors often go together.

Wikipedia Kalman filtering, Kalman filter - Wikipedia
Arduino Guide Kalman filtering, http://arduino.cc/forum/index.php/topic,58048.0.html

You could try a phone or tablet with an app that shows the level. Connect it firm to the car and see what happens. They react slow, so I think they use the average of many samples. But they show the level, using only an accelerometer.

Yes, I'd heard of the Kalman filter, too. But I read that it mostly helps with Gaussian Noise so i figured it won't help me much as mine seems more like burst noise. I think I'll build a custom filter.

Meanwhile, a new ray of thought has emerged. What if i use a 2-axis accelerometer instead of a 3-axis accelerometer? Let me explain:

In the 3-axis model, to describe an angle in a plane (say XZ plane), acceleration readings from a minimum number of 2 axes have to be considered (ex: X and Z axes) and the inverse tangent function of the ratio of the acceleration along the X-axis to that along the Z-axis returns the angle of tilt. It is never possible to calculate the required angle using only 1 axis as the Z-axis is free to rotate 3-dimensionally about its original configuration and its instantaneous configuration cannot be described by one variable (which is the acceleration component along the Z axis).

However, I assume that in case of a 2-axis accelerometer, the third axis i.e., the Y-axis, is not even available as a degree of freedom. This means that the Z-axis can only oscillate about its original configuration as shown in the second diagram. Therefore, I assume we can predict the angle of tilt using ONLY the Z-axis information, neglecting the X-axis information, which is the major source of noise.

Please do tell me if this is true! I'm working with a hard schedule and need this information badly so that I can go ahead and buy the 2-axis accelerometer.

Thanks!

Rotating 3 dimensional Z axis.png

Rotating 2 dimensional Z axis.png

Every common cheap accelerometer has 3 axis.

A number of years ago, they were hard to make and some had only 2 axis.
Some very specific accelerometers today have 1 or 2 axis.
I have also a electro-mechanical accelerometer, before the MEMS sensors came available.
But that is all in the past now. Buy a common 3 axis accelerometer, you can always use only 1 or 2 axis.