# Inclinometer for my Jeep

#### Kentil

Joined Jan 29, 2016
2
Looking for a solution to show the pitch and roll angles. The result should be presented on two LED displays and the precision about one deg. Found an accelerometer ADXL335 on Ebay. Possible to use this? Ideas, someone?
Kenneth

#### jpanhalt

Joined Jan 18, 2008
11,088
What programming skills do you have?

John

#### Papabravo

Joined Feb 24, 2006
16,830
I don't see how a single accelerometer can measure angular displacement. Can you provide more details?

#### Marcus2012

Joined Feb 22, 2015
403
Artificial Horizons are made to measure pitch and roll of a moving body. maybe something like this can be used. A discrete alternative would be an inertial measuring unit (integrated 3-axis gyroscope and accelerometer), something to interpret the data (i.e. Arduino) and a display.

#### Papabravo

Joined Feb 24, 2006
16,830
Artificial Horizons are made to measure pitch and roll of a moving body. maybe something like this can be used. A discrete alternative would be an inertial measuring unit (integrated 3-axis gyroscope and accelerometer), something to interpret the data (i.e. Arduino) and a display.
I agree that a gyroscope would be a better alternative to an accelerometer, but the expense will be considerable. It sounds like the TS wants a solution on the cheap.

#### bertz

Joined Nov 11, 2013
327
An IMU will do the trick just fine. Lot's of programming help on the Arduino forum.

#### GopherT

Joined Nov 23, 2012
8,012
Looking for a solution to show the pitch and roll angles. The result should be presented on two LED displays and the precision about one deg. Found an accelerometer ADXL335 on Ebay. Possible to use this? Ideas, someone?
Kenneth
That is the perfect option. Easy - you can simply get three panel meters and display the X/Y and Z voltage or you can run them though an op Amp transfer function to get the output in degrees if you wish (0 - 0.9V out as full scale read as 0-90 degrees). You can even adjust the panel meter scale instead ot read the full scale of the ADXL335. A microcontroller is not needed if you go with the 3 panel meter (or three volt meter) option.

This is an analog output chip and can do tilt based on gravity or acceleration from movement.

Product Details
The ADXL335 is a small, thin, low power, complete 3-axis accelerometer with signal conditioned voltage outputs. The product measures acceleration with a minimum full-scale range of ±3 g. It can measure the static acceleration of gravity in tiltsensing applications, as well as dynamic acceleration resulting from motion, shock, or vibration.

The user selects the bandwidth of the accelerometer using the CX, CY, and CZ capacitors at the XOUT, YOUT, and ZOUT pins. Bandwidths can be selected to suit the application, with a range of 0.5 Hz to 1600 Hz for X and Y axes, and a range of 0.5 Hz to 550 Hz for the Z axis.

The ADXL335 is available in a small, low profile, 4 mm × 4 mm × 1.45 mm, 16-lead, plastic lead frame chip scale package (LFCSP_LQ).…

The ADXL335 is a small, thin, low power, complete 3-axis accelerometer with signal conditioned voltage outputs. The product measures acceleration with a minimum full-scale range of ±3 g. It can measure the static acceleration of gravity in tiltsensing applications, as well as dynamic acceleration resulting from motion, shock, or vibration.

The user selects the bandwidth of the accelerometer using the CX, CY, and CZ capacitors at the XOUT, YOUT, and ZOUT pins. Bandwidths can be selected to suit the application, with a range of 0.5 Hz to 1600 Hz for X and Y axes, and a range of 0.5 Hz to 550 Hz for the Z axis.

The ADXL335 is available in a small, low profile, 4 mm × 4 mm × 1.45 mm, 16-lead, plastic lead frame chip scale package (LFCSP_LQ).

Applications

• Cost sensitive, low power, motion- and tilt-sensing applications
• Mobile devices
• Gaming systems
• Disk drive protection
• Image stabilization
• Sports and health devices

#### Marcus2012

