Short Range Proximity Sensor
You could wind a coil around a former and then mount a plunger to the spring so that as the spring went up and down the plunger would move in and out of the coil, changing its inductance. 

Build an oscillator around the coil, use the zero-crossings to drive a one-shot, integrate the one-shot's output pulses and voilà!, frequency-to-voltage converter.