I have been looking at measuring the extension/retraction of a piston to record and predict the life of the device. What would be the best way to measure the piston strokes?

So far, I have come up with following guesses/ideas:

  1. LVDT in parallel. This is cost prohibitive.

  2. Linear Pot. I like this idea, but I have not found a decent source for COTS solutions. No idea what price is.

  3. Optical sensor on piston, stripe piston (encoder-like feedback and the environment is very clean). I imagine I would need to add limit switches and possibly calibrate this configuration. This seems overly complicated.

I figure there are other solutions out there, but I am currently ignorant to them.

Info for the piston/interface: - 8 inch stroke - Clean environment with some dust intrusion (think home office, not industrial) - Accuracy is acceptable to within 10% of stroke - Maximum actuation time of 1 stroke per second - Ambient temperature is 20C-25C without much variation - Time is not an issue, this is an experiment - The cheaper the solution the better. Ideal price point is $5-$10 though likely unrealistic - My goal is to test to 10,000 strokes - An absolute output is ideal, but not completely necessary

  • \$\begingroup\$ As always, you need to define what "best" means in the context of your project. We can't read your mind! \$\endgroup\$
    – Dave Tweed
    Commented Oct 17, 2016 at 11:39
  • 1
    \$\begingroup\$ "the best linear position sensor" depends on your application: How long is the stroke of the piston? Is the piston constrained to one degree of freedom, or can it e.g. rotate within the cylinder? What level of inaccuracy is tolerable? How rapidly does the piston move? Would the sensor be exposed to dirt/water/grease? Is the environment corrosive? What temperature range is to be expected? How many strokes is the sensor expected to last? Does the sensor have to produce an absolute output? How much money and/or time are you willing to devote to this? \$\endgroup\$
    – jms
    Commented Oct 17, 2016 at 16:43
  • \$\begingroup\$ The piston stroke is 8 inches. We are indeed constrained to 1 degree of freedom. Accuracy does not matter to me as long as I can I can tell the piston moved. Let's say 10%. The piston moves full stroke at a maximum of 1 second per stroke. There will be minimal dirt and grease intrusion. The environment is clean and ambient is room temperature without much variation (not industrial). Time spent can be about a month, but I have access to a machine shop and usually moves faster than most engis. This is to last ainimum of 10,000 strokes. Absolute output is ideal, but not necessary. \$\endgroup\$
    – Optimizer
    Commented Oct 17, 2016 at 17:13
  • \$\begingroup\$ And the final cost of the widget is critical. I was hoping to make a few of these and budget is close to nonexistent, minus my time. \$\endgroup\$
    – Optimizer
    Commented Oct 17, 2016 at 17:19
  • 1
    \$\begingroup\$ Are there any parametric measurements you could make? For example: if the piston is tied to a crankshaft, could you measure the angle of the crankshaft and infer the position of the piston? \$\endgroup\$
    – pgvoorhees
    Commented Oct 17, 2016 at 18:52

1 Answer 1


I'd use either an ultrasonic distance sensor/rangefinder or a parallax-based IR distance sensor.

Both have a low accuracy, but if you only require 10% of 8"/203.2 mm, which equates to 0.8"/20.32 mm, they should be sufficient. Other disadvantages include susceptibility to ultrasonic/IR noise (both) and nonlinear output (mostly the IR sensor) which needs to be compensated for in software.

The advantages are low cost, easy availability, non-contact wear free operation, and absolute output.

  • \$\begingroup\$ I don't suppose you have a part number for the IR distance sensor or mind explaining the mechanism behind the sensor? \$\endgroup\$
    – Optimizer
    Commented Oct 18, 2016 at 1:17
  • \$\begingroup\$ @Optimizer I already linked the datasheet of such a sensor as an example. It works by shining light on the surface to be sensed and then measuring the angle of any light reflected back. i.imgur.com/1Ilauwfh.jpg \$\endgroup\$
    – jms
    Commented Oct 18, 2016 at 1:49
  • \$\begingroup\$ That's cool! And ya, the link didn't work on my phone but I didn't see it. Thank you. \$\endgroup\$
    – Optimizer
    Commented Oct 18, 2016 at 2:03
  • \$\begingroup\$ Maybe going for a rotary encoder can help you detect the actual position of the piston. Look into AMS5048 Hall Effect Based sensor. The inertia to setup it up is large, but the benefits are huge. \$\endgroup\$
    – ammar.cma
    Commented Oct 18, 2016 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.