How tall is this stack of plastic baskets?

What about a conveyor through a tunnel/gate.
That is just like X-Ray scanner system you see at the airport.

Put 1 Light beam , and count it.

You can add a cheap notebook.
Connect Arduino to Notebook.

Software in notebook :

  1. Enter the Delivery Order (Destination, Qty, etc etc)
  2. Send command to arduino (number of basket to be send)
  3. Wait response from arduino

Software in Arduino

  1. Wait for command
  2. Turn on conveyor motor
  3. Count down every time the beam is blocked by basket (you can use interupt to do this)
  4. When Counter is 0, :
    a. Stop the motor
    b. Report to notebook.