Take down the house with this gadget. William’s handheld controller provides the display of a monitored process deviation – but after hours it doubles as a card counter (In either case, the algorithm is identical). It works by adding or subtracting manually entered “event” counts to a common 8-bit counter register. The value is subtracted from a predefined mean to generate the error or variation around the mean. This error “index” selects a display state sequence, continuously scheduled in an LED display.
Card Counter/Process Controller
This Gadget Freak originally appeared in Design News.
The gadget is implemented with a controller based process which continuously monitors two discrete momentary switch inputs and provides a simple indication of totalised variation from a desired mean.
Intended to monitor and evaluate manually entered observations indicating the number of two different cell types, it was pointed out to me that it could also be used to count cards. In either case the process algorithm is identical.
Manually entered event counts are added, with one button, while subtracted with the second button to a common 8 bit counter register. This counter register value is subtracted from defined mean to generate the error or variation about the mean.
Pursuing the card counter example, a high card entry is added to the register, while a low card entry is subtracted from the register. The mean is set to zero and would correspond to when the number of high card entries equals the number of low card entries.
The controller’s processes saves an “index” value corresponding to which tabled range the resulting error falls into. These predefined lookup tables set boundary values for the totalised counter based variation. In both counting applications the distribution is symmetrical and the boundary tables are described in the figure below.
In the card counting example Figure 2 is read as: when 2 to 4 high cards more the low cards have been tallied the index value is +1. When 7 to 11 low cards more the high cards have been tallied the index value is -3.
Using positive and negative measurement tables allow this accumulated sample error to be interpreted using nonsymmetrical distributions about the parameter’s mean.
This error ‘index’ selects a display state sequence, which is continuously scheduled to the display. Using 2 coloured LEDs to indicate direction and single and dual flashes to indicate the magnitude, 10 index states are mapped into 10 flashing combination patterns.
Positive table states
State 0, single green LED flash
State 1, single green LED flash, single red LED flash
State 2, double green LED flash
State 3, double green LED flash , single red LED flash
State 4, double green LED flash, double red LED flash
Negative table states
State 0, single red LED flash
State 1, single red LED flash, single green LED flash
State 2, double red LED flash
State 3, double red LED flash, single green LED flash
State 4, double red LED flash, double green LED flash
The gadget’s form factor, shown in the figure, was set up to be held in the palm of the
hand and includes the 2-AAA batteries. The LEDs are mounted at what would be the top of the pistol grip between the forefinger and thumb.
Figure 2
Figure 3
Shown in the schematic, exploiting several features of the Microchip 12C508A controller, this application uses only a few active parts. Coded in assembly language, it uses under 200 bytes of program memory space. Several compatible parts may be substituted including the 10F2x flash based, parts packaged in a SOT23.
Figure 4
The 10F220 with an A/D may also be used to adapt the gadget to a simple process monitor. Monitoring temperature, such as a solder bath, hooded air flow or a host of workspace related parameters the flash based parts, the tables and sequences are reprogrammable to suit the other applications.
Assembly needs only a few required procedures. The perf board is cut to the 1.8”x1.7”. The red LED, the resistor, the 3 pin right angle header are mounted on what will be the far side of the palm. The right angle momentary switches, also on this side are placed along the edge of the board, separated apart by the relative distance between the centre of the index and forefinger.
On the palm side the battery holder is securely mounted with small hardware so that the holder provides room for the stubs from the 3 pin header, it’s leads are toward the top and the holder hangs over the edge about 3/4”. The Yellow LED and 8 pin IC socket are then soldered in place on the palm side. All connections were done with 30 gauge solid insulated wire.
The controller is programmed with the compiled source code. The .hex file, included in the projects file list, can also be used directly to program the controller.

Recent Comments