As part of a school project I need to make a model of a snake electricity generator. I would like to build this with LEGO elements, and for that, I need to measure the movements of the cylinders relative to each other by mean of the piston connecting them.
I have an extensive LEGO collection, but I have difficulties imagining the best configuration so that the piston has the maximum moving range. In addition, the system needs to be floating, as the movement of the cylinders is caused by waves at the surface of the water.