Joined Feb 22, 2015
403
I have never used these components but I would think a gyroscope would be more advantageous here as it uses the Earth's gravity to determine orientation (great for pitch and roll at any speed) whereas an accelerometer measures non-gravitational acceleration. Used in combination though they can greatly increase accuracy under different conditions (stationary, accelerating, decelerating etc.).

This IMU is SM but fairly cheap, I'll keep looking for other packages. Or you could get an LGA to DIP adaptor.

Last edited:

#### bertz

Joined Nov 11, 2013
327
I have never used these components but I would think a gyroscope would be more advantageous here as it uses the Earth's gravity to determine orientation (great for pitch and roll at any speed) whereas an accelerometer measures non-gravitational acceleration. Used in combination though they can greatly increase accuracy under different conditions (stationary, accelerating, decelerating etc.).

This IMU is SM but fairly cheap, I'll keep looking for other packages.
Actually that is not true. Accelerometers are in fact devices that sense gravity. Accelerometers measure acceleration, often caused by motion. But when they are standing still, the only acceleration the accelerometer senses is due to gravity pulling down on it.

The accelerometer is really going to report a proper measurement when it is standing still. if it is shaken, moved, bumped, or in free fall, the acceleration the accelerometer measures is no longer purely gravity based, and you are going to see that in your readings. If you need a clean reading during movement, you need a gyro and an accelerometer working in combination. Together they form something called an IMU – Inertial Measurement Unit.

Bottom line is the ADXL335 is not the right tool for this application.

#### jpanhalt

Joined Jan 18, 2008
11,088
I have used a dual-axis accelerometer from Memsic to measure tractor tilt. There is even an application note from Microchip on the subject of autopilots: http://ww1.microchip.com/downloads/en/AppNotes/00996a.pdf That note uses the same device I used. Parallax also has a little module with a very similar chip.

In a quiet static situation it is possible to get 1/4 ° , but in a bouncing or vibrating situation the noise level goes up considerably. Signal averaging helps.

John

Added note: They are routinely used today in model airplances and various types of helicopter for stabilization. They are called solid-state gyros, but often the "solid state" is not said, as everyone knows what they are.

#### Marcus2012

Joined Feb 22, 2015
403
Actually that is not true. Accelerometers are in fact devices that sense gravity. Accelerometers measure acceleration, often caused by motion. But when they are standing still, the only acceleration the accelerometer senses is due to gravity pulling down on it.

The accelerometer is really going to report a proper measurement when it is standing still. if it is shaken, moved, bumped, or in free fall, the acceleration the accelerometer measures is no longer purely gravity based, and you are going to see that in your readings. If you need a clean reading during movement, you need a gyro and an accelerometer working in combination. Together they form something called an IMU – Inertial Measurement Unit.

Bottom line is the ADXL335 is not the right tool for this application.
Not sure if you replied to the right message here as you pretty much just repeated what I said An accelerometer can tell you when something is tilting but once it's stopped tilting as far as the accelerometer is concerned the platform is level again.

#### GopherT

Joined Nov 23, 2012
8,012
Not sure if you replied to the right message here as you pretty much just repeated what I said An accelerometer can tell you when something is tilting but once it's stopped tilting as far as the accelerometer is concerned the platform is level again.
not true. The acceleration of gravity is always 9.81m/sec2 so that is what the chip measures in the z-axis when the x and y axis is parallel to the ground. If it is not parallel, then there will be an x and y component. Look at the apps available for iPhone and Android. You can use them directly on your phone to see how the various orientations map tilt. If you do the programming of the app, you can be sure the data comes from the accelerometer vs. gyro or compass or other on-board whiz-bangs each new model of phone adds. Nonetheless, an accelerometer does not need to be "accelerating" to show tilt.

Here is an excellent reference - using an accelerometer as a tilt sensor.

http://www.digikey.com/en/articles/techzone/2011/may/using-an-accelerometer-for-inclination-sensing

