Depending on the system RPMs are a voltage that is always off apart from a brief period once per revolution or always on apart from a brief period once per revolution.
Imagine a disk with a small hole drilled near the outer edge, an LED under the disk and a light sensor above the disk.
Turning the disk will let the LED shine through the hole once per revolution.
Start a timer running then wait until the next time the light sensor is triggered.
You now have a time period, a little basic maths would take that time and convert it to RPMs.
If the time taken between pulses was 1 second we could use 60/1 which would give us 60 RPMs.
If it was 0.5 seconds then 60/0.5 would give us 120RPM, 2 seconds per revolution 60/2=30RPMs.
Hope that helps
Greg, Newcastle Maker Space and former West Midlands bod