Slot-type IR optocoupler speed sensor