Physiology & Behavior, Vol. 23, pp. 795-797. Pergamon Press and Brain Research Publ., 1979. Printed in the U.S.A.

Digital Counters: Inexpensive Alternatives P A U L R. S A N B E R G 1 A N D W I L L I A M P. B E L L I N G H A M 2

1Department of Behavioural Biology, Research School of Biological Sciences and 2Department of Psychology, School of General Studies, Australian National University Canberra, A.C.T., Australia 2600 R e c e i v e d 4 M a y 1979 SANBERG, P. R. AND W. P. BELLINGHAM. Digital counters: Inexpensive alternatives. PHYSIOL. BEHAV. 23(4) 795-797, 1979.--Two rapid methods for converting inexpensive calculators into counters for use with digital logic controlling systems are described. The first method utilizes integrated circuit opto-couplers with built in switching transistors, and the second uses inexpensive CMOS solid state switches. Using one of these techniques almost any calculator can be converted, and operated directly from digital logic without the use of interface hardware, such as DC drivers.

Counters

Calculators

Digital logic

Behavioral equipment

C O U N T E R S are an essential part of a behavioral laboratory, and with the ever increasing number of dependent measures needing recording, it is not uncommon for an average size operant laboratory to have a multitude of counters. However, the purchasing of a quantity of counters from behavioral equipment manufacturers can become enormously costly; about $500 for a rack of ten counters. Furthermore, the counters most commonly distributed by these companies are electro-mechanical therefore having inherent problems of speed limitation, noise and relatively poor reliability. Thus, the need for technologically more advanced and economical counters becomes apparent. Alexandrovich [1] first demonstrated a simple way in which an inexpensive electronic calculator with L E D display can be converted to a solid state counter by simply making contact closures on either the " + " or " = " key (depending on the add mode of the calculator) after the calculator has been placed in a constant addition mode. Applying this idea to behavioral research, Wolach, Roccaforte and Breuning [6] demonstrated a conversion technique for calculators that would allow interfacing with control equipment. Their technique essentially consisted of entering counting signals to the calculator via a relay which substituted its contact closure for one produced by manually depressing t h e " + " or " = " keys. In the sense that relays provide total electric isolation of each counter from another and from the control apparatus, the solution is ideal. However, relays are mechanical and therefore relatively unreliable as well as slow and noisy. In those increasing cases where control is by some form of solid state circuitry the use of relays is particularly disadvantageous. Drivers must be used to activate the relays which, in turn, activate the counters. Thus, reliability goes down while space requirements and cost go up. A solution to these problems was provided by Rayfield [5] in which a transistor-resistor circuit was used to make the necessary contact closure. Several advantages accrue from this solution. The DC driver is eliminated since digital logic modules can directly activate the transistor due to its low power demands. Transistors are quiet, cheap and fast. A potential problem with this method, however, is that it does not pro-

vide complete electrical isolation between the counters and the control logic. Opto-couplers, such as the 4N26, can solve this problem. An opto coupler is a small integrated circuit with a built in light emitting diode (LED)-photoresistor circuit which activates a switching transistor (see [3], cost approx. $1.00). Thus the incoming logic current only lights the L E D and is therefore completely isolated from the transistor (see Fig. 1). Figure 1 illustrates the conversion of a Royal Model 91S calculator into a counter using a 4N26. The Royal calculators we have used, Models 90S and 91S, are simple to modify since the keyboard wire terminals are pre-numbered. The two keyboard wires (equivalent to the " = " key) for the Royal 90S and 91S are keyboard terminals 5 and 7, and 6 and 15, respectively. These are wired to the emitter pin (pin 4) and collector (pin 5), respectively, of the transistor in the 4N26. Keyboard terminal 1 of both calculators which is the power supply ground of each calculator is wired to the cathode (pin 2) of the L E D in the 4N26. The L E D anode (pin 1) is connected to the incoming count pulses. Pins 3 and 6 are not connected. A low to high logic count pulse will momentarily light the L E D and switch the transistor, thereby adding a 1 count to the running total of the calculator. We have found a difficulty with this method, however, in that not all calculators have a sufficient bias on the contact closure to switch a transistor. The National Semiconductor Model 850A is one example. In this latter case we found that the CMOS 4066 quad-bilate~al single pole-single throw switch worked quite well. This particular device can operate on supply voltages from +3 VDC to +15 VDC, has high noise immunity, low " O N " resistance and very low power requirements. The 4066 has four switches incorporated in it with low crosstalk between the switches. Isolation between the control pulse and the counter exists. Therefore the 4066 will work on those calculators in which an opto-coupler is inappropriate. The 4066 can be purchased for a modest $1.00 or less. The CMOS 4016 is a similar device that is pin for pin compatible with the 4066, but has a higher " O N " resistance. It should work equally well. Figure 2 is a detailed description for the conversion of the

C o p y r i g h t © 1979 Brain R e s e a r c h Publications

Inc.--0031-9384/79/100795-03500.80/0

796

S A N B E R G AND B E L L I N G H A M

Calculator

A

8B 8BB8 888 10 15 IIII 5 IIIIIIII II

f i

i

CP

4N26

