Hi,
Is this for a class project or hobby or commercial?
I would think you can start with a balance beam arrangement with a container on one end and a counter weight on the other end. Have you ever designed a balance beam?
As the container gets more and more full, the weight eventually tips the beam to near balance and a detector could activate a solenoid or something to tip it the rest of the way and empty the container, and one 'unit' is counted. Each 'unit' could be adjusted by moving the counter weight.
Just an idea.