Basically I just printed out one of these (laser printer recommended):
...And attached it to a wheel (double sided tape recommended).
This is a companion discussion topic for the original entry at https://community.robotshop.com/index.php/blog/show/homemade-wheel-encoder