They also often have a small magnet embedded in the rotor which can be picked up with a reed switch or hall-effect sensor