Electric motor sends revolution signals to Arduino


Are there any methods for an electric motor to send accurate revolution signals to an Arduino, that would than toggle a solid state relay?
This would essentially make the electric motor the driver based on the number of turns.

I'm also searching for some type of sensor that can accurately read a high speed piston rod moving back and forth. Note: this sensor wouldn't be near high temperatures.

I would like to have these signals act like a game controller button.



normally it is used a system like the one used to count the km/h for bicicle: an hall sensor, every turn it is switched by a magnet on some rotating part.

for piston maybe a linear potentiometer is a better idea

Perfect! This is exactly what I was looking for!!!

Thanks lesto!