I'm currently working on a project where a sliding metal box is mounted on a metal pole. The box moves up and down. At the top of the metal box is a small processing unit that needs to know the distance between it's position and the ground. I'm currently investigating placing an IR or ultrasonic distance sensor and simply measuring the distance to the ground that way.
Since i'm just a software guy that has never learned electronics properly, I was wondering if there is some alternative way to measure the distance to the ground, maybe making use of the conductivity between the sliding box and the pole. Is it possible to use some kind of cheap device mounted at the bottom of the pole and the appropriate sensor on the box for this purpose? Or should I just stick with the IR or ultrasound?
Some more info:
- I can't run a wire between the 2 devices to make a closed circuit. Or make any drastic changes to the pole (no magnetic or optical encoders).
- The device on the bottom and the appropriate sensor should be about 20 dollars (or less)
- I need to measure distances ranging from 10cm to 2m with a resolution of about 0.5cm