We did this in 2014 on our swerve modules. 6 neodymium magnets were mounted alternating north south on the under side of the 3.5" timming belt pulley. A Melexis US2881 Latching hall sensor was then used to give a non-contact solution. A counter was used set up for counting on the rising and falling edge. We used this to measure distance traveled. This year we used these boards.
https://www.pololu.com/product/2458
12 strips of KOP retroflective tape were mounted under the pulley. Although this is listed as an analog device, The c-rio did the chopping on a digital input set up as a counter.