Conveyor belt speed monitoring
15 km/h is 4.2 m/s, then a distance of 40 cm will take minimum 100 ms.  

Place two LED/phototransistor combinations 40 cm apart, with the boxes passing between them. You can place both LEDs and phototransistors in a tube to make sure the phototransistors aren't disturbed by other light sources. You can use a modulated source signal for better noise immunity.  

When the microcontroller detects an interruption of the signal (box passing) it just has to look for the same interruption from the second detector minimum 100 ms later. Convert time difference to speed.  

Note that photo-interrupters like this are used everywhere in logistics and manufacturing, and an industrial strength device may give you a higher reliability, though that comes at a price.



This one has transmitter and receiver in the same device, and uses the reflector to bounce back the signal.



Alternatively, maybe you van work with the voltage controlling the belts motor. Like when it's a variable speed synchronous motor.