I understood the OP that he wants to measure static tilt when he achieves various positions with this jeep. I don't think it would be something he is watching as he drives - not a good idea to take your eye off the "road" in those conditions. If an angle is exceeded, an alarm would be a better option.

Last edited:

#### Marcus2012

Joined Feb 22, 2015
403
not true. The acceleration of gravity is always 9.81m/sec2 so that is what the chip measures in the z-axis when the x and y axis is parallel to the ground. If it is not parallel, then there will be an x and y component. Look at the apps available for iPhone and Android. You can use them directly on your phone to see how the various orientations map tilt. If you do the programming of the app, you can be sure the data comes from the accelerometer vs. gyro or compass or other on-board whiz-bangs each new model of phone adds. Nonetheless, an accelerometer does not need to be "accelerating" to show tilt.

You are right my bad sorry I was a bit absolute there, but this does requires some workaround for instabilities due to conditions where accelerometers become insensitive to the Earth's gravitational field vector. I just think the humble gyroscope gets overlooked these days for these applications.

#### jpanhalt

Joined Jan 18, 2008
11,088
You are right my bad sorry I was a bit absolute there, but this does requires some workaround for instabilities due to conditions where accelerometers become insensitive to the Earth's gravitational field vector. I just think the humble gyroscope gets overlooked these days for these applications.
In theory at least, when the side of the Jeep is parallel to the surface of the Earth, you don't need an inclinometer. They work quite well for detecting over tilt situations.

John

#### John P

Joined Oct 14, 2008
1,910
If you have a smartphone, chances are it has accelerometers already, and there are lots of apps available to give you a graphic display. I have an Android phone and I installed a free app called ON Level, but I'm sure others would work just as well. So all you'd need to do would be mount the phone so it's level at a time when you're satisfied the vehicle is level (or install a mount that keeps the phone at the correct angle any time you set it down there) and you've got what you wanted. Maybe there's an app out there which can be set for some limit angle, so it might shout at you, Danger, danger, excessive vehicle tilt angle!"

#### GopherT

Joined Nov 23, 2012
8,012
If you have a smartphone, chances are it has accelerometers already, and there are lots of apps available to give you a graphic display. I have an Android phone and I installed a free app called ON Level, but I'm sure others would work just as well. So all you'd need to do would be mount the phone so it's level at a time when you're satisfied the vehicle is level (or install a mount that keeps the phone at the correct angle any time you set it down there) and you've got what you wanted. Maybe there's an app out there which can be set for some limit angle, so it might shout at you, Danger, danger, excessive vehicle tilt angle!"
If he exceeds the safe angle by too much, the smart phone will start oscillating between your warning and "you have returned to a safe tilt angle" until the vehicle reaches the bottom of the hill.

#### John P

Joined Oct 14, 2008
1,910
Maybe a really smart app would call for rescue if it detects an overturned vehicle! If the driver is underneath it, at least help would be coming.

#### KeepItSimpleStupid

Joined Mar 4, 2014
5,090

#### Alec_t

Joined Sep 17, 2013
12,212
.... or you could use an 1887 version of an inclinometer. Simples .

#### crutschow

Joined Mar 14, 2008
27,755
I have never used these components but I would think a gyroscope would be more advantageous here as it uses the Earth's gravity to determine orientation (great for pitch and roll at any speed) whereas an accelerometer measures non-gravitational acceleration. Used in combination though they can greatly increase accuracy under different conditions (stationary, accelerating, decelerating etc.).
You have that incorrect.
A gyroscope is an inertial device and does not use (or depend) upon gravity.
An accelerometer does respond to gravity or acceleration forces and can't differentiate between them.
(In the physics world it's impossible to differentiate between gravitational force and the force from constant acceleration).
Here we want to detect the horizontal component of gravity due to the tilt, which a 3-axis accelerometer can do.
There's no particular need for a gyro to accomplish that task.