a count mechanism for a dispensing machine which delivers coins in a single file along a track has a star wheel in the path of travel of the coins . the star wheel is indexed one point for each coin which passes it . the star wheel can be locked against rotation by a latch which engages a point on the wheel and which is held disengaged by a first solenoid . a second solenoid assists in disengaging the latch from the star wheel . a spring biased pawl rides the periphery of the star wheel between points to prevent free rotation . the star wheel is provided with spaced reflective areas on its top surface and a pair of spaced optical sensors detect the presence and absence of reflective surfaces as the reflective areas pass beneath the sensors . the optical sensors generate a pair of out - of - phase pulses which are employed to count the coins . a mechanism is also provided to test for dirty conditions of the star wheel or optical sensors .