Submitted by: James Burnworth (email@example.com).
I work for Vesta Technology, an embedded controller company. We have a large, growing inventory of surface mount components but no reel counter. We had an old skeleton of a reel counter without electronics. Now, it's a fully functional reel counter with an LCD display, reset and holes per part buttons, and quadrature counting.
A sprocket gear with holes around the edge passes between two pairs of LEDs and photo-diodes. The signals from the photo-diodes are sent to a comparator with hysteresis to be converted into digital signals that can generate clean interrupts (see circuit.jpg). The brains of the operation is our Mercury16, an Arduino form-factor, Pic16, single board computer. The two quadrature signals are connected to the Interrupt on Change module. Mercury16 decodes them to count parts and tell which way the reel is turning. The part count, holes per part, and counting errors are displayed on an LCD.
I wrote the program in C, and it is available at http://vestatech.com/support/downloads/
This project is complete and a detailed chronology of the build can be found at http://vestatech.com/forum/general/reel-counter-with-mercury16/
More information about Mercury16 and its big brother, Mercury18, can be found at http://vestatech.com/wp-content/uploads/2013/10/Mercury-Hardware-Manual.pdf