Need help with adxl335 for measuring displacement

Hi I’m very new to arduino and I need some help with accelerometers. I need to mount an adxl335 on a cantilever and measure the maximum travel both up and down. The entire system will be in motion as it is mounted on a car. I thought of measuring the change in angles but will the motion of the car cause it to give wrong readings? Is there any way in which I can directly measure the travel accurately? Any code or anything will be very useful.

Hi,

Hmm... Do you mean there is an arm or beam of some kind and it moves up and down relative to the car?

Is it like a spring with a weight on the end?

What are you trying to do/measure?

Yes it moves up and down with respect to the car(a small ATV).
It supports the wheel so I want to measure how much it travels.

acesudeep:
want to measure how much it travels.

Relative to what?

Do you mean suspension travel? (That you're trying to measure?)

Yes you will get wrong readings with the car in motion.

If the vehicle was moving, no vibration, and at a constant velocity it would work.
Any minor change in velocity or movement would alter your readings.

Maybe you could use a gyroscope? That would measure rotation while moving. You would then convert the movement into an angle.

i want to measure how much the wheel travels with respect to the roll cage or chassis as it moves up and down.
it isnt exactly suspension travel.
i want to place 2 sensors one on the wheels support member and one on the chassis so i can meassure their relative motion

acesudeep:
i want to measure how much the wheel travels with respect to the roll cage or chassis as it moves up and down.
it isnt exactly suspension travel.
i want to place 2 sensors one on the wheels support member and one on the chassis so i can meassure their relative motion

I use a string-pot for this, and it works well. I use 100mm linear pots, but a rotary pot and a pulley would work just as well. Tie the string to the piece of the suspension that you want to measure, mount the pot assembly on the chassis so that it is inline with the string. Use a spring or elastic band to keep tension on the string. If using a linear potentiometer then for reliability and to reduce wear, when you attach the string and spring/elastic band to the potentiometer arrange the attachments so that they do not apply any torque to the potentiometer. (In a normal linear pot, any torque you apply is reacted against the resistive track.)

Thats a nice idea i'll look into that.
Is there any way i can make use of adxl335 for this application?
Or hall sensors for measuring the travel or any other sensor??

Do you have any details or link of the pot you use?

Turns out i cant put any wires or rope through the damper spring. Any alternative??

I just use some common or garden linear slide potentiometers, big enough to give 100mm of travel. I'm not sure why you would want to put the string through a suspension spring, although you could if you wanted. All you need to do it tie the string to the moving part you want to measure and mount the potentiometer on the part you want to measure the movement relative to. If you can't figure out how to tie a bit of string between your suspension and your chassis them frankly you ain't trying!

the car needs to run 5 hours continous on a dirt track so problem is enduring that
i got the concept though ill try coming up with some way
thanks:)