FIG. 1. Diagram for converting an inexpensive calculator into a digital counter using a 4N26 opto-coupler. On the 4N26 pins 1 and 2 are the anode and cathode, respectively, of the LED. The anode should be connected to the incoming count pulse (CP) (see [3]). Pins 4 and 5 are the emitter and collector, respectively, of the switching transistor and should be connected to the keyboard input wires of the " = " or " + " key of the appropriate calculator (see [6]). Wires for the " = " or " + " key on any calculator can be found by shorting two keyboard input wires at a time until the calculator performs an addition, after being placed in the constant add mode (see [61). The example calculator (calculator A) shown in the diagram is a Royal Model 91S.

National Semiconductor Model 850A using the CMOS 4066. We found two different internal structures in the National Semiconductor 850A calculators we obtained from the same supplier. The first type had the calculator integrated circuit directly attached to the keyboard and a row of flexible wires from the keyboard to the L E D display. The second type had the calculator integrated circuit detached from the keyboard and connected by a row of flexible wires. The two wires corresponding to the " = " key in these calculators are in the set of flexible wires aforementioned for each type of calculator. F o r the first type, from the side opposite the external power supply, wires 2 and 7 are the necessary lines. F o r the second type, wires 3 and 8 are the correct lines. After the calculator has been placed in the constant addition mode, a

contact closure between the two appropriate lines for each calculator will cause an additional count to the running total. Wires were soldered to the appropriate lines and connected to the appropriate pins on the 4066, as illustrated in Fig. 2. Also illustrated in Fig. 2 are the pins corresponding to the digital logic input for each switch and the power for the CMOS unit. The switch is open when the digital input is low and closed when it is high. Thus, a low to high input pulse will close the switch momentarily, causing a count. It should be noted that when power to the 4066 is off, the switches are closed. This is equivalent to keeping the " = ' " key depressed. Rayfield [5] suggested that by having switch closures on other keys, up-down and automatic resetting counters could easily be made. The 4066 would be quite advantageous for these kinds of applications since each small package contains four switches. The calculators we have used, National Semiconductor 850A and Royals 90S and 91S, differ dramatically in the structure of the internal components, but are easily modifiable using one of the methods described. The principles are the same for most calculators and with care they should be easily convertible. Reference to Wolach et al. [6] will prove valuable. The major problem that will be encountered with other types of calculators will be determining which lines control the addition function, but the principle is simple. All one needs to do is open the calculator and systematically short two keyboard wires at a time on the keyboard output strip until the calculator performs an addition. The other difficulty that may present itself is gaining access to the wires from the keyboard itself, Wolach et al. discuss this problem and note which calculators are easily modifiable. For those desiring to avoid the expense of constantly replacing the calculator's batteries Rayfield [5] suggested using an appropriate integrated voltage regulator. This is an excellent and inexpensive method but we would like to advise the builder to consult the technical information regarding the voltage regulator employed. It is not clear from Rayfield's article that proper capacitance needs to be supplied and failure to do so could easily damage the circuit. Reference to handbooks such as the Voltage Regulator Handbook [4] and Cmos Cookbook [2] should prove quite useful. It is evident from the above discussion that calculator counters offer more advantages than just cost to the behavioral scientist. These include more digits, more visible display (LED, LCD or fluorescent type), speed, better reliability, and the virtual absence of interfacing hardware, such as DC drivers and mechanical relays. Even the minor problem reported by previous investigators [6] that the value 1 must always be subtracted from your final result, because the counter starts with 1 instead of 0, is easily overcome. In our case, we merely subtracted 1 prior to initiating the resetting sequence, as described by Wollach et al. ([6], i.e., " + " 1 = " ) , which then started the counter at 0. In conclusion, a rack of ten counters was made in our laboratory and connected to the digital logic controlling system, in less time and at one-tenth the price of installing a rack of typical mechanical type counters.

ACKNOWLEDGEMENTS We are indebted for the assistance and suggestions of R. Dalby, D. Crawford and R. Jackson.

INEXPENSIVE

I I I

DIGITAL COUNTERS

LED DISPLAY (backside) IIII! I I I I I l l l I I I I I I

UlIIIIIIIIIIIII

IIIIIII

797

+3

!

to

+15v0c

I

Calculator I

uJ u

(

,I,;,,tl...............

, i. . . .

o

(

~

t

~

z

._ .t:

_J .J

o

o o~

-

o

,~

E

o

o

~

~

To CQIculator B I 0

To Calculator C

~

--'

>--

~

u) '

....

"

I

g-

~-8 r,

To Calculator D

FIG. 2. Diagram for converting an inexpensive calculator into a digital counter using CMOS 4066 single pole-single throw switches. On the 4066 pins 7 and 14 are the power supply pins. Seven is the ground and 14 is the +VDC. Any logic system using +3 V to + 15 VDC is feasible. Pins 5, 6, 12, and 13 are the input pins that create the closure on their respective outputs. When the 4066 is switched off there is a closed circuit on the output pins. The example calculator (calculator A) shown in the diagram is a National Semiconductor 850A.

REFERENCES 1. Alexandrovich, G., Sr. Convert your pocket calculator into a programmable counter. Electronic Design 23: 100, 1975. 2. Lancaster, D. CMOS Cookbook. Indianapolis: H. W. Sams and Co., Inc., 1977. 3. National Semiconductor. Interface Integrated Circuits. Santa Clara, Calif.: National Semiconductor Corporation, 1975, pp. 7.6-7.7.

4. National Semiconductor. Voltage Regulator Handbook. Santa Clara, Calif.: National Semiconductor Corporation, 1978. 5. R a y f i e l d , F. An inexpensive six-digit solid-state counter. Behav. Res. Meth. lnstrum. 8: 419, 1976. 6. Wolach, A. H., P. Roccaforte and S. E. Breuning. Converting an electronic calculator into a counter. Behav. Res. Meth. lnstrum. 7: 365-367, 1975.

Digital counters: inexpensive alternatives.

Physiology & Behavior, Vol. 23, pp. 795-797. Pergamon Press and Brain Research Publ., 1979. Printed in the U.S.A. Digital Counters: Inexpensive Alter...
265KB Sizes 0 Downloads 0 Views