Solenoid Artistic Function - Magnet and Glass Tube

Maybe the feedback siganl can be solved like this. Just maybe. Let' see what they find wrong with it and maybe we can improve it.

You can't touch the magnet with anything as it will affect the position and look awful; but..

You can place a round piece of reflecting something in top of the magnet thing. At the end of the tube you palce an LED and an LDR (light depending resistor) then you get the reflected light from the mirror and convert it to voltage with the LDR. The closer the magnet the more reflection you'll get and the higer the voltage. You will need to use infrared or something to avoid ambient light from affecting the thing.

Whatever you do with the magnet it has to move freely and you may need a hole in the middle or something to allow the air flow back and forth otherwise the piston efect it will create will slow it down or prevent it from moving altogether when the air gets compresssed. You can also vaccum the tube after done and seal it again as they did it the past with vaccum tubes. Vaccum tubes again? =(