If your light detector triggers a 555 pulse generator. The pulse must be less the 1/maximum number of pulses/second. So when the motor is running flat out you have a series of pulses with a very small gap between them. If your pulses go from 0 -> 5V, then the average voltage is , 4.5 V. As the motor slows down the gaps between the pulses increase, so at a low speed there might be a pulse for 2 % of the time, in which case the average voltage will fall from the 4.5 volts (fast) to 5 X .02 = .1V.
So you now need an op amp to change the pulses into a DC level (large capacitor between input and output), alter the change in voltage to something convenient (gain of op amp) and perhaps, add in a DC level for the next circuit to operate with (DC offset pt on positive input).
Frank