There is either a mechanical cable or an electric counting wheel on the transmission output, calibrated to the wheel size the factory installed. As the wheels spin the sensor counts the amount of times it passes and does the math for you. A mechanical cable uses a gear drive calibrated in a similar way and just spins which holds the needle at the corresponding speed on the gauge.
Latest Answers