The NXT Ball Machine consists of a single Lego NXT Brick, 5x NXT Motors, 1x Mindsensors NXTMMX: Motor Mux, 1x Mindsensors TouchMux, 1x HiTechnic Colour Sensor, 1x NXT Light Sensor, 1x NXT Touch Sensor, 4x RCX Touch Sensors, many Technic Beams & other parts. It is a Perpetual Machine, in that the balls are sorted by colour and dropped off along the conveyor belt according to colour. They then roll down to the base of the Ball Lift, where they are then brought back to the bin at the top which randomly release the balls back to the colour detection shoot.
NXT Ball Machine - Mindstorms Contraption in Action!
The bin shakes randomly to mix the six different coloured balls, and if there are no balls in the detector shoot. From the shoot the a dropped into the ball cart which takes them along they conveyor. When the distance travelled along the convey matches the ball colour, the ball cart tips the ball out. The ball lands on a graded set of rails which allows the ball to roll down to the base of the ball lift.
The light sensor detect that there is a ball at the bottom of the lift ready to be returned too the top bin. The lift raises the balls to the bin and the process repeats. If all goes to plan it usually ran without issues for well over an hour!