Hall effect sensors

Pulsein() works very well I know but as I stated above it has some drawbacks, most important it blocks the code, and to lesser extend you will not necessary get all pulses. This latter may or may not be important. Example if you only want to have speed it does not matter much. If you also want to have the distance measured you need every pulse.

Still pulseIN() is a valid option.