The Computer Controller Cookbook
The Computer Controller Cookbook
85 84 83 987654321
TOM AND KELDA RILEY
Contents
List of Figures VB
Introduction IX
2 Airplane Wheel 15
4 Sketch Pad 47
7 Super Stick 87
8 Foot Pedals 99
15 Software 177
Figures
1-1 Rebuilt Paddles 5
1-2 Apple II Factory Game Controller Schematic 6
1-3' Plug Protector 9
1-4 Game Controller With Correction Caps 11
1-5 Zeroing Joystick Elements 13
e
00
• II •
•
•
Introduction
The idea of building computer hardware yourself may seem a little
scary at first. After all, personal computers are now as powerful and
sophisticated as the biggest computers of only a few years ago. How
can a novice presume to build something to be attached to such a
valuable and complicated machine?
Unfortunately, while books, classes, and tutorials on how to use
software packages are everywhere, instructions on how to use, build,
x The Computer Controller Cookbook
You may have noticed that the controller projects have a number
of features in common with the new discipline of robotics. Both
depend on the construction of mechanical devices and the
interconnection of these devices with computers. At present, the cost of
experimenting with even the simplest robots is too high for the
average person. Working on controller projects like the Airplane
Wheel and the Super Stick will give you a good introduction to the
basic electronic and mechanical skills required for robotics at a modest
cost.
access to the right tools. It seems fairly evident that today's students
would be much more interested in building a Race Car Steering Wheel
than a spice rack.
REQUIREMENTS FOR
USING THIS BOOK
All of the projects have been built, tested, and used as controllers for
our Apple II Plus computer. Fortunately, the game controller circuits
for most home computers are similar, and these designs can be adapted
to most home computers that have a game port. We've given many
suggestions for how to do this in the individual chapters, and a special
section of the Electronics Tutorial, "Adapting the Controllers to
Different Computers," goes into the subject in more detail. Specific
instructions are given for the Atari, Commodore VIC-20, IBM
Personal Computer, and Radio Shack systems. Chapter 9,
"Converters: Between Apple and Atari," concentrates on conversions
between the two machines we've had the most experience with.
Because these machines use two of the most frequently encountered
designs for game controllers, this chapter provides an excellent
example of machine-to-machine adaptations.
We've also included six programs (written in Applesoft Basic)
that you can use to test the completed controllers. All but two of the
programs can easily be converted into the version of Basic available for
different machines. The Drawing program contains graphics
handling functions, and the Digitizer contains disk handling
instructions, that are specific to the Apple computer.
Tom Riley
Kelda Riley
1 Rebuilding Paddles
and Joysticks
The easiest way to learn how to build controllers for your home
computer is by rebuilding a commercial paddle or joystick. This is a
useful training exercise and, in many cases, a necessary project because
commercial paddles, which may cost up to $60, are not built very
substantially, and they often don't stand up to the rigorous workouts
they get.
2 The Computer Controller Cookbook
TYPES OF CONTROLS
We have an Apple II Plus Computer; most of the controls in this book
were designed and tested for that machine. We will attempt, however,
to point out the changes in the designs that are necessary to adapt them
for other computers whenever we have the appropriate information.
Most home computers have similar electronic circuits for their game
controls.
Controls come in two general types: digital and analog. A digital
control (like the Atari paddle) consists of a group of pushbuttons. An
analog control, made up of potentiometers that can be adjusted
uniformly over a range, is much more versatile.
Most of the projects in this book will feature analog controls, but
we will throw in a couple of projects for digital controllers just for
good measure. The various digital paddles are almost identical, but
there are two distinct types of analog controls. They differ in the cost of
their components and in their electrical wiring, and we will point out
these differences.
four fine, multistranded wires is good for building paddles. You can
purchase satisfactory telephone cable from Radio Shack. You can also
weave several individual wires into a cable with a Boy Scout rope-
making machine or pull #26 wires inside aquarium tubing. Both of
these procedures have worked for us in various projects.
Replacing the plug is another important part of rebuilding the
paddle. On the Apple, the plug is a standard DIP (Dual Inline
Package) plug. It can easily be made from a device called a header, or
component carrier, at a cost of about $1.25. A header looks something
like a standard chip, but has a row of tiny forks to which the individual
wires are soldered. Whenever you are soldering on this device, plug it
into a loose socket so that the pins will be held straight and will not
loosen in the plastic.
MECHANICAL REBUILDING
You will note in figure I-I that several mechanical changes were made
to the paddle case. First, the new pots were mounted and, if necessary,
filed flat to accept the knob. The new switches were mounted in the
original holes; you can relocate them if you want to. Paper labels
clearly identifying the paddle number were put on the front of the case
and covered with transparent tape. A line was drawn on the knob with
a felt-tip marker to indicate the amount of turn.
To give the paddle a solid feel, weights were glued into the bottom
half of the case. We used lead wheel weights that had fallen off
automobile wheels; they were scavenged on bicycling trips. Fishing
weights would also serve the purpose. Such weights can be installed
with either epoxy or silicone sealant. We covered the bottom of the
paddle with felt, attaching it with rubber cement, to further improve
the feel and insure that the paddle will not scratch furniture. In
addition, it may be necessary to enlarge the notch for the cable,
particularly if you use telephone cable.
ELECTRICAL WIRING
Figure 1-2 shows the standard schematic for an Apple paddle. You
may want to refer to page 100 of the Apple II Reference Manual for
REBUILT PADDLES
F / -I
PAPER LABEL MAR K KNOB
II G ='\
LARGE
PUSHBUTTON
LEAD
WEIGHT
FELT
BOTTO M
6 The Computer Controller Cookbook
GAME 1\0
CONNECTOR
PIN
/ +5
6 GC(9
, 2 PB(9
-' /(9 Gel
, 3 PB I
> ? 8 GNO
>
OHM >
>
<-<-<-
PUSH - 57&
BUT TO N OHM
(9
PO T 1
15(5) K
APPLE II
PUSH-....to-
\ ... FAC TORY
GAME
CONTROLLER
SCHEMATIC
FIG. 1-2
more details. Note that two resistors from the original paddle, with a
value of 570 ohms each, are mounted in the game connector. You may
use resistors of any value from 570 to 1000 ohms, rated at 114 watt and
5% tolerance.
You should do the soldering with a small pencil-type iron of from
25 to 42 watts and resin-core soldering. The use of acid-core solder on
electronic equipment will destroy it forever and always-no
resurrection is possible.
Rebuilding Paddles and Joysticks 7
SOLDERING
You may want to unbolt the potentiometer and the pushbutton to
make soldering easier. Cut the cables to length and very carefully strip
back the outer insulation. Be especially careful not to nick the wires. A
small pair of wire strippers, the type that look like pliers and have an
adjustment bolt, are best for this job.
If you use telephone modular cable, you will find that you have
four wires, one more than is necessary. The best use for this extra wire
is to double up and use two wires for the line from pin I (the +5 volt
power supply), which goes to one side of the pot and one side of the
switch. This will reduce the chance of the pushbutton affecting the pot
reading.
You will note that figure 1-1 also shows a jumper between the
unused leg of the pot and the center terminal. This is considered good
electronic practice and helps performance somewhat when the pot
begins to wear. If the pushbutton has three terminals, be sure to use the
pair marked C (common) and N.O. (normally open).
To attach the header, strip back the insulation from the cable and
expose the wires, trim them neatly to the length required, and tin
about liB-inch of bare wire on each with solder. Plug the header into
an empty socket and locate the mark for pin 1. The cables usually are
fed in from the pin B end to make them easy to plug into the Apple.
Now you can fit the wires into the tiny forks, holding them with a pair
of long-nose pliers, and solder them in place.
8 The Computer Controller Cookbook
Clip off the excess wire with a small pair of diagonal cutters. Place
the two pull-down resistors into the header, shortening and bending
their leads to fit the forks precisely. Hold the wires with long-nose
pliers, not your fingers, while you are soldering.
If you have a multimeter, you can now check out your work
without the risk of plugging it into the computer. Put it on a low ohms
scale and measure for continuity between the pins on the connector
and the appropriate points indicated in figure 1-2. In addition,
measure from pin 1, the +5 supply, to pin 8, the ground, to insure that
impedance is greater than 50 ohms, and that it remains greater than 50
ohms for all settings of the pot and all pushbutton combinations. It is
a good idea to have a friend check your work for you. In any case,
checking it three times usually insures correctness.
"
"'
PLUG
CROSS SECTION
PLUG
PROTECTOR
FIG. 1-3
OPEN VIEW
CARVe
OUT
A FINAL TOUCH
One of the most common problems with Apple paddles is bent pins in
the connector. This isn't a failure in the design; computer users simply
leave them lying around unprotected. Figure 1-3 shows a protective
foam block for the connector that should be used whenever the paddle
isn't attached to the computer. The best material for this is the stiff but
flexible white foam that is used to pack delicate electronic equipment.
This foam is easily worked with a pair of scissors. A rubber band holds
the foam block in place. A loose socket can also be used to protect the
pms.
10 The Computer Controller Cookbook
JOYSTICKS
Most of the procedures we use in reconstructing a paddle can also be
used for fixing a joystick. You can obviously replace the connector and
the cable. In this case, the cable will require more conductors: four
conductors if there is one pushbutton, five if there are two, and six if
correction capacitors are required. A double run of the modular
telephone cable with stranded wires works much better than the
commonly used ribbon cable. There is usually plenty of room in the
joystick case to install new pushbuttons; it is just a matter of matching
holes.
The joystick element containing the two pots and the mechanical
linkage is more difficult to replace. It is almost impossible to find
replacements for just the pots, and the commonly available
replacements for the entire element are not very good. You may also
have to use pot values other than those originally intended and add
correction caps (see the explanation of correction caps below). Joystick
elements with centering springs and tabs are usually better made than
those without.
One of the special problems that occurs with joysticks is failure to
zero. When this occurs, a pot will read a small positive number-
instead of zero-even though the pot is in its extreme low position.
Failure to zero is usually caused by poor mechanical construction of
the joystick element. There is a procedure to correct this problem,
described in the section on Zeroing Joystick Elements below, but it is
difficult to complete successfully.
Be sure to provide proper strain relief for the cable where it exits
from the box. The wires of ribbon cables often break at this point.
CORRECTION CAPACITORS
One of the most common ways in which home computers read input
from paddles uses a timer circuit. You can tell if this is the procedure
used by your computer by counting the wires from the paddle pot back
to the computer. If there are two wires (the +5 and pot wires), then the
pot is wired as a variable resistor and is used in a timer. If there are three
wires (the +5, ground, and pot wires), then the pot is used as a variable
voltage device, or true potentiometer. The Apple, the Commodore
Rebuilding Paddles and Joysticks 11
GAME [\0
CONNECTOR
PIN
+5
GC/9
PBrs>
1/9 GCI
3 PBI
GND
CI C2 RI C3 R2
IK IK
POT
(9
GAME
CON TROLLER
WITH
CORRECTION
CAPS
F [G. 1-4
SEE TE X T FOR
COMPONENT
PB I I-{o------'
VIC-20, and many other computers use the timing circuit. Some Radio
Shack models use true potentiometers.
The timing circuit can be adjusted for pot values lower than the
original values. This adjustment can be made by adding small
capacitors within the paddle and thus requires no modification of the
host computer. Figure 1-4 shows how the correction caps can be added
to a standard controller circuit.
12 The Computer Controller Cookbook
ZEROING JOYSTICK
ELEMENTS
A common failure of joysticks, particularly cheap ones, is not to go to
zero. This can be corrected, but the procedure is tricky, and it is
possible to ruin the joystick element. If you decide to attempt the
correction, first unsolder and disassemble the joystick element and
remove the potentiometer. The metal back must then be removed from
the pot by straightening the small metal tabs. Do it carefully, because
Rebuilding Paddles and Joysticks 13
.-----RESISJIVE ELEMENT
WIPER TRACK
METALLIC BAR
PAINT--=-"
AREA AREA
TERMINALS
ZEROING JOYSTICK
ELEMENTS
FIG. 1- 5
these tabs will not bend many times before they break. In removing the
back be careful not to lose any of the internal parts.
Now the pot element'should look like figure 1-5. Note that there is
a small active area of resistive element in the middle and two large
inactive areas on either side. The problem is that the inactive areas
have too much resistance to read as zero. Look closely at the limits of
the wiper track, which leaves a mark in the active area.
The trick is to reduce the resistance of the inactive areas. This can
be done by painting over them with sterling silver pigmented paint,
available at electronics stores, or with a homemade paint made from
clear nail polish and lock graphite. Needless to say, the expensive
silver paint is better.
14 The Computer Controller Cookbook
Carefully wipe clean the inactive areas. Make up a mixture of nail
polish and graphite into a paste on a smooth surface, then paint the
inactive area of the pot element, covering the terminal end and
continuing until you just touch the end of the wiper track. Be very
careful that the paint goes nowhere else, particularly not where it
might touch the metal case or the metal feelers for the central terminal.
It may take two coats for complete coverage. Allow the paint to dry
thoroughly.
Now reassemble the pot and the joystick element. Resolder the
wires according to the schematic. Run the checkout program. If
correction caps were used you may have to adjust their values.
Parts List
Rebuilding Game Paddles and Joysticks
Approximate
Cost $14.00
iI \\J
0
M
([J)\ )V
-:
-,
'-
'-1/
J
:::--
en - I
'-L-/
------
_J
(- -
-
-
\
-.
-
/r -I.
-
2 Airplane Wheel
The first chapter in this book of homebuilt controls for personal
computers explained the rebuilding of existing paddles and joysticks
to improve their electrical performance, beef them up mechanically,
and give them a better feel. In this chapter we will tell you how to build
a new type of control, one which can't be purchased at any price. We
call it an airplane wheel; a pilot might refer to it as a control yoke.
16 The Computer Controller Cookbook
AIRPLANE
WHEEL
SKE TCH
FIG 2-1
THE DRAWINGS
Before you get excited and start building this device, let's look briefly
at the drawings. Figure 2-1 is a sketch of the completed prototype
indicating the leg board, lower support and struts, the wheel itself, and
the hardwood grips. Note that two microswitches are mounted in the
grips, pot 1 is mounted in the wheel axis, and pot 0 is mounted on the
lower back strut.
Figure 2-2 is a side view that gives much more detail on the
assembly of the unit. Figures 2-3 and 2-4 show details of the
component parts. Figure 2-5 is the electrical schematic, which will be
explained in a separate section.
CONSTRUCTION
MATERIALS
The airplane wheel is constructed primarily of plywood and sheet
metal. It can be built entirely with hand tools, but the use of a table or
radial arm saw will sneed up the work. It is therefore helpful if you
PB I
i I HARDWOOD
IJ GRIP
STOPS
\ ..
POT j
..
t
I
iJ WHEEL
'- .
AIRPLANE
WHEEL
SlOE VIEW
STRUTS FIG. 2-2
POT
(5)
LOWER
SUPPORT
CABLE LEG
BOARD
Airplane Wheel 19
CONSTRUCTION STEPS
Assemble all the materials and parts you will need for the project.
Then start work by cutting out all the wood, metal, and plastic parts.
The large holes in the upper and lower supports are included simply
for decoration, to give the control a lighter, less massive look. They
were cut out with a hole saw and a power drill, but can be omitted if
this tool isn't readily available.
The physical size of pots from different manufacturers varies
somewhat, so if you begin the woodwork before you have the pots, just
drill 3/16-inch pilot holes for both the mounting hole and the shaft.
When you obtain the pots you can drill out the holes for an exact fit.
Potentiometers are designed to be mounted through thin metal.
To mount them on wood that is too thick for the pot bushing, first
mount the pot on a 1/16 to 1/4-inch piece of stiff material-aluminum
or steel sheet metal, plexiglass, or Formica. Then screw this piece
securely to the wood. This is the method used for mounting pot 1 (see
figure 2-4). Pot 0 is shown mounted directly in the wood, but it could
also be mounted in the manner just described.
When drilling sheet metal, never hold the work with your hand;
the metal will spin and cut your fingers. Hold the sheet metal with vise
t
PB 1 0 ell
rDRILL
TO
SUI T
,.._.,-- SW I TC H
l'---/"'-k---_-_-_--:[-34 2
_C, ,0
II Iis I @:I
I I I I
I I
BACK I I ,I I
I I
VIEW : I I I
@, I ,@
I I I , to
I I I I \0
, ,
I ,
I I
I ,
I
, I@ @, ,
I ,
I
I
I
\__L_..1 .: +- , __ _ _---j. .l
o o_____=------'l
WHEEL
TOP -HARDWOOD
VIEW SU [ T ··-tIT...:
( ,", --.l '\J
_1
PARTS
FIG. 2-3
I
. 16 - - - - - - - - - - - - - - - - ;
,-
, - -; --
LEG BOARD
I
to
I
I..J
I'"
BACK
VIEW
·- t
.--', Q GC 1 t5
SIDE
VIEW R PO T MOUNTING
V) pLATE
UPPER SUPRJRT
FRONT
VIEW
MORE
PARTS
+ FIG.
2 -4
" '-BUSHINGS !
4 ----'--
o *
25 t.o.
k5:o1
f"""9-
. . .G.r-
4-REG_
BRASS
BUSHING
o
;:: 3 -REG. I-REG
SIDE o l!)-.J
.<:
VIEW
22 The Computer Controller Cookbook
grip pliers or in a bench vise. With any of these materials, start with a
pilot hole of about liB-inch in order to locate exactly the center of the
hole, and back up the drilled piece with scrap wood to prevent
breakout damage.
Observe that the wheel is attached to pot I by set screws tapped
into the wood ("tapping" is the cutting of screw threads on the inside
of a hole). Drilling and tapping is usually done in metal, not wood,
but we have found that hardwoods like oak and maple work
satisfactorily if the tap has coarse threads like the #10-24 shown in
figure 2-3. No lubricant is required for tapping in wood. Two Allen set
screws at least lI2-inch long should be installed at right angles to each
other. The tapping is most easily accomplished before the steering
wheel parts are assembled.
Inside the potentiometer is a small metal tab that stops the pot
from turning a complete 360 degrees. (Most pots turn through 300
degrees.) This internal tab is fairly weak, so stronger stops must be
built to keep it from being accidentally broken in vigorous play.
Figures 2-2, 2-3, and 2-4 show one stop screwed onto the top support
and two screwed onto the wheel. These stops can be made from faucet
washers or small rubber feet attached with roundhead screws. You may
have to insert flat washers under them if they don't touch each other.
These stops will be precisely located during final assembly.
Both of the pots have 2-inch shafts. These long-shafted pots are
sometimes difficult to obtain. If you can't find them locally, you can
order them by mail. The ones for the prototype were ordered from
Newark Electronics. The minimum order is $25, so you may want to
go in with some other people on an order, Delivery time is four to six
weeks.
Two microswitches are mounted in the wooden grips for use as
pushbuttons. They are shown in figure 2-2 mounted at the top of the
grips; here, they are pressed with the thumbs. If you prefer, they could
be pointed away from the user or to the inside of the wheel and pressed
with the index finger. The switches and the #2 mounting bolts were
bought at Radio Shack, but suitable switches can be purchased from
many mail-order houses. The Radio Shack switches (Cat. No. 275-016)
have a small metal lever that is attached with a rather weak hinge.
Reinforcing this hinge with a matchhead-size dab of silicone sealant
helps to strengthen it.
The microswitches are mounted on the plywood wheel and
covered by the hardwood grips, which also have a hidden groove for
Airplane Wheel 23
the switch wires. The grips on the prototype were cut from scrap
walnut, so they are particularly attractive.
The plastic washers are inserted wherever two wood parts would
otherwise rub against each other. They are cut with scissors from
polyethylene coffee can lids; the central holes can be cut with a hand
paper punch. These washers provide smooth turning while relieving
the strain on the pot shafts.
The three bushings on the supports are installed where wood
moves against the bolt threads. These bushings on the prototype were
cut from model shop tubing with a small triangular file. There is also
a bushing in the one strut which goes over the shaft of pot O. Flat metal
washers are also used wherever bolt heads and nuts come in contact
with the wood.
The lower support has built into it a clamp for the shaft of pot O.
The pot itself is mounted on the end of one strut and moves with that
strut. The pot is fitted to the strut and held with silicone sealer. In
constructing the clamp, a pattern of holes is cut into the support to let
the clamp close down on the shaft when the #6 nut and bolt and flat
washer are tightened. We strengthened the wood around the clamp by
coating it with epoxy, and later redrilled the holes.
SUB-ASSEMBLY OF
WOOD PARTS
After you have cut out all wood parts and given them a preliminary
sanding, you can begin assembling them. The lower support is
attached to the leg board with two #8 x I-inch flathead wood screws
and wood glue. Counter-sink the screws flush with the wood surface.
Assemble the top wheel support in the same way. We prefer to use
Elmer's Carpenter's Wood Glue, but any good quality wood glue will
do. Keep a damp cloth handy to wipe off excess glue.
Next, assemble the wheel hub with wood glue by putting a 1/4-
inch bolt with flat washers through the central hole in each piece.
Tighten the bolt to clamp the three pieces together. The hand grips
have to be custom-fitted to the wheel and holes for #4 screws drilled
through the plywood wheel, but the grips are not glued on. For the
microswitches, drill mounting holes through the plywood, not the
gnps.
24 The Computer Controller Cookbook
FINAL ASSEMBLY
Pot I should now be installed through its mounting plate. Be sure to
make a small hole for its spin prevention tab. Screw the mounting
plate to the top wheel support. The four brass bushings are installed in
the following locations: two in the top support, one in the front hole of
the bottom support, and one in a back strut. If the bushings fit tightly
you will not need to glue them. Pot 0 is glued on one of the struts. The
hole in the strut should be drilled out to a snug fit on the pot bushing
(not on the smaller shaft). Then cut a notch for the tab and glue the pot
to the strut with epoxy or silicone sealant.
Next attach the struts to the two supports, using two flat washers,
two plastic washers, and a nut for each pair. When you are certain you
have the unit assembled correctly, lock on the nut with Loctite thread
sealant, Super Glue, or fingernail polish. The bolts should be tight,
but the struts must move freely when moderate force is applied. You
can also install the clamp bolt in the lower support at this time, butdo
not clamp the pot shaft until the final adjustments are made.
You can lubricate the bushings and flat washers with a tiny
amount of petroleum jelly or candle wax. We think the wax gives a
better feel to the movement of the finished device.
Now press the wheel onto the pot shaft. You may have to chase the
hole with a drill bit to clear out excess glue and finish. The big plastic
washer goes between the wheel and the support. If the pot shaft sticks
out of the front of the wheel, you can either cut off the shaft or install
Airplane Wheel 25
additional large washers. The wheel stop on the top support can be
installed at this point, but the two stops on the wheel itself must be left
off until final adjustments are made.
ELECTRICAL
COMPONENTS
Electrically, this unit is just an overgrown joystick with two pots and
two pushbuttons. The wiring schematic (figure 2-5) is for the Apple II,
but you can build an airplane wheel for any computer that can handle
a two-pot joystick and at least one pushbutton. To do it, you must use
the correct pot values, find the right plug, and make changes (mostly
pin numbers) in the electrical wiring to fit your machine. Your task is
simply to search out this information concerning a standard joystick
for your system and copy the electrical connections, and use it to adapt
our schematics for your own use.
In the prototype, the pot I value is 150K ohms, an unusual value
but standard for Apple paddles. Pot I should be long-shafted,
completely enclosed, and of good mechanical construction. The parts
list at the end of the chapter gives a suggested manufacturer's part
number and supplier. If the pot does not have a screwdriver slot across
the end of the shaft, you will have to cut one with a hacksaw, since the
shaft must be turned with respect to the wheel during final
adjustment.
Pot 0 is a bit different. This pot does not turn through its full
range. (As noted earlier, a normal pot will turn through 300 degrees
from one stop to the other.) The struts that move potO will permit only
about 170 degrees of turn. If you desire a full reading you must use a
larger pot, one that will go from 0 ohms to 150K ohms over a turn of
170 degrees. You also have to choose a value for the pot that will let you
purchase the actual item.
For the Apple II, a value of 250K ohms works very well. Other
computers will require a value about one and one-half times that of the
standard pot. For an Atari which uses 1 meg-ohm pots, you will need a
1.5 meg-ohm pot which must also be long-shafted and mechanically
sound.
The pushbuttons in the prototype are microswitches that have a
metal lever on top. We purchased them at Radio Shack. There are three
26 The Computer Controller Cookbook
PB I P8Q
A.fR PLAN E
WHEEL
SCHEMATIC
FIG.2-5
POT&.
25&. K
C PIN
I .of 5
'--....----? 2 P8
'---+-___.----7> 3 PB I
6 GC
1& Gel
RI 8 GNO
IK
GAME I\O
R2 CONNEC TOR
I K
SOLDERING PROCEDURES
To do the soldering in this project you need a small soldering iron
(about 25 watts), resin-core solder, wire strippers, and a small pair of
long-nose pliers. Figures 2-2 and 2-4 show which terminals of the pots
to use for the various wires and where to route the cable. Start wiring at
the pushbuttons and work back to the plug. You will need a three-
conductor loop of cable to extend from the wheel to the back of the top
support. It must be long enough to allow rotation of the wheel
through 300 degrees. You can work out the correct length and location
of the anchors by trial and error.
Before you wire the unit, make two photocopies of figure 2-5.
Then, as you run each wire and make each solder joint, trace it in on
one of the copies with a colored pencil. After you have finished the
wiring, it is a good idea to have another person go over the unit,
checking out the wires with a colored pencil on the second photocopy
to make certain that you haven't omitted any connections.
28 The Computer Controller Cookbook
If you have a multirrieter you should also check the resistance
from pin #1 (+5 supply) to pin #8 (ground). You should always get a
reading of at least 50 ohms on any control, and the reading ought to be
much greater. Watch this reading while pushing the buttons and
turning the pots. It must always be high.
ALIGNMENT
Aligning the control requires a simple program that repeatedly shows
the reading of pots 0 and 1 and the condition, open or closed, of
pushbuttons 0 and 1. You can use the Controller Checkout program
from chapter 15. Or you can write your own program. Be sure to put a
slight delay between the two paddle readings. Check out the program
on a· standard joystick or paddle before testing your new controller.
Now turn off the computer and plug in the new unit, making
certain that the #1 pin in the plug is in the correct hole. Turn on the
computer. If it doesn't start up exactly as usual, turn it off at once and
recheck your work. Now load your check program and place the
airplane wheel in position under your legs.
We will start the adjustments with pot 1. Turn the airplane wheel
slowly and check that the pot reading goes from 0 to 255. Now center
the wheel and, using a standard screwdriver, turn the pot shaft inside
the wheel until the reading is 127 with the wheel centered. Press the
wheel firmly on the shaft and tighten the set screws.
To locate the two stops on the wheel (the single stop is already
mounted on the top support), turn the wheel until you feel one of the
stops inside the pot. Now back off this stop just a little and check that
the reading on the screen hasn't changed. Hold the stop in place and
mark its center with a sharp point, like an awl. Repeat the procedure
on the other side for the third stop. You may have to remove the wheel
to install the stops properly, then replace and center it again.
To adjust pot 0, pull the wheel as far forward as you can, leaving
the clamping bolt loose. Adjust the pot with a standard screwdriver
until the reading on the screen just reaches O. The forward motion
must be stopped by contact of the wood parts, not by the tab inside the
pot. Now lock the clamp by tightening the clamp bolt. Pushing the
wheel back should now bring the reading all the way up to 255, and a
reading of 127 should be at a center position that is comfortable to
hold. Press the pushbuttons to make sure they work.
Now load your favorite flight simulator program or space game
and take off.
Airplane Wheel 29
FINISHING TOUCHES
To give the unit a finished appearance and make it last longer, you
may want to do the following:
• To keep the cable out of your way and prevent it from being pulled
loose, you can tie it to the wood parts.
• Use silicone sealant to cover the exposed electrical connections and
the back of the plug. This is called "potting."
• The ends of the wire loop between the top support and the wheel
should be mechanically secured. You can tie one end to the pot
with dental floss and silicone sealant. Likewise, secure the other
end to the wheel with the same materials and a small screw.
• Glue felt on one or both sides of the leg board with contact cement
to give a nice finishing touch to the controller.
• You can personalize the finished unit by placing a paper cutout or
a hand-drawn emblem in the center of of the wheel. This should be
done after final pot adjustments are complete. Our prototype is
adorned with a tiger's head (easily recognizable from an ad for a
popular printer).
Parts List
Airplane Wheel
Approximate
Cost $36.00
currently running and, with appropriate software, they will let you
use two standard joysticks at once.
Socket extensions are available commercially, of course, but no
single unit will have all the features of the socket extension we will
describe. Besides, you can construct a home built unit for about half
the cost of a commercial one. A multiple socket extension is an
excellent first project for learning to work on computer hardware,
since the device is simple and easy to construct. The materials to build
it are easy to obtain, and only a small multimeter is required for testing
the finished unit. What more could you want?
Figures 3-1 through 3-5 give you the details of units that were
built for the Apple II. We will discuss what might be done to construct
multiple socket extensions for other computers later in the chapter.
TYPES OF MULTIPLE
SOCKETS
There are two types of multiple socket extensions. Those which
permit the choice of one of two or more paddles will be referred to as
selection units. Those which permit two standard paddle sets or
joysticks to be used at the same time will be called two person units.
We will also describe special features for each type of unit,
including click action power switches, isolation diodes that prevent
paddles from affecting each other's readings, and zip (zero insertion
pressure) sockets. These special features will let you customize the unit
to your exact needs.
A WORD OF CAUTION
Good practice for working on electronic equipment requires that the
power to the unit be turned off before any plug is installed or removed.
The power switches on these multiple sockets are intended to allow
you to select among paddles already plugged into the sockets.
Plugging in a paddle when the power switch is off but the computer is
turned on violates good practice, although it is preferable to plugging
the paddle into a live socket. Remember: turn off the main power
supply to your computer before plugging in or unplugging a paddle
from any of these socket extensions.
Multiple Socket Extension 33
TOOLS REQUIRED
The construction of a socket extension is primarily a precise and
somewhat tedious soldering job. Soldering is the keystone of all
hardware skills and one that can only be learned through practice. It is
definitely a skill worth mastering.
For this project you need a small pencil soldering iron of about 25
watts and a standto hold it, a sponge to clean the tip of the iron,
desoldering braid to remove solder bridges, and fine resin-core solder.
Other tools you should have on hand include a pair of small diagonal
cutters, long-nose pliers (for bending fine wires), an X-acto or other
small-bladed knife, and wire strippers. The plier-type wire strippers
with an adjustment bolt work well but must be adjusted and tested on
each new wire size.
PIN / S I DE
END
.. -----.--H·····--·-----e:-GLUE
: W IR E WRAP IF LOOSE
I SOCKET
::r: I
t-- L.il
CABLE
HEADER
CUT/I
OFF
CORNER t5 GClS)
GND.
o-CABLf CONNECTION
) 0 ('1
o
[
END
V fEW
GCI
PIN /6 SIDE
If the old paddle plug that you are replacing with the stacked unit
needs pull-down resistors for its pushbuttons, these can be installed
between the socket pins. We used two 1/4 watt, l Kohm, 5% tolerance
resistors. They share pin 8 for ground; one resistor goes to spade 2 and
Multiple Socket Extension 35
the other to pin 3. Trim the wires carefully, bend them neatly around
the pins, and then solder.
The cable should be stripped of its outer cover for 3/4-inch and
the wire trimmed. Since the cable normally enters from the pin 8 end,
the +5 wire will be longest and the ground wire shortest. Strip the wire
back 3/16-inch, twist the strands, bend them into a small hook, and tin
the wire. Your wire stripper must be set so that none of the fine wires
are cut. Try several adjustments on a scrap of the same wire until you
have it set correctly. One at a time, press each wire into the correct fork
or close the hook around the pin shaft, and solder it.
The pin I end should be marked with light-colored fingernail
polish, model enamel, or white typing correction fluid covered with
clear fingernail polish. Sometimes the plastic top of the socket comes
loose and has to be glued back on with Super Glue or clear nail polish.
..
,.
TOP VIEW
SIDE VIEW
. .,•
FOAM BLOCK '-t- T .. r
I
r
e c-/2=l
If). j1F -r
MULTIPLE SOCKET
rttttttttJ • WI TH ISOLATION DIODES
I 1
, GAME 1\0 I FIG. 3 - 3
: CONNECTOR :
I , (j) DIODES 01 TO 014
I . I ARE IN914
: I 2 4 5 6 1 81 DOUBLE UP '"5
:,J __t_-, __ t _tul_._tut;L AND GND. WIRES
Multiple Socket Extension 39
... I·
i
•
-
• •
• •1
I
•
••
• • _ -':L'.----=--:::-------:-.
I
- , . . I_ _ •
• • ....,__:o;:;I
•
.. 1
l:iJ-.@
-1"=1 r=,'
,... e, . :.: . J. • .1 • I- • • ., •
I, • • el· •• ., • -r. ,. • • .,
e . ·1·· I·· .,.
• • • L.:..I
• --=---=----'
· II
I· • ·1 ,. . . ., Fl G. 3-4
IR-2. • ., •
•
• •
• •
L.:..I·
,. . . ., CIRCUIT
I· . . .,
· . .'
BOARD
..
I
I'
/-
I" ., .
I
,. • ,. • • '1 • FOR
I· I' • • '1 I ,-I·----'-'·1 • · is'- ·1 •
MULTIPLE
• ,. '1 •
I' '--,._---l SOCKET
;
I·
,...
• ·1
·1 . I'
i
!.
,. •
'"'-1,_---',1
·1
•
· ,.
<!. ., . WITH
DIODES
·· ,.,.
• • l, I· R-S .1 • ,. • ·1 • .
• '1 • ., · a . . ., . BOTTOM VIEW
,. R-3 ., ,. ·1 SOLDER JOINTS
·
+5
,.
• ,. C-I ., • -SINGLE WIRE
-1
., /. - ., - . ., . .MAJOR PART
<.!)- ,. .,
·
· I· . . ., .
. I· ""'--,..----'
• ·1 . ,. "
,- . ., .
• TWO WIRES
• MAIN CABLE
.,
"
-WIRE BRIDGE
I. L.:...!' ·1 ,. '1
..
--- CUT TRACE
I- ,\ I· I· ., .
o HOLES
I'
L.:...I,_ _----l
I
I, '1 -1L,_--,---,-,.,
.,
" •
• • , 'e I· .. .. " .
-H
I'.,
"'-1' -r.--,---..
el -, 1& • • • ,
1/2 RADIO SHACK
CAT NO 276-/54A
-H " S "
.,'1
... ,
I· •
I- :-: •
.
II-i!J ,- :-: '1 •
I· - . e' It .1· I_ .:
-_:;. : C,..-. . -
Q G 8: 1-. •.I: . '?J: r;-"-.----c.'- - - - - - . I
••• Fl.-I
II •• (I (I ........ jo . ,
o WIRE TIE 0
CABLE
Multiple Socket Extension 41
The LEDs (light emitting diodes) used for the prototype are small
and rectangular, one red, one green. They are slightly more expensive
than round LEDs, but that is the only difference. Purchase round ones
of any color, if you prefer them. Install the LEDs beside the socket and
even with its top. From the positive terminal, run a wire around to pin
I of each socket. Then install the current-limiting resistors RI and R2
on a wire run to the ground bus for each. The LED for socket I is in an
area where there are no copper pads, so loop one wire around the other
one before you solder them.
On the pin I side (see figure 3-4), three bus lanes are used for the
pull-down resistors of the pushbuttons. Short insulated jumper wires
are needed to run between pins 3 and 4 and these buses on each end, as
shown in figure 3-2. Both #2 pins are jumped to a bus below the board.
As detailed in figure 3-5, two of these jumper wires go into holes
through which cable wires must also be inserted, so you must wait
until the second wire is ready before you solder them both. There are a
total of five such double-wire holes, and it is somewhat tricky to install
and solder the wires. When using a general-purpose circuit board, you
will run into a few difficulties like this as a matter of course.
put inside the plug since they are on the board, but careful soldering is
required to place 16 wires in so small a space.
Separate two inches of ribbon on the board end of the cable into
individual wires and trim them to the required length. The longest
wire is the double ground that runs to the central bus. The +5 wires
that run to the plus end of the cap are only a bit shorter. The rest of the
wires connect along each side of socket 1. Each wire is trimmed,
stripped, twisted, tinned, inserted into its hole, and then soldered.
People with small hands have a definite advantage in doing this
type of electronic work. You will find that a stand or clamp to hold the
board is a great help.
The tables should be laid down neatly and secured with a wire
wrap. A I-inch thick block of white plastic foam, stiff but flexible,
from a shipping box makes an excellent base for the unit. Cut out a
hole for the switch and secure the board in place with a small amount
of silicone sealant. If you are concerned about the exposed wires you
could cover the top with a sheet of plastic with three holes cut into it.
TESTING THE
SELECTION SWITCH
To test the selection unit, measure the resistance from pin 1 to pin 8 of
each socket. The reading should be infinite at all switch positions.
Inspect the solder side of the circuit board, looking for bridges between
copper lanes and cold solder joints that have an excess of dark resin. To
double check your work, ask a friend to check conductance wire-by-
wire, with the multimeter on a low ohms setting, and color in a second
photocopy of the schematic.
When you are satisfied that the circuit tests out correctly, plug in
the selection socket and turn on your computer. (We assume that you
first turned your computer off if it was already on.) If the computer
does not start up in a completely normal fashion, turn it off at once and
recheck your work. If the computer starts up correctly, try the switch
and watch the LEDs. Next, turn off the computer and plug a trusted
paddle into your new socket extension. Start up the computer again
and run the Controller Checkout program from chapter 15.
If there are any bugs in the unit, they will quickly become
apparent. Turn off the computer and carefully check the solder joints
Multiple Socket Extension 43
associated with any feature that didn't work properly. Most problems
are visible on close inspection. Also, remember to test the stacked plug
that is now inside the computer case.
CONSTRUCTION OF
OTHER TYPES OF
EXTENSIONS
Figure 3-5 is the circuit schematic for a two-person game multiple
socket board. This unit has an ON/OFF switch for both sockets and
does not need isolation diodes. Pins 2 and 4, 6 and 7, and 10 and II are
cross wired. Like the stacked plug, this circuit gives you the two-
person game feature, but makes it available outside the Apple case.
Alternatively, you could make up a four-socket board that
included both schematics (figures 3-4 and 3-5), with a three-position
rotary switch in the center. The rotary switch would direct power to
sockets I, 2, or 3, while the fourth socket on the board would be
attached to socket 3 as shown in figure 3-5. Seven isolation diodes
would be required for socket 3 (none for socket 4), but the connection
to socket 4 would be located between the diodes and the sockets. But
why stop at four sockets? There is no particular limit except the size of
the circuit board.
The owners of computers other than the Apple will find it
beneficial to bring the game ports out of the case and add a choice
switch. The type of plug is different for each computer, and of course
the pin numbers will change. In many systems, all the plugs and
sockets would be on short cables, with the switch, diodes and resistors
on a circuit board in the center. It will take some work to find the
correct pin out information and to locate a supplier for the connectors.
Some systems may use pull-up resistors, connected to the +5 rather
than the ground, instead of the Apple pull-down resistors. Other
systems may not need resistors at all.
There is one other type of multiple control worth mentioning.
The multiplexing control, for which the computer chooses the active
control, is not used for games. When the control input is a
measurement (for example, of temperature or light level) and you
must log the measurements from more than four sensors
TOP VIEW i
SW-I
I IQ
J1J
I
I'
I
t--1n t--8:1---}
15 13 \/,2 1/ IQ \/'9 1
,
I ,
GAME 1\0 I I
MULTIPLE SOCKET
, CONNECTOR till' I FOR
t _:_ __I DOUBLE PADDLE GAMES
FIG, 3 - 5
Multiple Socket Extension 45
IN CONCLUSION
The multiple socket extension is one of the most popular additions to
the Apple and other personal computers. The home built version not
only costs less than a commercial unit but has more features and is an
excellent beginning project in computer hardware.
46 The Computer Controller Cookbook
Parts List
Multiple Socket Extensions
Approximate
Cost $26.00
o 0
UPRI G HT
o 0
P£ «cu.
SKETCH
PAD
F[ G. .4 -1
PRECISION AND
LINEARITY
Simple game controllers can be rather sloppy devices, since accuracy is
often sacrificed for speed and feel. But in constructing a sketch pad,
you want all the precision you can get.
Two parameters are important in obtaining that precision. First
is the theoretical precision of the electronic circuits, whether they are 8
bit, 10 bit, or greater. Second is the uniformity or linearity of the
mechanical to electrical converters, in this case the potentiometers.
These considerations arise whenever you are continuously changing
quantities (analog) to numbers (digital) or vice versa.
50 The Computer Controller Cookbook
The paddle input on the Apple II and most other home
computers is a timer circuit which converts a resistance value into a
number between 0 and 255. This is an inexpensive and stable 8 bit
analog to digital (A to D) converter. It is also an extremely slow one.
The best possible precision it can have is one part in 256, or about
0.57%. This sounds pretty good; old style panel meters had an accuracy
of about 5% at best.
The problem with even 0.5% precision is that errors creep in
because of aging components and temperature changes, so that the
theoretical precision is rarely achieved. And, if you have to measure
several numbers and use them in mathematical equations, the
inaccuracies tend to add up. Expensive computer systems usually have
10 or 12 bit A to D converters. (The most accurate converter we have
seen was a 24 bit system in an astronomical observatory.) The more
precision you try for, the more difficult it is to calibrate and stablize the
system so that you can approach its theoretical limit.
The second problem is linearity. For the sketch pad, linearity
defines how straight a line it will draw. The electronic timer circuit
has strikingly good linearity, but the potentiometers do not. If we draw
a graph of the resistance of a pot versus the degree of turn of the pot
shaft, we should get a straight line. But if the manufacturing processes
for the resistive element in the pot are not extremely uniform, the
measured reading will vary from the ideal straight line. If you use
cheap, non-linear pots in the sketch pad, the lines you draw with it
will be bent. Your drawings will look like the reflections in a funhouse
mirror.
There is not much you can do to increase the precision of the
Apple's 8 bit digitizer, at least not cheaply. But eight bits is almost
enough for Apple graphics, anyway. The resolution of the hi-res
screen is 280 by 192 picture elements, and the two paddles resolve 256
by 256. This is more than enough precision vertically, and we are only
short by 8% horizontally.
CONSTRUCTION
Figure 4-2 gives a top view of the baseboard and details of other
wooden parts. The first step in constructing the sketch pad is to gather
all the materials and cut out the parts.
The prototype was made from l/2-inch hardwood plywood (part
of a salvaged kitchen cabinet), but standard fir plywood would work as
1
1<," I );
"
'o(
',. I ' '\ I
j ...
: -
" J)
\
,-
> s: = = iJ
-
=-\
-;
I I
I TOP
VIEW
\
itP
!
PA PER 8.5 X /I
BASE
BOARD
-----------/2 --------------
1----- 6.5 ----------i
CANTILEVER BRACE
.@: :@:
I I I I
1\ I I.
f: I I I I ""
t ,
I I : l : :'
...,'"
-J
@ @
sc
'"t
...,
ex:
....
<1: 0) / ELECTRONICS
o
u
BRASS o
PB&
o
PBI
BOX
TUBE
@ @)
I iI:11
HEAD
DETAIL
FlG.4 -4
FRONT
VIEW
Sketch Pad 53
well. The drawing surface of the baseboard must be sanded smooth.
The wooden parts of the uprights and cantilever were cut from the
same plywood and also had to be well-sanded, particularly along the
edges. Most of the holes shown in figure 4-1 are for #8 x l-inch wood
screws. They were drilled with a Screw Mate drill, which produces
exactly the right shape hole and counter-sink.
Most of the metal parts (see figure 4-3) were cut from a l/16-inch
thick piece of aluminum scrap. Galvanized steel about l/32-inch thick
would also give good results. You must be able to work the material
with hand shears, but it can't be so flimsy that the parts are easily bent.
When you are drilling sheet metal, you should hold it with vise grip
pliers or in a bench vise to keep it from spinning and cutting your
hand. The front and back of the upright have countersunk holes for #6
flathead wood screws. File all edges and corners smooth as soon as you
cut or drill them.
The parts for the head, which holds the two pots, are somewhat
complicated; figure 4-4 shows them in detail. It helps if you have your
pots in hand so you can trial-fit them. If your first attempt doesn't look
right, make another.
Cut out the two metal pieces that form the hanger (as shown in
figure 4-3), then drill only the two central pop rivet holes. Pop rivet
the pieces together. Now open up the bottom parts of the hanger and
bend them around a l/4-inch bolt to form the pot shaft clamp. Bend
back the bottom tabs so that they don't quite touch. With the bolt still
in place (it substitutes for the pot shaft), drill the clamp bolt holes for
the bottom shaft. Drill the top bolt holes. Then, using this metal piece
as a pattern, drill the matching holes in the cantilever parts and the
masonite spacers.
Cut out the pot mount piece and brace, file the edges smooth, and
drill the holes for the pots. You will need a hacksaw for the two small
cuts. Use the pots to mark the positions of the spin prevention tab
holes. Now bend the pot mount to look like the one in figure 4-4. For
the prototype, the metal was bent in a bench vise with custom-made
oak jaw faces. Fit the brace in position and clamp it with vice grip
pliers in order to drill the pop rivet holes. Install each pop rivet after its
hole is drilled, working from the outside to the inside.
The holder for the drawing instrument is made from brass tubing
available at your local hobby shop. You may want to make several
different size holders for pencils, pens, and a plain wooden pointer or
stylus. Be sure to take the instruments to the hobby shop with you for
trial fittings. Cut the brass tubing with a small triangular file. If the fit
54 The Computer Controller Cookbook
ELECTRICAL
COMPONENTS
The utility of the sketch pad is dependent on good potentiometers: the
pots must be as linear as possible. We have had good luck with the pots
that meet military SPecifications (Mil SPec) described in the parts list,
but even with these you should consider buying a few extras so that
you can choose the ones that draw the straightest lines. The pots listed
have short shafts; they are just long enough for the homemade clamps.
If you have a choice, get long-shafted pots and saw off the shafts as
needed.
The pots do not travel through their full turning of 300 degrees, so
you will need pots with values much greater than the standard values
'of your computer. The 1 meg-ohm pots listed work well for the Apple
II, which normally uses 150K pots.
Sketch Pad 55
If you can't find good pots with the higher values, or if you find
some especially good pots at a surplus store, you can use correction
capacitors, as described in chapter 1. Correction caps can easily be
mounted in the pushbutton box, and you are much more likely to
obtain straight lines if you use them.
The pushbuttons, which should be at least 3/B-inch in diameter,
are mounted in a small plastic box. Your fingers will tire quickly if the
buttons are smaller than this. The correction caps, pull-down resistors
(Rl and R2), and the filter cap (Cl) are mounted on a small piece of
printed circuit board that is placed in this box.
WIRING
For the electronics work on this project you will need a small pencil
soldering iron of 25 to 40 watts and fine resin-core solder. The
necessary hand tools are long-nose pliers, diagonal cutters, and wire
strippers.
The cable from the pots to the pushbutton box must be very
flexible and have at least three conductors. Using four-conductor
telephone cable with the +5 wire doubled up worked well for the
prototype. The cable should be about 30 inches in length-long
enough to loop to the top of the upright and then run to the
pushbutton box. Figure 4-4 shows the pot terminals to which you will
solder the wires.
The run from the pushbutton box to the plug requires six
conductors. Two lengths of telephone cable will work nicely. Ribbon
cable can also be used for this run if that is what you have on hand. If
you have extra wires, double up the +5 supply and ground. The length
of this cable will depend on how far away from the computer you want
to place the sketch pad for general use.
The plug is a standard 16-pin DIP header. You can mount
resistors Rl and R2 on it if you like. Be very careful to identify pin 1 by
its marked corner. The cable usually enters the header from the pin B
end.
The best way to check your wiring is to make two photocopies of
figure 4-5. On the first copy, color in each wire, component, and solder
joint as you progress. Go over your work again and color in the second
copy as a final check. This is standard practice in electronics.
PIN
2 PBi9
>- 3 PBI
- 6 GC t9
119 Gel
I +5
PB
.--
0-
<)
--""'"
8 GND
N.O.
< ? GAME
PB I RI R2 PLUG
N.O. 1;--1 I K. I K.
SKETCH PAD
X-A X IS
SCHEMATIC
PO T '"'---"'---- FIG.4-5
I MEG.
°
Now tighten all three clamping bolts. Move the pencil around the
paper and make marks at the and 255 points in each direction. The
reading in the top left-hand corner should be 0,0, just as the top left-
hand corner of the hi-res graphics screen is 0,0. If one or both axes are
backwards, you can reverse them by moving the +5 wire to the other
outside pot terminal and resetting the 128,128 point.
Try moving the upright up and down to change scale. Mark the °
and 255 limits for different upright heights to learn the range of sizes
available for drawings. You should be able to adjust from about 6 x 8
°
inches down to 3 x 4 inches. If and 255 fall off the baseboard, you will
need the correction caps as discussed earlier.
LINEARITY TEST
The Linearity Test program (see chapter 15) provides a test of the
linearity of your pots and the accuracy of the sketch pad as a whole. To
make this test you will need paper, a compass, and a straight edge.
Tape the paper to the board and run the program.
As shown in figure 4-6, draw a line front to back down the center
°
of the paper. Mark the points on this line where Y, as shown on the
screen, becomes and where it reaches 255. Using the compass, bisect
this line (the required arcs are shown in figure 4-6). Draw the bisecting
line completely across the paper. Bisect each half of the first line with
short cross marks. Mark the points on this line 5, 6, 7, 8, and 9, as
shown in figure 4-6.
58 The Computer Controller Cookbook
BASE
Y=fY '
x x
L INEARI T Y TEST
X ><
FIG.4-6 x
@
Y=255
Mark the 0 and 255 points on the X axis line and bisect the line
between these points. The central point #2 mayor may not fall exactly
on the Y axis. Bisect each half of the Y line and mark points 0 to 4.
Now for the linearity test. Carefully place the pencil on point 0
and press the 0 button, then do the same for points 1,2,3, and 4 in tum.
Move to points 5 through 9 and at each press pushbutton 1. The screen
will now show the correct reading for each point, the value actually
read, the error, and the error as a percentage of full scale. The lowest
repeatable score could have as low as 0.5% as the worst error
Sketch Pad 59
percentage. Sketch pads with error rates below 4% will generally
produce good drawings. Run and test several times to see how good
you are at hitting the same points. Pots with large error values will
draw distorted pictures, but the distortions may lead to interesting
effects.
After testing the unit as described, you may want to cover the
exposed wires on the pots and the DIP header with several coats of
fingernail polish or with silicone sealant. Gluing cotton felt to the
bottom of the pushbutton box will keep it from scratching the
desktop. Be sure to mark pushbuttons 0 and I clearly.
SUMMING UP
The sketch pad is an inexpensive, easy-to-build device that can be used
for computer art work and data entry. Its major limitation is the
imprecise linearity of inexpensive pots. (Commercial units, however,
also have difficulty achieving good linearity.) The programs included
here let you check the quality of the sketch pad and help you get started
with drawing and data entry.
62 The Computer Controller Cookbook
Parts List
Sketch Pad
Approximate
Cost $28.00
..
HAND
GRIP
TIPPING DISK
JOYSTICK
SKETCHES
F [G. 5 -I
FEATURES OF TWO
HOMEBUILT UNITS
Figure 5-1 shows sketches of two joysticks for the Atari. Each unit is
constructed from a block of hardwood in which the switches and
wiring are embedded. The hand grip joystick, like the standard unit, is
·used by holding the block in one hand and the grip in the other. The
FIRE button on top of the handle will feel natural to most players. The
weight of the homebuilt unit improves the feel, and the switches click
to give you tactile feedback.
To operate the tipping disk unit, you hold the block in one hand
and work the FIRE button with the index finger of that hand. (Your
index finger can press a button more quickly than your thumb.) With
i I..
I t(
_
GROO"" ""'J TRIGGER
II _ j,«> BASE
I
I I
I,i,
I,
I I
I I
I I
II( HANDLE
I! GRIP
SIDE
VIEW
HANDLE
SS SECTION
A-A ( SHOWING
CRG WIRE HOLES)
" T (;:;\
ii 10 ATARI JOY STICK.
WOOD
'PLUG FIG. 5 - 2
TIPPING DISK
Tl PPING DISK
JOYSTICK
FIG. 5-3
Homebuilt Atari Joysticks 67
the finger tips or palm of your other hand you press the disk to direct
the movement. With the tipping disk joystick, the player controls the
computer with hand movements that are quite different from those of
the conventional units.
CONSTRUCTION OF THE
HAND GRIP JOYSTICK
Figure 5-2 presents a side view of the component parts of the hand grip
unit. The base is a hardwood block that you make by gluing three 3/4-
inch thick boards together. We used oak for all the wooden parts of the
prototypes, but any attractive wood free from cracks and large knots
will do as well. You could use clear pine, but the finished unit will not
be as strong or good looking.
Cut the microswitch grooves with a dado blade in a table or radial
arm saw (or use a router or handsaw). Since it is somewhat difficult to
cut grooves in this small a block with a power saw, you might want to
start with three 14 by 3-inch boards. Apply carpenter's glue and clamp
them together. Drill the large holes and cut the microswitch grooves
for four blocks into the one large piece. This accomplished, you can
then saw the large piece into four blocks. This is easier than trying to
work with a small block and scarcely increases your cost. If you want to
make only one joystick, choose the best of the blocks and discard the
others.
Cut out the large central hole with a hole saw in an electric drill or
with a large adjustable auger bit in a brace. It is easiest to do this before
the grooves are cut.
The rubber hose shown in figure 5-2 serves as a flexible joint. It is
the type used for automobile heaters and was purchased at an auto
supply store. Other types of hose might be used if they are springy and
not too stiff. Size the wood plug and the base for the hand grip for a
snug fit in the hose.
The hand grip was cut from a single piece of 3/4-inch thick
lumber. With a wood rasp, contour the front of the grip to fit the
fingers of your hand. The microswitch groove was cut with a small
handsaw and a 1I4-inch wood chisel. If you prefer, you can move this
switch to the front of the grip so that you can operate it with your index
finger rather than your thumb. The hole down the middle for the fire
button wires was drilled with a 1I4-inch paddle drill.
68 The Computer Controller Cookbook
Drill the hole for the wood plug and then carve out part of the
bottom of the block to make a cavity in which to place the wire
connectors. Glue the plug in place. For the wire of each microswitch
drill a 3/16-inch hole; drill a slightly larger hole for the main cable. All
of these holes lead to the bottom cavity.
Rasp off the outside corners of the block. (The amount of
rounding off you choose to do is one aspect of customizing your unit.)
Sand all surfaces smooth, taking special care with the hand grip. The
best finish for the wood parts is two coats of polyurethane varnish.
CONSTRUCTION OF THE
TIPPING DISK JOYSTICK
The construction of the tipping disk is much the same as that of the
hand grip unit. If anything, the tipping disk is easier to build. Figure
5-3 shows details of the parts. Cut out the three pieces of hardwood and
glue them together. As noted before, it is easier to make several blocks
at once and cut them apart later. Drill the 3/B-inch central hole and cut
the mieroswitch grooves, following the instructions for the hand grip
unit.
The groove for the FIRE button is on the side of the block; in
figure 5-3 it is shown for right-handed players. The right or left hand
orientation of the unit is set when you cut this groove and the hole for
the main cable. To properly locate the groove, hold the partially
finished block in your hand and find the most comfortable place for
your index finger.
Drill the holes for the wires and the main cable and chisel out the
bottom compartment as before. Round off all outside corners until the
unit rests comfortably in your hand and sand all surfaces smooth.
The tipping disk itself is made of masonite or other thin material.
It can be any diameter that suits you, either larger or smaller than the
base block. Cut it out with a coping saw, and round off and smooth the
edges. The disk and the block should be finished with polyurethane
varnish before you begin wiring the unit.
The tipping post is a short piece of 3/B-inch dowel, one end of
which is rounded. The exact height of the post and shape of the
rounded top affect the feel of the finished joystick, so it is one of the key
elements for personalizing the unit. Do not glue this piece into the
block until you have tried the action and then shaped the end to get the
Homebuilt Atari Joysticks 69
response you want.
The springy foam cross that fits beneath the disk was cut with
household scissors from 1I2-inch thick polyurethane shipping
material. The thickness and shape of this foam piece is another
important element in personalizing the unit.
ELECTRICAL
COMPONENTS
The key electrical parts of these units are the switches. They are, in
fact, almost the only electrical parts. Radio Shack submini lever
switches were used for the prototypes. Discount mail order houses like
PolyPaks (see chapter 14 for their address) have similar switches for
about half the price. Look for those described as "Leaf"
microswitches. The size of these switches and their terminals varies, so
it is best to have them in hand before cutting the microswitch grooves
in the wood block. Since the hinges on the Radio Shack switches (and
probably most others) are a bit weak, they were strengthened with a
matchhead-size dab of silicone sealant.
The cable for each unit requires six conductors. We used two runs
of 4-conductor telephone cable with stranded wires, but you could use
any small, flexible 6-conductor cable.
The plug for the homebuilt Atari joystick is a DE9S socket from
Jameco Electronics; it is a first cousin to the RS232 socket used on
70 The Computer Controller Cookbook
many peripherals. The hand-wired version of this socket requires a
separate plastic hood. The two plastic tabs on the hood stick out too far
and must be filed down. The two clamping screws included with the
hood aren't needed for this project.
Distinguishing plugs from sockets on computer equipment can
be confusing. A connector is a plug if the small metal parts that
conduct the electricity are metal prongs. It is a socket if these small
parts are receivers for the prongs (note the letter "S" for socket in
DE9S). Either type of connector may be mounted on a cable or in the
electrical device itself. Be careful not to order the wrong type.
ELECTRICAL WIRING
Figure 5-4 is the electrical schematic for any Atari-type joystick. Each
of the five microswitches is wired as a normally-open, momentary-
contact switch. All of their common terminals (a small "c" will
identify them) are connected together and wired to pin 8. Each switch
has its own wire on the normally open (n.o.) terminal.
To install the switches, solder two 3-inch pigtails of insulated
wire to each switch. Telephone cable wire is excellent for this purpose.
Use one color of wire for all the common terminals and five different
colors for the normally open terminals. Poke the wire through the
holes. Position the switches with their hinges toward the center on the
disk unit and down on the hand grip unit. The switches on the hand
grip unit should just touch the rubber hose in its central position.
The switches were wedged into place in the grooves with flat
slivers of wood from a popsicle stick and fixed in place with silicone
sealant. Apply only a small amount of sealant and let it set for a few
hours. (If necessary, you can add more when you have completely
checked out the joystick.)
Now turn the block over. Trim the wires short, but leave enough
length to make the solder joints. Bring the main cable into the cavity
and strip and tin all wires. Group all the common wires together, twist
them, and solder the joint. Solder each of the five other 2-wire joints,
wrap each joint with a small piece of electrical tape, and press them all
into the cavity.
Strip and tin all the wires on the socket end of the cable. Pass the
cable through the hood and solder each terminal. It is easier to solder
the socket if you clamp it upright in front of you in a small vise.
Homebuilt Atari Joysticks 71
TEST RUN
Turn off your Atari. Plug in your new joystick and turn the system on
again. If it doesn't start up in the normal way, turn it off immediately
and recheck your work. Then run your favorite game to tryout the
unit. If you get crazy responses, you have probably wired some of the
switches to the wrong connector pins.
FINISHING UP
When the switches work correctly you can put the finishing touches on
the new joystick. The hand grip unit could probably use more silicone
sealant on the switches and on the main cable where it comes out of the
block. In addition, you can fill the bottom cavity with sealant, cover it
with a piece of plastic, and clamp or weight it to a flat surface. After the
sealant has set overnight, peel off the plastic, trim any excess sealant,
and glue cotton felt to the bottom with contact cement.
The tipping disk unit deserves some personalizing touches. First
secure the switches, main cable, and cavity as above. Then try out
different combinations of thickness of the foam cross and height of the
tipping post and shape of its top until you get a response you like.
You can even do without the post altogether, or you can eliminate the
foam by gluing the disk to the post with silicone sealant. Use whatever
combination feels good and improves your speed. When you get the
combination you like, glue the foam to the block and the tipping disk
with contact cement.
,I
,- - -DE9S BACK
SOCKET
VIE.W
--t-05 -,
RIGH T I
4 ! COMMON
L, LEF T I 8
3 I
,J
DOWN
I
2
7o-r
TRIGGER
UP 6
I
"/
- - - ----------"
-
"*-t-
----t-t> <1--'-
-+-l> <:r--L
---+-i:>
<J.--!-
--L.t> 10 IGC/
GNDI I
R4 __
-.,68K R 1 -IK
/6 -PIN HEADER
TOP VIEW
DOWN MICROSWITCH
APPLE
JOYSTIC K
TRIGGER FIG. 5-5
Homebuilt Atari Joysticks 73
SUMMING UP
You can build joysticks for the Atari in a home or school workshop.
The materials will cost you less than the purchase of a commercial
joystick, and the great advantage is that you can personalize your
joystick for the exact feel and action you want.
74 The Computer Controller Cookbook
Parts List
Homebuilt Atari Joysticks
Approximate
Cost $15.00
r
/1 x
--"\ \
"-.. I
'--.Y
/" "'" //
,- /
_/
/
-
-
- !.r-
"-
l[l '-
-: I:::" ::::,....--
6 Race Car
Steering Wheel
There are several auto racing programs on the market, but playing
them with a standard joystick or paddle doesn't give you the sensation
of driving a real machine over a race course. In this chapter we will
build a steering wheel that closely simulates the controls of an
automobile. This analog input device has a single potentiometer that
76 The Computer Controller Cookbook
is turned by the steering wheel and a push button that serves as the
accelerator or horn. A special plug/socket lets two of these units
operate at the same time, thus opening up the possibility of two-
person competitive racing programs. With this controller and
appropriate software, game players can learn valuable driving skills
like recovery from skids and automatic reactions to traffic hazards.
This steering wheel puts you in the driver's seat.
The steering wheel prototypes were tested on an Apple II Plus
computer using the International Grand Prix program (Riverbank
Software, Inc., P.O. Box 128, Denton, Maryland 21629). The unit will
work on any program that uses one paddle and one pushbutton. The
design can easily be adapted for other computers by duplicating the
pot value, wiring, and connector of the standard paddle for that
machine.
This controller is similar to the airplane steering wheel described
in chapter 2, but its design is even simpler. In fact, this is one of the
most straightforward projects in the series: the parts are easy to find,
construction is mostly woodworking, and the wiring requires
minimal familiarity with electronics. Take some care with this project
and you will be proud of the result.
CONSTRUCTION OF THE
WH.EEL SUPPORT
Figure 6-1 is a sketch of the finished unit. A detailed side view is given
in Figure 6-2. The key parts are the leg board, the lower and upper
supports, the pot mount, the three stops, and the wheel itself with hub
and switches.
Figure 6-3 gives you details of the construction. The pot is shown
mounted on the upper support so that you can see which electrical
terminals are used and the location of the cables. A detailed cross-
section of a microswitch mount is also shown. The two microswitches
are wired as a single pushbutton.
Most of the parts are l/2-inch plywood. Scraps of birch plywood
were used for the wheels of the prototypes, but common fir plywood
would look almost as good. The plywood was too thick to make a
comfortable leg board, so lI8-inch tempered masonite was
substituted. The wheel hub was cut from a scrap of hardwood (oak or
Race Car Steering Wheel 77
RACE CAR
STEERING
WHEEL
SKETCH
FIG. 6-1
maple is preferred) since hardwood will drill and tap better than
softwood. Mount the pot on a scrap of sheet metal that is stiff but that
can be cut with sheet metal shears.
RACE CAR
STEERING
UPPER WHEEL
SUPPORT
SIDE VIEW
FIG. 6-2
LEG
CABLE ..-------::::: BOARD
;:::---
FELT
1Q.2 -
0 PLASTIC
WASHERS
rI' ... 1-
2-REQ
WHEEL
BACK VIEW
DETAILS
FIG. 6-3
STOP
MOUNT
o C
UPPER SUPPOR
T
16
-- - 1I- - = = -
LEG BOARD
9 I
'-'I -<;t,
o @
SUPP
2-REQ.
'(
':.
I
I
@
o 0
80 The Computer Controller Cookbook
Cut the two lower supports from two 3 x 9-inch pieces of 1/2-inch
fir plywood. This will produce a medium-size steering wheel. If the
unit will be used primarily by adults, you may want to add two to four
inches to the length of the supports. The extra length is especially
desirable if you use the wheel while holding a small child in your lap.
Children like to play with this controller even when they are too young
to understand what the program is all about. A pair of wheels, one
with the longer supports, works well for parentichild games.
The holes in the supports are merely for decoration. The large one
was cut with a hole saw in a drill and the small one with a I-inch
paddle bit. Center the two lower support pieces one-half inch apart on
the leg board and attach them with four I-inch x #B flathead wood
screws and carpenter's glue.
The upper support is fashioned from three plywood pieces and
the sheet metal plate on which the pot is mounted. Put the two larger
pieces together with two wood screws and glue. Cut out the sheet metal
plate, then drill, counter-sink, and fit it to the pot mount. Hold the
metal with vise grip pliers while drilling, or the sheet will spin and cut
your fingers. Size the central hole (usually 3/B-inch) to fit the pot. The
small hole is for the spin prevention tab on the pot. The four corner
holes are for 1/2-inch x #6 flathead screws. Don't install the small stop
mounting block until you complete and trial fit the wheel.
CONSTRUCTION OF
THE WHEEL
The wheel itself can be any size that suits your needs. The 10 and 1/4-
inch diameter of the prototypes was determined by the size of the
material on hand. For wheels much larger than this the size of the
upper support will have to be increased. Draw the wheel on plywood
with a compass and straight edge and cut it out with a saber saw or
copmg saw.
The hardwood disk for the hub was cut out with a power drill
hole saw. Drill and tap the two holes before attaching the hub to the
wheel. No lubrication is used for tapping in wood, but you should
remove and clean the tap several times during the process. Attach the
hub to the wheel with carpenter's glue and clamp it with a 1/4-inch
bolt and flat washers through the center hole until the glue dries.
Race Car Steering Wheel 81
ELECTRICAL WIRING
For the electrical work you will need a pencil soldering iron of from 25
to 42 watts with a fine point, a damp sponge for cleaning the tip of the
iron, wire strippers, a pair of small long-nose pliers, and small-
diameter resin-core solder. Even if you are a beginner you shouldn't
have much trouble with the electronic work involved in this project.
Use the proper tools and be careful with the soldering.
Make two photocopies of the schematic (figure 6-4). On the first
copy, color in each wire and solder joint as soon as you complete it.
When you finish your work, color in the second copy while checking
each connection.
Buy long-shafted pots of good mechanical construction. They
should have a screw driver slot on the end; otherwise you will have to
cut the slot with a hacksaw. Figure 6-3, the back view of the upper
support, shows the terminals to which you will be soldering the cable
WIres.
PIN
I +5
6 GC
PB
PO T RI 8 G NO.
IK GAME
156JK CON T RO L
PLU G
RACE CAR
STEERING WHEEL
SCHEMATIC
FIG.6-4
Race Car Steering Wheel 83
plugged into the back of the first race car wheel and the second unit
will function as GCI and PBl. You will be able to use two steering
wheels for competitive racing games as soon as someone out there
writes the software.
The plug/socket is a standard wire-wrap socket on which all pins
except 6, 3, and 10 are cut to lI2-inch. Cut pin 6 to about 5lB-inch and
cut pins 3 and 10 to liB-inch. Then bend out the pins slightly and
straighten them to fit over the spades of a 16-pin DIP header. Plug the
header into a loose socket before soldering and double check to be
certain that both # I pins are on the same end. Pin 6 must be bent across
to reach spade lOon the header and pin 2 bent to reach spade 3. Install
the pull-down resistor RI between the socket pins. The cable usually
enters from the pin B end. If you have difficulty inserting a plug into
the socket after the soldering, stick a sewing needle into each hole in
turn to realign the socket parts.
If you decide to make a second steering wheel you will want to use
a standard plug/socket on it so that foot pedals can be used with the
wheels. Foot pedal controllers are discussed in chapter B.
FINAL ADJUSTMENTS
Now mount the single stop on the upper support. For all three stops
you can use small rubber feet or faucet washers held on with panhead
screws. Reinstall the wheel with the washers on the pot shaft, leaving
the set screws loose. The best set screws are the Allen type, but those
with standard screwdriver slots will work.
At this point install the main cable and plug but leave the cable
that runs to the switches disconnected. Check your work visually
against the schematic (figure 6-4). If you have a multimeter, check the
resistance between pin I and pin B. This must measure at least 50 ohms
on any controller and should be completely open (infinite) on this
unit.
Turn off your computer, plug in the new controller, and turn the
computer back on. If start up is not completely normal, turn it off
immediately and recheck all your work on the steering wheel. When
the system starts up properly, run the Controller Checkout program
from chapter 15.
You need to see the readings of GCO and PBOcontinuously so that
you can adjust your unit for full scale and zero. Try turning the wheel
Race Car Steering Wheel 85
left and right to determine if you can get readings over the full range
from 0 to 255. Center the wheel and adjust the pot shaft inside the
wheel with a screwdriver until you obtain a reading of 128. Then press
the wheel firmly onto the shaft and tighten the set screws.
Turn the wheel gently clockwise until you feel the internal stop.
Back off until the reading just becomes 255 and place the second stop
on the wheel snugly beside the first stop, which is mounted on the
upper support. Mark the center of the second stop with a sharp point.
Follow the same procedure counter-clockwise for 0 and mark the third
stop. Turn off the computer and unplug the steering wheel. Remove
the wheel from the pot shaft and install the two stops on it.
The wheel can now be reinstalled and centered on 128. The
readings should cover the full range from 0 to 255, but when you turn
the wheel you should hit the external stops before you reach the weaker
stops inside the pot.
Install the pushbutton cable by first attaching it to the upper
support. Then experiment with various lengths of cable while turning
the wheel. This cable should make a single loop behind the wheel to
keep it out of your way while you are playing. When you have
determined the correct length and direction for the cable, install a tape
flag and screw it onto the wheel near the hole for the switch wire.
As noted in figure 6-4, both switches are wired in parallel so that
each of them can function as PBO. This lets you use either hand to press
the pushbutton. The cable wires are attached to the common and
normally open terminals. You can secure the pair of wires between the
two switches to the back of the wheel with silicone sealant.
FINISHING TOUCHES
You may want to cover exposed electrical connections with silicone
sealant (clear sealant is the least messy to work with). You can cover the
bottom of the leg board with cotton felt, gluing it on with contact
cement. A decal or paper cutout glued to the center of the wheel looks
sporty. Be sure to draw a number on the sides of the lower support with
a felt tip marker. We used 0 for the first wheel and 1 for the second.
Numbering the units will help you keep track of which is which when
you playa game, and besides, all racing machines have a number. Test
your unit one more time with the Controller Checkout program and
then run your favorite racing game.
86 The Computer Controller Cookbook
Parts List
Race Car Steering Wheel
Approximate
Cost $16.00
1000000001
.., 000000001
7 Super Stick
Commercial analog joysticks for the Apple and other home computers
are powerful tools for directing a cursor and playing games, but for the
most part they are flimsy units. They don't give the player the
sensation of handling actual machine controls. Super Stick, by
contrast, is a much larger device, about the size of the control stick for a
high-performance aircraft. Super Stick is not quite as fast in response
as the lightweight commercial units, but it has the robust feel of a
controller for a real machine.
88 The Computer Controller Cookbook
CONSTRUCTION OF THE
MACHINED SUPER STICK
Figure 7-1 is a sketch of the machined version. The hardwood handle
contains two pushbuttons and is supported by a double-articulated
wrist that serves as the mount for the two potentiometers. The upper
structure is supported by a machined base and a sheet metal saddle that
straps to the leg.
Figure 7-2, in front and side views, gives many more details of the
completed device. It shows the location of the pots and pushbuttons, as
well as details of the pot wiring.
Figure 7-3 provides details of the component parts. The handle
grip is fashioned from two pieces of 6 x 1-1/4-inch hardwood. Walnut
is particularly attractive, but true mahogany also makes a striking
handle. Alternatively, you could use clear pine and paint the handle jet
black, to get a high-tech look.
Cut out the wood blanks with a radial arm or table saw and then
contour them into shape with wood rasps and sandpaper. Counter-
sink three flathead screws (1/2-inch x #4) into the wood to hold the two
halves of the grip together. Then drill the holes for the bolts (1/2-inch
x #2) to mount the pushbuttons and the shaft clamp for the top
potentiometer.
The machining attachment for a small metal lathe was used to
work the aluminum for the top clamp, wrist, and two base uprights.
You can use any material that can be machined, including aluminum,
brass, steel, or plastic. By starting with stock a little thicker than 1/2-
Super Stick 89
SUPER
STICK
tI SKETCH
I
I
I
FIG. 7- /
inch, we were able to take a slight amount off all the surfaces, thus
leaving them with a decorative pattern of machining marks.
First rough out the pieces with a band saw and machine them to
slightly larger than finished dimensions. Then drill all the holes and
PSI
PBf9
SUPER
STICK
FIG 7-2
SIDE
VIEW
BACK
VIEW
flI
'! 0
7-:1.!-) -
INSIDE FRONT VIEW
V)
..... l4J
..... ::t: ,
I
I
0.'" \
,
J
I
I '0
I
I
C\l
Lf'i ,
I
\.0
,
I
C\j
0
LEFT RIGHT
HALF HALF
HARDWOOD
it
HANDLE
SUPER STICK
DETAILS
I I'
FIG. 7 - 3
p'lT
I
bW. Cl
'
BUSHING
f-- I -t co I
.1",
0 ....
-ROD'
1 0 '.
:': I,'
'
DRILL"
WRIST
BASE UPRIGHT
LEG MOUNT
-----S-H-EE--=-T-M-E-::-:r.=-A-L 8 . 5 1 - - - - - - - - - - - ' 4
I
o 0 U1
h
l\1
<p
@ <D
C\l
92 The Computer Controller Cookbook
tap the threads that are shown in figure 7-3. Choose the tap size that is
appropriate for available bolts and set screws. Caphead screws set in
counter-sunk holes are best for the top clamp and wrist, while panhead
bolts are best for the leg mount and base.
When you complete the rough work, go back over all surfaces
with a small milling tool on a final shallow pass. This will bring the
pieces down to exact dimensions and leave the characteristic
markings. On the prototype, all edges were beveled off with a power-
belt bench sander. You could also use a fine file for this step.
The brass bushings were cut from l/4-inch (internal diameter)
hobby shop tubing, but commercial brass bushings with thicker walls
would be easier to machine. You could even machine these bushings
from brass stock on a lathe. The bushings should not spin, so
remember to secure them in place with thread sealant.
Since you may have difficulty obtaining the thicker block needed
for the one-piece wrist, figure 7-4 shows an alternate construction of
the wrist using three pieces of l/2-inch stock. To insure that the top
clamp piece will move easily between the two uprights, two pieces of
shim stock are required for construction.
The pots will be needed during machining to measure the exact
size of their mounting bushings and shafts. Different manufacturers
vary the sizes slightly. If you do not have the pot when you do the
machining, leave 3/16-inch pilot holes for the time being. Trim the
pot shafts to the correct length and saw screwdriver slots in their ends.
The leg mount for the prototype was cut from l/16-inch
aluminum sheet and then drilled, using the base as the pattern. Pass
panhead screws up through the leg mount and base and screw them
into the two base uprights. The leg mount was finished with an orbital
sander to remove all tool marks and give a matte finish. You could use
a small cup wire brush in a drill press to obtain the swirled finish
found on the cowling of the Spirit of St. Louis.
When assembling the pot mounts, don't overtighten the set
screws and clamps, since this can crush the pots and make them hard to
turn. Put some sealant like Loctite on the bolt threads to insure that
they don't loosen.
The wood handle requires fine sanding, staining, and finishing
with two coats of polyurethane varnish. After you attach the leg mount
to the base and uprights, bend it to fit your leg. Cover the inside of the
leg mount with cotton felt. Attach a cloth or leather strap to the leg
mount with swat rivets from a leather supply store. Sew a piece of
Velcro to the free end of the strap and glue the Velcro mate to the leg
mount with epoxy.
DRILL 00'-
"
---'"
TO FI T--> o
POT
Pt;JE> 0
h3ri . . --- - --- --
1'5-----<>j Ji .':-.:-:-: r-r-'
DRILL&. TAP
4PLACES
1--.5-1
D
BRASS BUSHING
THREE PIECE
100--/.5 WRIST
I e
SHIM STOCK
$ Ii FIG. 7-4
FRONT
VIEW
LDRILL & TA P
2 PLACES
SHEET METAL
VERSION
FIG. 7-5
S CRI B E ME TAL
C 1 1
4 PLACES
_I
f.:J1
0 0 _ 0 .L 2 .5
1-£25-1'--
e I f1
r
8-
'\T
L i
;,il
o : h_n_
"J:qT I 0 0
I I 1;1-0 I cu t
o 0 -.J -LL J, POT
I MOUNT
BASE
2 REQ. TOP CLAMP
2 REQ.
16
LEG BOARD
\.
... BASE
1
UPRIGHT
2 REa.
II
II
0"
.,--,-'-,-\
.
""
---I.L..----l
94 The Computer Controller Cookbook
CONSTRUCTION OF THE
SHEET METAL VERSION
Since not everyone has access to a machine shop, we decided to include
a home workshop version of the Super Stick that can be constructed
from sheet metal and wood. No unusual tools are necessary for the
project. The result, shown in figure 7-5, is a solid, attractive device
with good, fast action.
The construction of the sheet metal Super Stick is similar to that
of the Sketch Pad (see chapter 4). For the metal work, only a drill, sheet
metal shears, file, and pop rivet gun are necessary. Either hand or
power saws can be used for the wood work.
The metal should be stiff, but thin enough to cut with hand
shears; aluminum or galvanized steel will do nicely. Cut out the six
metal pieces, then round and smooth all edges with a file. Make the
two cuts for the pot mount with a hacksaw.
Hold the metal pieces with vise grips or in a bench vise while
drilling them. To start each hole, strike a point with a center punch,
then drill a pilot hole of about 1/8-inch. Don't drill the pop rivet holes
in the pot mount until you are ready to install the rivets. The two holes
in the pot mount for the spin prevention tabs must be custom fitted to
the pots you choose.
You can make the bends in the sheet metal with a sheetmetal
brake, a vise, or vise grip pliers. Only one of the top clamps needs to
have the large side tabs shown in figure 7-5. The only bends that are
difficult to form are those for the pot shaft clamps in the base and for
the top clamp. Pop rivet the pieces together, then bend open the two
pieces and form the clamp around a lI4-inch bolt. Using washers on
the pop rivets keeps the sheet metal from bending in the wrong places.
The two sheet metal ends of the clamp should be about lI8-inch apart
with the shaft installed.
Don't worry if you fail in your first attempt to make the sheet
metal parts. Sheet metal is cheap, so discard the piece and start over.
Bend the pot mount in the direction shown in the front view (figure 7-
5). Clamp the predrilled brace in place with vise grips and drill the first
pop rivet hole. Install the rivet, then drill the holes and install the
other three rivets in turn.
Now cut off the pot shafts and saw screwdriver slots into their
ends. Apply Loctite to the pot mounting threads after you complete
the final adjustments.
Super Stick 95
The handle grips on the prototype were cut from hardwood scrap
with a radial arm saw and then shaped with wood rasps and
sandpaper. The bottom of the handle at the lower end where the top
clamp is attached is a little different than that of the machined version.
The notch on the sheet metal unit cuts both pieces, but the top clamp is
screwed to only one piece of the handle. You can make the inside wire
groove and switch cutouts with a saw or wood chisels.
The leg board and spacer are cut from tempered masonite. You
can make the base upright from any available wood or plywood. The
base should be held together with screws and glue, but the handle is
held together with counter-sunk screws only, since you have to open it
up again to wire the switches. Sand all wood parts and finish them
with two coats of polyurethane varnish.
ELECTRICAL WIRING
The wiring for this project is not difficult since Super Stick is simply a
two-pot joystick with one or two pushbuttons. The pots should be
mechanically superior and long shafted. You will have to cut the
shafts to length and add screwdriver slots, as noted previously. The
pots in these units do not travel through their full 300 degree turn. You
can use pots with values larger than standard for your computer, or
you can work with easier-to-obtain pots with values of WOK and add
correction caps as described in chapter 1. (The standard pot value for
the Apple is 150K; for this prototype we used 250K pots.) You can
mount the correction caps on a small piece of PCB in the cable about a
foot from' the plug and encase them in foam packing material.
For pushbuttons you can purchase any normally-open,
momentary-contact switches that can be mounted easily on the
handle. We used subminiature lever switches mounted with #2 nuts
and bolts. The switches and bolts came from Radio Shack.
If you choose to install only one switch you will need only four
wires in the cable. The telephone cable noted in the parts list is
adequate. For two switches a 5-wire cable is necessary, and this is
harder to find. You can substitute two runs of the 4-wire telephone
cable, which gives you extra wires to double up the +5 and ground if
you use correction caps.
The best plug for Super Stick is the plug/socket described in
chapter 3. The pull-down resistors RI and R2 (figure 7-6) can be
PBQ
,.,
,- _':'...1 I
, __ I
,
L - - -- -!C
N.O.
r- - T SUPER STICK
PBI I 0...:...'----.
1--
I N.O.
""-1 !
SCHEMATIC
1...--,---1'-'
_IC.
1- -
FIG. 7-6
POT
25fY K
PO T
I PIN
25(9 K +5
2 PB
3 PB I
6 GC (S)
Gel
8 GND.
GAME I/O
RI R2 CONN EC TOR
IK IK
Super Stick 97
mounted inside the plug. If you look carefully at the pots in figure 7-2
you can see which outside terminal is connected to the center terminal
with a loop of wire, as indicated in the schematic (figure 7-6).
FINISHING UP
You can lock all the clamp bolts with Loctite or nail polish. The
cables should be securely tied to the pot terminals with dental floss;
coat the terminals with silicone sealant. A dab of sealant on the
pushbutton hinges will help to strengthen them. Secure the cable to
the base with a plastic wire tie.
The leg mount and strap cannot easily be adjusted down to fit a
child's leg. If you prefer, you can mount the machined Super Stick on a
leg board like the one the sheet metal version is mounted on.
98 The Computer Controller Cookbook
Parts List
Super Stick
Approximate
Cost $20.00
FOOT PEDALS
SKETCH
FIG.B-/
CONSTRUCTION
This is the easiest project to build in the entire book. It is a good
exercise for the home or school woodshop, and the materials are
inexpensive and readily obtainable. All the wood parts are l/2-inch fir
plywood except the heel rest, which is hardwood scrap. You can
complete this project using only hand tools, but a table or radial arm
saw will speed your work.
Figure 8-2 shows side and back views of a completed foot pedal.
The left and right units are identical, so remember to make enough
parts for two units. Figure 8-3 gives you details of the separate parts
and a top view of both the base and the foot rest.
The eight pivot supports (figure 8-3) require careful attention.
Two are simple pieces of plywood with l/4-inch holes and a
thumbtack at one end. The holes in two more supports are lined with
brass bushings (l/4-inch ID). Another two supports have a l/4-inch
hole for the pot shaft and a drilled and tapped hole for a set screw. The
last two supports are drilled out for the pot mounting bushing
(usually 3/8-inch), tapped for a set screw, and notched for the spin
prevention tab on the pot.
102 The Computer Controller Cookbook
SET DOWN
SCREWS STOP
BASE
FEL T
FOOT PEDAL
S IDE AND
BACK VIEWS
FIG. 8-2
PO T
SWITCH
After cutting out the plywood and hardwood pieces, round the
corners and edges with a rasp or saber saw and sand all parts smooth. A
Screw Mate drill bit is ideal for drilling the screw holes. Assemble the
bases with l-inch x #8 flathead screws and carpenter's glue. Then
assemble the pots, upper pivot supports, and bolts. Attach the foot
board to the upper pivot supports with the same size screws. Now take
the entire unit apart and finish all wood parts with a bright-colored
oil-based enamel.
If you are installing the switch feature that lets the foot pedal act
as one pushbutton for the International Grand Prix program, you will
need a small sheet metal switch mount (see figure 8-2). Using hand
shears, cut this out of galvanized steel, aluminum, or brass. Drill the
top two holes in the metal to suit the switch and the bottom two for
l/2-inch x #6 panhead screws. For the prototypes we used a submini
lever switch. The switch and the small mounting nuts and bolts were
purchased at Radio Shack. Hold the sheet metal with vise grip pliers or
in a bench vise while drilling so that it won't spin and cut your fingers.
•
TOP VIEWS
FO
1 1·---.
I
:0'
I
,-- -:
I I
I I
I I I ::;: I
I I 1'1'1 I
---r
l()
....L...l--------------I-
4----;1
TACK
a 8.-REGINALL
4- REQ. DOWN STOP
3--
,:.
I'
TO POTS .r-.25!D,
2.-SETSCREW r :
2 -BUSHING 0 LJ
2 - THUMB TACK 1-'.51
BRASS
POT BUSHING
WIRING 2-REQ
SWITCR
MOUNT "
2-REQ ::"
FOOT PEDAL
DETAILS
FIG. 8-3
104 The Computer Controller Cookbook
It is best to make the mount a little short, then move it up into position
by shimming under it with thin cardboard, wood, metal, or plastic.
The thumbtack shown in figure 8-2 should throw the switch when
your foot is in a comfortable position, in the middle of the pedal's
range of movement.
The l/4-inch bolts that form half the turning axis must have flat
washers where the bolthead and nut touch the wood, and a plastic
washer between the two wood parts. After final assembly, lock the nut
by applying Loctite, Super Glue, or fingernail polish to the threads.
ELECTRICAL WIRING
The foot pedal prototypes were wired for two separate game control
arrangements. One arrangement has two foot pedals, each with one
pot and no push button. The second arrangement has a single
pushbutton on one foot pedal and was designed especially for playing
International Grand Prix.
Figure 8-4 is the schematic for the two-pedal version. The pots
have short shafts (7/8-inch) and are mechanically rugged. They do not
turn through a full 300 degrees, so their maximum values must be
PIN
I +5
6 GC(9
POT 1(9 Gel
& 8 GND.
100 GAME [\0
K CONNECTOR
C/ C2
.t t ot: .i tur:
POT TWO POT
/
100 SCHEMATIC
K
FIG. B-4
Foot Pedals 105
PIN
r - - - - - - - - - - -..... , f 5
r - - - - - - -.....- -..2 PBl9
\:- --;;N.a RI
IK
8
GAME [\0
GND
CONNECTOR
L __ ...J.
C.
ONE-SWITCH
SCHEMATIC
FIG. 8-5
la.J
Q "'""'-'IT--n- .....-,t-lr--..--'
la.J
a::
«
DIP
SIMPLE SOCKET/PLUG
FIG.8-6
about four times the normal paddle pot values. If you use lower value
pots, correction capacitors Cl and C2 will be needed. For the
prototypes, lOOK pots and correction caps were used. These caps were
placed on a small piece of printed circuit board and encased in a foam
block at the place where the cables from the two pedals come together
(see figure 8-1). If you use correction caps you will have to run the
106 The Computer Controller Cookbook
FINISHING UP
You don't want the foot pedals to slide under your feet, so the bottoms
should be covered with something that grips the floor. If you will be
placing them on wood or linoleum, cut and fit some pieces from an old
inner tube on them. Cotton felt will grip a rug; for thicker carpets try
incising shallow saw cuts across the width of the bottom. Extra weight
helps, so you can add extra thicknesses of plywood to the baseboard or
simply make the baseboard out of 3/4-inch stock.
Perhaps you want the units to spring back to the open position
when there's no pressure on them. You could do this by attaching
rubber bands from the heel rest to the middle of the base, or by placing
a urethane foam block under the middle of the footrest. There are
probably many other different ways to spring-load these foot pedals.
Use your imagination and experience to come up with a solution that
suits your needs.
Foot Pedals 107
Parts List
Foot Pedals
Approximate
Cost $19.00
CHARACTERISTICS OF
APPLE AND ATARI
JOYSTICKS
The Apple joystick and the Atari joystick are two completely different
devices. The Apple joystick has two lever-controlled pots and a
pushbutton, while the Atari joystick is a collection of five
Converters: Between Apple and Atari III
CONSTRUCTION
Each circuit is made up from one-third of a' printed circuit board
(Radio Shack #276-154). You can mount the board in a small plastic
box like a cassette tape holder or inside a block of flexible packing
foam. To cut the circuit board, score it deeply with an X-acto knife and
break it over the edge of a table. Drill the holes for the wire ties with the
end of the knife and file all the circuit board edges smooth. Mounted
on the board are several resistors and capacitors and sockets for the
chips. Both boards draw the small amount of power they need from the
host computer.
Most of the connectors for both converters are mounted on short
pieces of cable. The Apple-to-Atari converter does have one socket for
the Apple joystick; this socket is mounted directly on the board rather
than on a cable.
112 The Computer Controller Cookbook
APPLE
PLUG
A TAR! +5
R7 APPLE
68 K GAME
PLUG
8
Gel
RI2
lOOK
2
1/4
4066
L-- G NO.
A TAR! TO APPLE
SIMPLIFIED SCHEMATIC
FIG. 9-2
brought high (+5 to +15 volts), then one of the relays closes and
conducts electricity. If the control line is low (0 volts), then the relay is
open and does not conduct.
The Atari joystick has two internal normally-open switches that
correspond to the directions up and down. For the Apple to read these
two switch closures they must be converted to pot readings between 0
and 150K.
Depending on the position of the Atari joystick, the game control
circuit may read 68K (R7), 0, or 168K (R7 + RI2). These resistive values
are read as 128, 0, and 255 by the Apple, and the program interprets
them as center, up, and down.
With the handle in the center position, R7 is in the circuit but R12
is bypassed by one section of the 4066, so the reading is 128. If the
handle is pushed up, the switch in the joystick bypasses R7 and the
reading is O. If the handle is pushed down, the section of the 4066 opens
and the reading is 255.
The inverter in the 74LS04 and the pull-down resistor R3 make
the section of the 4066 operate the opposite of the down switch in the
joystick: when the down switch is open the 4066 section is closed and
VICe versa.
-
r---
RlL-...:.I-4vf-- ...J
0- I R;4/K
R-/ IK
.. " .
R-5IK vv
v v
/K
/K
L I L..- "
[C-I 74LS04
TOP VIEW
I
,- - - - - - - - - 1
I -;-' __
,I
I
I A
R-/I 10eK I
.....
-J
o [C-2 4066
::>
l()
-+-
+11
Converters: Between Apple and Atari 115
This circuit is repeated for the left and right switches. Since there
are four switches in the 4066 chip and six inverters in the 47LS04 chip,
you can control two joysticks with just these two chips simply by
adding a few more resistors and a second connector.
THE ATARI-TO-APPLE
CONVERTER: WIRING
Figure 9-3 is the complete schematic of the Atari-to-Apple converter.
Once again, follow the procedures outlined in chapter 14 for checking
your wiring by coloring in two copies of the schematic. The Apple
plug is a 16-pin DIP header and is shown as it appears from the top.
The Atari connectors are shown from the back as they will appear
when you solder them.
A word of caution: the 4066 is a CMOS chip and these are easily
damaged by static electricity. Leave the 4066 in its protective package
until you have completed the circuit and thoroughly checked it out. It
is imperative that you use a socket on the board for this chip.
We used #24 solid wire from a scrap of telephone cable for
jumpers on the board. Ribbon cable was used for the cables to the
connectors. The cable for the Apple plug requires eight conductors,
but we doubled up the +5 supply and ground, so ten conductors were
installed. Two 6-wire runs of cable were used for the Atari sockets.
Double check your work before applying power to the circuit.
Color in the second copy of the schematic, using an ohms meter to
trace the wires. When everything checks out, plug the two chips into
their sockets on the board, making sure the #1 pins are in the correct
places, and install the plastic hoods on the Atari connectors. The
hoods have small plastic tabs that may have to be filed down. They also
come with mounting bolts, which aren't needed for this project.
To test the converter, tum off your computer, plug in the new
unit (without a joystick attached to it), and turn the computer back on.
If the computer does not start up exactly as usual, turn it off
immediately and recheck all your work. When the circuit checks out,
tum off your computer, plug in an Atari joystick, and turn on the
computer again. Now run the Controller Checkout program from the
software section and check out the game paddle reading of your new
adapter and joystick combination.
116 The Computer Controller Cookbook
THE APPLE-TO-ATARI
CONVERTER
Figure 9-4 is a sketch of the Apple-to-Atari converter. If an Apple-style
joystick or set of paddles is plugged into the empty socket on this board
and the Atari socket is plugged into an Atari game port, the Apple
joystick will perform like an Atari joystick.
The mechanical construction of this converter is quite similar to
the one just described. It is built on one-third of a general-purpose
circuit board and has one chip, twelve components, a cable and socket
to connect to the Atari, and a simple DIP socket for the Apple joystick.
Figure 9-5, the simplified schematic, shows that this converter
works on completely different principles than the first one. The pot in
the Apple joystick is used in a resistive bridge with RI so that the
voltage on pin I varies with the pot setting. Capacitor C3 reduces
electrical noise.
The LM339 chip contains four voltage comparators, each with
two inputs and one output. They compare the voltage on one of their
inputs with a reference voltage on the other input. They produce a
digital output to indicate whether or not the input voltage is greater
than the reference. The pull-up resistors R4 and R5 make the outputs
look like the switch closures of a standard Atari joystick.
The diodes D 1 and D2, along with resistor R3, provide two
reference voltages (0.7 volts and 1.4 volts) for the comparators. Here we
are using a property of a real diode, its forward conductance voltage
drop, which a theoretically ideal diode would not have. If we passed a
small current through an ideal diode there would be no voltage drop.
If we pass a current through a real silicon diode, however, there is a
drop of about 0.7 volts, and this drop changes very little with
fluctuations in temperature and current.
Two comparators in the LM339 compare the voltage from pot 1
with our two reference voltages and put out the correct digital signals
for the joystick position: left, right, or center. A similar circuit checks
pot 0 for the signals for up, down, or center.
You will have to adjust the circuit to use this converter with
joysticks that have correction caps. The resistive bridge circuit
measures resistance only, so if the pot is not 150K, resistors RI and R2
will have to be changed. The correct value is about one and a half times
the value of the joystick pot.
SKETCH - APPLE TO ATAR!
FIG 9 -4 CONVERTER
A TARI
SOCKET
r-------.----......----.---< 7 t 5
R5
1/2 IK
APPLE
JOYSTICK
3 L EFT
2/4
r-lr-'7".. C3 LM339
.f;;/LJf
>---""--<4 RIGH7
8 G NO
6
APPLE TO ATAR!
SIMPLIFIED SCHEMATIC
FIG, 9 - 5
+5 115 R5 116
R2 RI , R3 1/<' ii<.; IK
220K K '> 1K DE 9 S
'> ATARI
LM339 SOCKET
.......- - - - - - - - , ,-__ BACK VIEW
C
r -"I :'
4.5u f I I I I I
C2
.&Iuf C3
.&/
. f
u
APPLE TO A TAR!
CONVERT ER
FIG. 9-6
Converters: Between Apple and Atari 119
FINISHING UP
As mentioned earlier, the circuit boards should be mounted in small
boxes to prevent the wires from shorting. You could use cassette tape
boxes, cutting out holes for the cables with a coping saw and small
files. Alternatively, you could encase the circuit in a foam block, as was
described for the Multiple Socket Extension (see chapter 3). Or you
could purchase a small electronics box, fit the circuit board into the
box before mounting the components, and drill and file out holes for
the cables. Depending on the box you use, you may have to cut the
PCB and arrange the components differently from those of the
prototype.
From the standpoint of their electronics, these two converters are
the most sophisticated projects in this book. A little care in their
construction, however, will give you an excellent lesson in electronics
and a device that will greatly increase your enjoyment of your other
controllers.
120 The Computer Controller Cookbook
Parts List
Atari to Apple Converter
Number Suggested Total
Required Description of Part Supplier Cost
I 74LS04 hex inverter chip Jameco s .30
I CD4066 quad bilateral switch chip Jameco .40
2 IC sockets. 14-pin, gold Jameco .90
I Header plug. 16-pin Jameco .70
2 DE9S sockets. 9-contact Jameco 2.80
2 DE-9H Dvsubminiature hoods jameco 2.40
I Capacitor. 4.7 microfarad. tantalum Jameco .45
4 Resistors. lOOK. 1/4 wall. 5% Jameco .30
4 Resistors. 68K. 1/4 wall. 5% Jameco .30
6 Resistors. I K. 1/4 wall. 5% Jameco .40
I Printed circuit board #276-154 R.S. 2.00
3 ft. Ribbon cable. 16-conductor, #171-16 Jameco 1.80
Mise. Box, silicone sealant Local 1.25
Approximate
Cost $15.00
Parts List
Apple to Atari Converter
Number Suggested Total
Required Description of Part Supplier Cost
I LM339 quad comparator Jameco s .70
I IC socket. 14-pin Jameco .40
I IC socket. 16-pin, gold Jameco .50
I DE9S socket. 9-contacl jameco 1.95
I DE-9H hood jameco 1.20
I Printed circuit board. #276-154 R.S. 2.00
2 IN914 diodes R.S. .20
I Capacitor. 4.7 microfarad. tantalum Jameco .45
2 Capacitor•. 01 microfarad. disc jameco .20
5 Resistors, I K. 1/4 wall, 5% R.S. .40
2 Resistors, 220K, 1/4 wall, 5% R.S. .20
2 ft. Telephone cable. #278-366 R.S. .30
Mise. Box, silicone sealant Local .50
Approximate
Cost $ 9.00
CONSTRUCTION
The sound pushbutton is encased in a small plastic box. The device
consists of a microphone element, a pot, and a circuit board with one
chip, three capacitors, one LED, and 14 resistors. It is connected to the
computer with a 3-wire cable and a simple plug/socket.
To begin, cut a piece of circuit board to fit inside the box. Cut the
board by scoring both sides deeply with an X-acto knife and breaking
it over the edge of a table. File off the corners of the board so that it
doesn't hit the screw posts in the box. Mount the board on ihe bottom
of the box with four small bolts. You will need spacers or extra nuts to
raise the board off the metal bottom of the box.
Next position the microphone on the center of one end of the
circuit board. Mount the element by looping wire over it and soldering
the wire to the board. Carefully determine where the microphone will
be located near the end of the plastic box and drill a 1/4-inch hole to let
sound inside to reach the element.
The sensitivity pot is mounted through the top of the box on the
end away from the microphone. You may have to add a 3/8-inch flat
washer to mount the pot on the thin plastic. Now drill a hole for the
cable in the end of the box just beneath the pot. Mount the LED on
long leads so that its base is about 1/4-inch above the circuit board.
Find the spot on the box just above the LED and drill a 3/16-inch hole
so that it can be seen. As a finishing touch, you might want to add
rubber feet to the bottom of the box so it will not scratch your desktop.
ELECTRONIC OPERATION
Figure 10-2 is an explanatory schematic which shows the appearance
of the sound signal at five points along the circuit path to the
computer. The key to this circuit is the LM3900 chip, a quad
Sound Pushbutton 123
SKETCH
SOU N 0 PUSHBU t ton
FIG./tY-1
"E L=-
/ I 2/ 3 I 4
an an
I 5/
MIC.
I IRI K _ I
/R4
5.1 K
jRI:
f(9j(
5
'--------------------4-----.....-------7>GND.
EXPLANATORY SCHEMATIC
SOUND PUSHBUTTON
FIG.
Sound Pushbutton 125
output range to amplify half the waveform so that weak signals will be
close to 0 volts and strong signals will be amplified to +5 volts.
The third stage of the circuit provides additional gain and filters
out the high frequency portion of the signal with capacitor C3. This
filtering makes the signal more like the steady pushing of a button and
eliminates bounce and electrical noise. The LED is also driven by this
stage.
The last stage compares the signal with half of the +5 volts
provided by the voltage divider (resistors Rl2 and RI3). The output of
this stage is then either 0 or +5 and is therefore a proper digital signal.
TESTING
When you have finished the wiring, examine your work closely for
solder bridges and shorted wires. Plug the LM3900 into the socket in
the board and check to make certain there is at least 50 ohms between
pin I and pin 8 of the plug. We got a reading of 1.3K when we tested the
prototype. Mount the circuit board on the bottom and close the box.
Turn off your computer. Plug the new sound pushbutton into the
game I/O connector and turn it on again. If the computer doesn't start
vv
R7 16)('Y K
SENSITIVITY
r-;: < R8
< RI5 Rs RI/ w RI2 ' RIG
< IK 16) K I('Y K < _ < 16) K 2('Y K < /6)"
< 0< 2' ""
0-- ..., ;);; .."
14 0 L-.., ---< 8 P IN
E r -- - - - - - - - _ .. - _ .. - _ .. - _ .. -, CI ' I
MICRO
C2 RI r- II I L....-.< IO.uf .-
3.9 K _ _ I + ,
1-
I " v v /' r I
f>- 4
C<d 3 I .-'
2 P 86J
.r- / ..a .. tAl I + ". I RI3
8 GND.
It>-' 2CYK -:;7AME 1\0
(2)1 I 2 I U1
- - 1-
PLUG
I ;);;
J
"-----;:..: ---- ---- ---'n- --"7-
L- .ll-_ _ >R 3 •
R2 ICY('lK
>R5 > R4
'>5,1 K 3.9K 5.1 K
'>
OTHER COMPUTERS
The output of the sound pushbutton is very close to a standard digital
signal and should be acceptable to any computer system that has at
least one pushbutton input and that can provide a small amount of +5
voltage. You will, of course, need a different plug, and the plug pins
may have different numbers than the ones shown for the Apple. See the
section on other computers in the Electronics Tutorial for more
information on how to adapt this controller to other computers.
128 The Computer Controller Cookbook
Parts List
Sound Pushbutton
Approximate
Cost $14.00
CONSTRUCTION OF THE
OUTLET BOX
The outlet box is a standard 4-inch square conduit box with a front
plate for two duplex outlets, a cover (if the front plate does not include
one), and two cable clamps. If you want to include some of the special
features you will need a larger box. Local electrical supply houses
usually carry larger multiple conduit boxes or single outlet boxes that
bolt together side by side to house any number of outlets.
We pop riveted a small sheet metal tab to the back of the box so
that we could hang it under the desk with two panhead screws. If you
plan to place the box on the back of your desk you can attach plastic
feet or cover the bottom with felt.
To install the cable clamps, knock out two of the metal slugs,
place the clamps through the hole, and tighten the nut inside the box.
The clamping screws should face the front of the box. A bit of Loctite
or Super Glue on the nut threads will secure the nut.
The box for the ON/OFF switch should be decorative. You can,
of course, use any metal or plastic box, but most electronic and
electrical boxes look out of place on a desk. Our prototype switch box
LAMP II&. II.AC.
DESK CABLE 2
BOX BLACK\GREEN
WHiTE
DESK SWlTCHED
OUTLET BOX
FfG. / /-2
Desk Switched Outlet Box 133
has sloping hardwood sides and a sheet metal top and bottom, as
shown in figure 11-1. Making the sloping sides is a good exercise in the
use of a radial arm or table saw. If you don't have a shop manual that
demonstrates how to set the angles you will have to do some trial and
error work on scrap wood. The corners are held together with wood
glue and finishing nails driven into predrilled holes. After the four
sides were glued together, the top was sloped and the bottom flattened
with hand tools. You will have to file out a notch in the back for the
cable. Sand the hardwood pieces and finish them with polyurethane
varnish.
Cut the top and bottom plates from aluminum or steel. Drill and
file the top to fit the switch and the lamp. Drill and counter-sink holes
in the bottom plate for six #6 flathead screws. Attach the top to the box
with silicone sealant or epoxy so that no screws will show. Finish the
top plate with an orbital sander to a. uniform matte finish and then
varnish the entire box.
ELECTRICAL ASSEMBLY
For the electrical work you will need wire strippers, long-nose pliers,
wire cutters, and a medium-size standard screwdriver. This project
requires a soldering iron of about 50 watts to tin the wires and solder
the connections on the switch and lamp. A 50 watt iron is larger than
the size called for in the other controller projects, but it is a standard
iron used for many household jobs.
The electrical wiring is shown in figure 11-2. Note that wire
colors are indicated. These colors are an important part of the
National Electrical Code and must be followed scrupulously. The
Electronics Tutorial in chapter 14 contains a detailed explanation of
the correct procedures for wiring this unit and other AC appliances.
You should review the section on AC Codes and Wiring Practices
before starting this project. As before, coloring in two photocopies of
the wiring diagram (figure 11-2) is the best way to keep track of and
check your work.
The easiest way to obtain the cable is to purchase an extension
cord long enough to make both cables. A 12-foot cord is usually
sufficient. Cut off the outlet end and about four feet of cable to make
cable #2. Number 14 3-conductor cable is best for almost all home and
office computer systems.
134 The Computer Controller Cookbook
TESTING
When you have completed all the connections and checked your work,
screw the box together and tighten the cable clamps. Plug the unit into
a 3-wire house outlet with nothing plugged into the new outlet box. If
the circuit breaker doesn't blow, throw the desk switch. The lamp on
the switch box should tum on and off with the switch. If it stays
lighted all the time, it is connected to the wrong side of the switch.
Now plug a light load like a reading lamp into the outlet box and
try the switch again. If you encounter any problem (a blown circuit
breaker or a switch that works backwards), unplug the unit, recheck all
the wiring, and make corrections. When the unit works properly with
a household lamp you can plug your computer into the outlet.
Desk Switched Outlet Box 135
FINISHING TOUCHES
There are several other features you may want to add to your unit. If
you are concerned about lightning strikes or other severe electrical
surges, you can add two additional varistors. One should be installed
from the black wire to the green and the other from the white wire to
the green wire beside the first varistor.
If electrical interference is affecting your television set or your
neighbor's when your computer is on, you might add an EMI filter
like Radio Shack's #273-100. This will prevent electrical noise from
leaving the computer by way of the AC line. Since most such noise is
radiated directly into the air, this probably won't help your television
reception much. If you add the filter you will also need a larger box.
If you decide you want a fuse and fuse holder you will, again, need
a slightly larger outlet box. Alternatively, small pushbutton-style
circuit breakers can be purchased through large mail-order electronics
houses. A rating of 10 amps at 110 volts would be suitable for most
personal computer systems.
If unauthorized people have been using your system or turning
off the computer when you have intentionally left it on to run a long
program you may want to add a key switch to the desk box. Mount the
key switch (for example, Radio Shack #49-523) in the switch box either
in series (lock OFF) or parallel (lock ON) with the main switch. Since
the key switch usually has a lower amp rating, use the main switch
routinely and key only when you need the lock feature.
We are confident that you will use the Desk Switched Outlet Box
more than any other device in this series of designs. We have built at
least a half dozen of them. They make great gifts for anyone who uses a
computer, either at home or at work.
136 The Computer Controller Cookbook
Parts List
Desk Switched Outlet Box
Approximate
Cost $21.00
THE AC RELAY
The input of a 5-volt solid state relay requires little current and can be
driven by outputs rated at I TTL (transistor-transistor logic), which is
approximately 5 milliamps at 5 volts. The 74LS chips referred to in
these projects are TTL chips. By comparison, a single LED requires
about 20 milliamps for normal light levels and may overload
annunciator outputs.
The output of a solid state relay is rated by the maximum current
(measured in amps) it can carry and the maximum RMS AC voltage it
can control. Inexpensive relays are usually rated between 4 and 10
amps of 110 volts AC. More expensive ones (up to 40 amps of 440 volts)
can be purchased for controlling higher-powered equipment.
Solid state relays handle only alternating current. They can turn
on direct current but they can't turn it off. These relays have no
internal moving parts or contacts to wear out. They should last for
many years if they aren't cooked to death by extensive overheating or
shorted out by a voltage spike.
The current ratings given in manufacturers' data sheets are for
resistive loads, like incandescent lamps or resistance heaters. To use
the relays on inductive loads (e.g., motors and heavy transformer
devices), you must purchase relays that have about twice the rating of
the device's normal operating current. To protect the relay from
voltage spikes, particularly those caused by suddenly turning off an
inductive load, you must add a varistor, as shown in figure 12-2.
To protect the relay from overheating, make certain that its metal
bottom is in good thermal contact with a metal heat sink. If the relay is
AC Outlet Controller 139
mounted in a heavy metal box and the back of the box is exposed to free
air, a small relay will be cooled adequately. For higher powered and
multiple relays you may have to install an aluminum heat sink in the
back of the box and space the relays an inch or more apart. Use a heat
conductive compound like Radio Shack #276-1372 on the metal backs
of the relays to improve heat transfer. Since the relay backs are
insulated from the AC, you don't need a layer of electrical insulation
between the relay and the box.
Good news: There has been a recent breakthrough in the
manufacture of solid state relays. The new technology, called S3X, lets
the relays function with fewer parts than the present design. The new
units exhibit markedly better performance with inductive loads and
will generally run cooler. These relays should be available soon, and
perhaps we'll be able to purchase the old style units at cheaper prices
from the surplus houses.
MECHANICAL
CONSTRUCTION
The solid state relays for the prototype conduit box were purchased
from PolyPaks (see the parts list for their address). They are smaller
than most other solid state relays and have solder terminals instead of
the usual screw terminals. You may be able to get them from PolyPaks
or from another surplus electronics company. If not, the standard
commercial relays are a stock item at Newark and other large houses. If
you can't obtain the small relays, you will need a box larger than the 4-
inch square indicated in the parts list.
The prototype box has a cover for two duplex outlets and two
cable clamps. One or even two of the smallest AC relays can be
mounted in this box, taking the place of one of the outlets.
To be absolutely certain that the AC wires will not make contact
with the wires running to the computer, you should fashion a sheet
metal partition to divide the relays into two sections. First make a
cardboard pattern and then cut the partition out with tin snips. Attach
the partition to the box with bolts or pop rivets. You can also make a
sheet metal hanger for the back of the box, or devise some other
mounting arrangement. You should also cover two of the outlet holes
with a piece of sheet metal.
140 The Computer Controller Cookbook
GAME-
1\0
CABLE
A.C. (\
CABLE I o
CONTROLLED
A.e. OUTLET
FIG. /2-1
ELECTRICAL WIRING
The wiring in this project is similar to that of the Desk Switched
Outlet Box in chapter 11. Once again, it is necessary to follow the
electrical code guidelines, so review them before starting to wire this
unit (see the section on AC codes in the Electronics Tutorial).
Figure 12-2 is the schematic for a two-relay system. The power
cable is a 3-wire # 14 extension cord with the outlet end cut off. If you
are using two relays on the same outlet you must separate the two
sockets electrically. Break off the small metal bridge between the two
brass screws on the black wire side only. For currents of up to 10 amps,
#14 wire will be adequate. For high-current systems you will need #12
or larger wire.
The two varistors shown in figure 12-2 provide protection from
voltage spikes. These are necessary to control inductive loads like
motors or flourescent lights.
The current in the control lines to the computer is so
inconsequential that extremely small wire in this cable will meet the
electrical requirements. You will, however, need a cable that is strong
enough to withstand a reasonable amount of wear. If you have extra
wires in the cable it is a good idea to double up the ground wire.
The best plug for the AC outlet box is a stacked plug similar to the
one described in chapter 3. All the pins of this one, however, should
pass straight through, with no tricky crossovers. A stacked plug lets
you plug in the AC outlet box and still use conventional controllers,
providing they do not require the annunciator outputs.
The outlet box must only be used with 3-prong grounded systems.
You must clip or screw the green wire of the power cord to the metal
box and connect the green screws on the outlets to the box with green
WIres.
If you like, you can add a fuse and fuse holder or circuit breaker for
each circuit. As noted for other special features, this may necessitate
using a larger box.
TESTING
Check your wiring using the procedures we have described for
coloring in two copies of the schematic. After you have finished the
connections, assemble the box and tighten the cable clamps. Before
l7U
r
PIN-
GND 8 ( I
Q:cl
A NfJ. 15 < . STRAIN RELIEF
ANI 14< . 3 V 64 36 V 64
0
+-5 GND +-5 GN D
GAME 1\0
SOLID STATE u
METAL SOLID STATE
CONNECTOR :-- -GND- -- r U_ RE LA-Y_-/ - - - PARiirloiv- - - - RELAy--i - n ' __ - __ u U
I TO ==t>
----L. 80 X ADDITIONAL
RELAYS
2 I
VARISTOR
11r:;) V.AC.
BLACK
= BLACK era
c=: ==f>
WHITE Q:[) BRASS o ADDITIONAL
SILVER OUTLETS
BRAKE'"
BLACK
GREEN
CONTROLLED A.C.
OUTLE T GREEN
Fl G. 12 - 2
WHITE
- ' - GND
TO
BOX
AC Outlet Controller 143
testing the unit on your computer, you should plug it into a household
outlet. With a multimeter, measure the AC voltage between each of the
computer connector leads and the metal box to be sure that no AC is
read on any of the pins. Plug an incandescent lamp into the AC outlet
box; the lamp should not come on.
Now unplug the outlet box from the wall. Make sure your
computer is turned off. Install the plug into the computer's game
control socket, plug the outlet box into house current, and turn on the
computer. If the computer doesn't start up in a completely normal
fashion, turn it off immediately, unplug everything, and recheck all
your work.
Run the Annunciator Checkout program in the software chapter.
A lamp plugged into this controlled socket should turn on and off as
the checkout program runs.
How large an AC control system could an Apple handle? Each of
the four annunciator outputs could control a relay, and the relays are
available with ratings up to 40 amps at 440 volts. If you want to get
serious, however, you will have to add a simple multiplexing card
(four 74LS chips). The four annunciator inputs and the strobe line
could then drive 32 relays, for a total of 560 kilowatts. That should be
enough power to provide the mind-boggling light show for a "Who"
concert.
144 The Computer Controller Cookbook
Parts List
AC Outlet Controller
Approximate
Cost $34.00
e
00
s
•
®
e
•
•
13 Construction
Notes
In building these controllers you can choose from a variety of
materials and make a great many modifications to suit your
requirements. We have put together prototypes of all the designs;
when we made more than one prototype the units were never exactly
alike. We used scrap materials extensively and often adjusted the plans
to take advantage of available materials. If you can't find a specified
part or material, substitute something else that you can find.
146 The Computer Controller Cookbook
MATERIALS
Many of the materials for these controllers were salvaged or scrap. The
parts list for each project gives the materials actually used for the
prototypes, but don't be afraid to experiment with alternatives. Here
are some suggestions on what to use and where to get it.
Lumber. The hardwood lumber for many of the prototypes was scrap
from furniture projects. Clear softwood is also suitable, except for
those parts that must have holes drilled and tapped into the wood. Just
remember that the hardwoods can be finished more attractively than
the softwoods.
removed. Then you can polish the edges with Crest toothpaste or a
polishing compound from the plastics supplier.
Many of the projects specify plastic washers cut from coffee can
lids. This plastic is polyethylene; it has a soapy feel and serves as a
lubricant between wood parts. You can cut it with household scissors.
Glues. Wood parts were glued with Elmer's Carpenter's Wood Glue, a
tan liquid, and felt pieces were attached with Elmer's Cabinetmaker's
Contact Cement. The latter can be cleaned up with water, a nice
feature for the home craftsman. No lockwashers were used: all bolts
were secured with thread sealant on final assembly. The bolt threads
must be oil-free for this to work properly. You can substitute. Super
Glue or fingernail polish for the sealant.
Wherever rubbery adhesion was needed, we used G. E. Silicone
Glue and Sealant. Also known as RTV (room temperature
vulcanizing), this was used to form strain reliefs for cables and for
insulation over electrical connections. Don't use an excessive amount
of RTV in any application since it can ooze out and look very sloppy.
Clear sealant is the least messy to work with. You should also note that
this material contains an acid catalyst and can cause eye and skin
irritation if handled carelessly.
00
S
•
•
14 The Electronics
Tutorial
This chapter will help those of you with a limited background in
electronics get started on the controller projects. We trust that more
experienced hands will also find many suggestions that will speed up
their work.
If you follow the guidelines in these sections and the specific
details in the project chapters, you should produce creditable results in
150 The Computer Controller Cookbook
your electronics construction. You will benefit most from the tutorial
if you read through the chapter and then refer back to specific sections
as you work on a project. The following topics are included:
1. Electronic Components
2. Where to Buy Electronic Components
3. Reading Schematics
4. Controller Electronics
5. Adapting the Controllers to Different Computers
6. Tools Required for the Electronics Work
7. How to Solder
8. AC Codes and Wiring Practices
9. Safety Precautions
10. References
ELECTRONIC
COMPONENTS
The following electronic components are used in constructing the
projects in this book. They are also the ones found in most beginning
electronics projects and, in fact, make up the majority of all electronics
equipment.
Resistor Values
Color Color
Digit (Bands 1 and 2) (Band 3) Multiplier
o Black Black 1
1 Brown Brown 10
2 Red Red 100
3 Orange Orange 1,000
4 Yellow Yellow 10,000
5 Green Green 100,000
6 Blue Blue 1,000,000
7 Violet Violet 10,000,000
8 Gray Gray
9 White White
Tolerance
(Band 4, if present)
No band ±20%
Silver ±1O%
Gold ±5% (now standard)
Resistors are also rated by the power they will dissipate without
burning up. Power is defined as voltage times current and is measured
in watts. All the resistors we will be using in these projects are 1/4 watt.
of a farad) and are small enough to fit on a printed circuit board. When
designing circuits you must avoid using very large value caps since
they are just too big physically. We will use capacitors to smooth out
DC voltage, to pass AC while blocking DC, and paired with a resistor
in a timing circuit.
For large values (l to 10 microfarads) we will generally be using a
type called electrolytic caps. They must have one lead (marked with a
dot or a + sign) attached to a more positive DC voltage than the other
lead. Electrolytic caps do not last as long as most other electronic
components, so we will avoid using them whenever possible. But
electrolytic caps made with the metal tantalum are smaller and longer
lived. Although more expensive, they are usually worth the extra cost.
Wires and Cables. The wires used for digital electronics are much
smaller than those used in household wiring. Sizes #22 - #30 are most
often employed in electronics work. Lamps and power tools use #12 or
#14. The bigger the number, the smaller the wire; even numbers denote
copper wire. As far as the electrical requirements of these controllers
are concerned, you could use wire that is hair-fine (#42). You would
have difficulty working with it, however, since it breaks so easily. On
the other hand, wires that are too thick will not fit into the solder lugs
on digital electronic parts and circuit boards.
There are only two conductors in these projects that might work
better with larger wires. They are the +5 volt power supply line and the
ground wire. If these wires are too small, the controller functions
might lose independence, in which case pressing a pushbutton would
cause a pot reading to change. Fortunately, doubling up these wires
works as well as using larger-size wire, and it is much easier to obtain
cables with a few extra wires than cables with a few wires of a different
SIZe.
Flat ribbon cable is often used for commercial controllers, but we
don't like it because it has no protective cover. The wires on the outer
edge of the ribbon break too easily. We used 4-wire telephone cable,
inexpensive and readily available, for most of the controller
prototypes. The insulation on this cable, however, can be damaged if it
is overheated during soldering.
We have also made serviceable cables by pulling plastic insulated
wire through plastic tubing (e.g., plastic aquarium tubing). We have
also used a homemade rope-making machine to braid cables, with
good results.
154 The Computer Controller Cookbook
WHERETO BUY
ELECTRONIC
COMPONENTS
Radio Shack stores are definitely the handiest to shop at of all
electronics suppliers. The quality of most of their components is
acceptable. Their potentiometers, however, are of poor quality and we
cannot recommend them. The selection is often limited: an outlet will
stock only a few of each catalog item and will often be sold out of the
part you need. Radio Shack prices are somewhat high, but this is to be
expected from a convenience store. Radio Shack reference books are
quite good. Many professionals look down on this chain, but they
have so often provided a part that kept one of our projects moving at a
critical time that we are grateful that the stores are almost everywhere.
price. These houses are listed in the pages of electronics and computer
magazines. We have been particularly pleased with Jameco
Electronics (1355 Shoreway Road, Belmont, CA 94002). The
minimum order is only $10, and their turnaround time is remarkably
fast.
Big catalog stores have an enormous stock of components and put out
large catalogs. They cater to commercial accounts but will usually
accept a minimum order of about $25. To buy from them you must
first locate the local sales representative, either by going to the Yellow
Pages or by contacting the firm's central office. The local rep will send
you a copy of the catalog and, when you are ready to order, will use a
computer to make certain the items you want are in stock. An order
will generally take two to three weeks, but if an item is out of stock
there may be a delay of six to eight weeks. Work with the sales rep and
the catalog to find substitutes for out-of-stock items. We have ordered
parts from Newark Electronics (500 N. Pulaski Road, Chicago, IL
60624) and Allied Electronics (401 E. 8th St., Fort Worth, TX 76102).
Both of these firms have offices nationwide.
READING SCHEMATICS
Most information about the wiring of electronic devices is presented in
stylized drawings called schematics. Schematics are not difficult to
comprehend once you are familiar with a few basic symbols.
The Electronics Tutorial 157
RESISTOR CAPACITOR
-YV\I\IVL- --1/(--
E L £ e TRO LY TIC
MEC ROSWI TC H CAPA eITOR
+D-
CHIP
PUSH BUTTON
:-1--t- - -1- -1- -I-- -I,
I....
J-
I
-I- I
I I I
-1- -1- -1- -1- +- -1-'
A Note on How to
Check Your Work
The best way to check your wiring on electronics projects is to make
two photcopies of the schematic before you start. As you add a wire to
the circuit, draw over the appropriate line on the first copy with a
colored pencil. Color in each wire, joint, and component as you add it
to the device. When everything is colored in you know you have
finished the circuit.
Color in the second copy, point by point, as you check over your
work, either visually or with a multimeter. Many professionals use this
method of coloring in two schematics to check their work. To provide
an even better check, you can ask someone else to color in the second
copy as they check the circuit.
CONTROLLER
ELECTRONICS
The electronic circuits in home computer game controllers are not
difficult to understand. They have several digital inputs
(pushbuttons), some digital outputs (annunciators), and a few analog
inputs (game controls). The circuits don't change much from one
make to another. Even though these circuits are very simple, they can
be adapted to perform a great many tasks. The projects in this book are
only a sample of their many applications.
The digital inputs expect inputs of either 0 or +5 volts. Their
input resistance is several thousand ohms, so they don't draw much
current. Less than 4 milliamps is required to turn them on; this is
referred to as 1 standard TTL input. Since these inputs should not be
floating (an input that is not connected to either the +5 supply or
160 The Computer Controller Cookbook
VOLT
+ 5 - - -
+5
lGND.
Tt TIME
TIMER CHART
F [G. /4-1
ADAPTING THE
CONTROLLERS TO
DIFFERENT COMPUTERS
The circuits for the game paddle inputs of most home computers are
quite similar. They differ mainly in the connectors used and the value
of the pots. In this section we'd like to discuss the basic similarities and
differences in game controller design, and give you some hints on how
to adapt the projects described in this book for different home
computers.
162 The Computer Controller Cookbook
Apple II
All the designs in this book were tested on the Apple II Plus, which
uses a 16-pin DIP plug for its connector. This plug fits a standard IC
socket, but it isn't very strong and is often damaged. The new Apple
II/e adds a 9-pin D connector to the back of the console, but we think
most people will continue to employ extension sockets and standard
DIP connectors. The 9-pin D connector is the same socket used by
Atari, but the sockets for the two machines are not pin compatible.
The Apple II uses 150K ohm pots and a timer circuit. As noted
previously, 150K ohms is a non-standard pot value and is sometimes
difficult to find. Pull-down resistors are used on the pushbutton
inputs. These are connected from the input (pins 2,.3, or 4) to the
ground (pin 8). The factory paddles have 570-ohm resistors hidden in
their connectors, but we prefer to substitute I K resistors since this
value is easier to obtain, saves a little power, and is adequate for
pushbutton inputs.
Atari Systems
You shouldn't have any trouble adapting the controller designs to
Atari systems. They use a 9-pin D connector that is strong and readily
available. The D connectors that you can wire yourself have plastic
cases or hoods that may be too large for the Atari sockets. You can file
away some of the plastic for a good fit. The plug pinout is shown in
figure 14-2, which shows the game control schematic for the Atari and
Commodore VIC-20 computers.
The value of Atari paddle pots is I meg-ohm, a size that is easy to
find, but quite large. Such large value pots tend to wear out sooner
than those of lower values. The pots have two wires, indicating that
this is a timer circuit.
To use the Correction Cap Calculation in the software chapter,
change line 18 to read: 18 RMX = 1000 : CI =.00I : NM$ ="ATARI".
The pushbuttons have pull-up resistors going to the +5 supply, but the
circuit seems to work just fine without them. We generally used l K
resistors for pull-ups when working with Atari computers.
The Electronics Tutorial 163
I
,---.:--.l- JOY I
DOWN
'J
PO T l.
Y r-;;-;>
1M EG JOY2 X
1_ J , LEFT PADDLE
PB
I
Y
PADDL E
RIGHT PB
..... I
1
I
I , v ic -20;
I I &
('6
...-
/0,
...-'"\
I ATARI
I I GAME CONTROL
DE9S L +5: l -.I
SCHEMATIC
SO CKE T GNO: 8 3'"'-u-'-;----.--1 FfG /4-2
BACK VIEW I
_ _
IIou
9
_' . . . . , . . 1
4,,-1I
v-:-,_ _...J
(-{J 5 I
.......... - .
..... 1-
L
<C >
OT 2
....... PI fiJriJ
<
PO
(9
1(9 (9
T
K: • .'
'---
..... <1
-
K
PO T .....{ P OT3
<I 1? I <9<9 K
1 <I >'
16) (9K ;> """'-
'---
'--
P
4 v 0
PB v
5
-0
'"
IBM PC
+5r-
GAME CONTROL
...... +-5
I I SCHEMATIC
.....
84 2 FIG 14-3
-
r;
3_ I
GND 4
....
..... ,
:P2
D
5
'? :GND
GND D
.."
PI 6
-..... - I DA /5 P
B5 7
[>
14: B7
-
;'I
PLUG
IS'
<II
BAC/f... VIEW
+5
j
I
166 The Computer Controller Cookbook
maximum pot value as lOOK, the internal cap size as .011 microfarads,
and the computer's name.
Instructions for reading the game inputs are given in detail in the
documents that come with the game control adapter card. No changes
in these instructions are needed for the IBM PC to read the controllers
in this book.
Other Computers
In general, if a home computer can handle a pair of paddles with a
total of two pots and two pushbuttons, most of the controllers in this
book can be adapted for that computer.
The user manual or perhaps a reference book will give you the
information you need concerning the game connector and its pin
assignments. You may have to take apart the factory paddles to learn
The Electronics Tutorial 167
the standard pot value. You can then work out the paddle circuit with
an ohm meter. Look for the standard components and circuit designs
we've described above. Draw your own schematic after finding out
which pins are connected to which pot and switch terminals. Look out
for pull-up or pull-down resistors that may be hidden in the connector
or embedded in plastic parts.
For each new computer model that appears on the market, a
magazine article will quickly follow that evaluates its paddles and
joysticks and usually explains the paddle connection. If the system in
question has been around for awhile, look through back issues of
Creative Computing and other magazines that regularly review
computer equipment. You might even ask the person who sold you
the computer where to find out this kind of information.
Diagonal Cutters. You will need diagonal cutters, called dikes, to cut
off wires close to the circuit board. Again, a 5-inchpair is best for this
work. Don't use these to cut coat hangers either.
Wire Strippers. A pair that looks like wire cutters and is adjusted by a
bolt through the handle is most suitable for these projects. You will
have to change the adjustment for each wire size and test the strippers
on scrap wire after each adjustment to make sure that you don't cut any
fine copper wires. It takes practice to use wire strippers without
damaging the wire, but developing this skill is crucial for wiring the
projects correctly.
HOW TO SOLDER
Soldering is the most basic and critical skill in electronics. Many
components will be destroyed if they are not soldered well, and since it
is almost impossible to turn a poor soldering job into a good one, it is
important to do the job right the first time. Fortunately, it isn't hard to
learn to solder correctly. If you follow the suggestions below and put
in even a modest amount of time in practice, you should have no
problem mastering the technique.
Use the correct.iron for the job. For electronics work use a pencil iron
of 25 to 42 watts with a liB-inch chisel tip. A larger iron can lift the
copper lanes off the circuit board, melt wire insulation, and damage
components. The transformer-type pistol-grip irons used for
household repairs have too large a point and too much power for
electronics work. Only one of the projects, the Desk Switched Outlet
Box, uses an iron this large.
The Electronics Tutorial 169
Keep the tip of the iron clean. Rub the tip frequently over a damp
sponge to remove excess solder and resin. You will find it helpful to
keep the sponge in a jar lid on your workbench.
H eat the joint, not the solder. Cover the clean tip of the iron sparingly
with solder (this is called tinning the tip), and then place the tip on the
joint. When the joint begins to heat, touch the solder to the joint, not
to the iron. The solder should melt and then flow as a liquid over the
joint. When the joint is uniformly covered, remove the solder and then
the iron. Let the joint cool for a few seconds before you touch the wires.
Inspect the joint. The joint should be covered with a smooth coat of
solder. You shouldn't see any untinned copper wires or dark buildup
of excess resin. The solder must clearly have been a liquid that flowed
and then cooled. Also look for fine strands of wire or bridges of solder
between the joint just finished and its neighbors. These can usually be
removed with dikes, solder wick, and soldering iron.
There are two types of bad joints: those that got too hot during
soldering and those that never got hot enough. The hot joint is
characterized by insulation that pulls back from the wire, copper lanes
that lift off the board, a discolored printed circuit board, and
sometimes even damaged components.
A cold joint may have lumps of solder that didn't flow, dark
patches of resin, or places where copper wires show through the solder.
A cold joint can be caused by an iron that is too small for the job, an
170 The Computer Controller Cookbook
improperly cleaned and tinned tip, poor thermal contact between the
tip and the joint, or simply because you didn't leave the iron on the
joint long enough.
Color Codes
The key to wiring AC devices correctly is to follow the color code for
wires and terminals. Green wires and wires without insulation are the
safety ground and are connected to all metal boxes, conduits, and
frames. Their screw terminals are green; sometimes they have green
clips instead of screw terminals. Proper installation of green wires
minimizes the hazards of electrical shock and fire while reducing
electrical noise. The safety ground wires should be the same size as the
The Electronics Tutorial 171
other colored wires in a circuit. The green line must never be switched,
fused, or run through a' circuit breaker. It carries current only in the
case of a fault in the circuit. In Europe the safety ground wire is yellow
with green stripes.
The white wire is the power return. It carries current back from
the load, but is close to ground voltage except when a faul t occurs. The
screw color for the white wire is silver. If all the wires in a cable are the
same color (as is the case in plastic lamp cord), the correct wire to use
for the power return will always be marked. The mark is usually a
series of ridges along the outside of the wire or, more rarely, a colored
thread wrapped around the copper conductor. On AC outlets and
plugs the white wire goes to the wider prong (the indication that it is
the marked prong). Like the green wire, the white wire is never
switched, fused, or run through a circuit breaker.
The power wire can be any color except white or green; it cannot
be a bare wire. The most common colors for the power wire are black,
red, and blue. The screw terminals are brass colored. Since these wires
carry power to the electrical device, they are the only wires you can
switch, fuse, or run through a circuit breaker.
When you are running a wire to a switch that is separated from the
main device, you will sometimes need a cable with two power wires
but you won't need the white or green wires. In chapter II (the Desk
Switched Outlet Box), cable 2 from the outlet box to the switch box
(figure 11-2) requires two power wires and a white wire. The AC code
lets you paint both exposed ends of a wire the color you need, so you
don't have to buy special cable, e.g., one with a green and two black
wires. Yon will find that felt tip marking pens work well for painting
wires a dark color. White electrical tape is wrapped around dark wires
to color them white. If you paint a wire you must be careful to mark it
in every place where you remove the covering, even in intermediate
boxes. Painting a wire is an important safety step since it clearly
indicates the arrangement of the circuit, particularly to those who
might have to repair it at a later date.
Wire Size
The larger the number, the smaller the size of the wire. Even numbers
indicate that the wire is copper. Most electronic devices are wired with
#12, #14, or #16 wires for AC power. Solid #12 wire is now standard for
long runs and for house wiring and is also used for high-current loads
172 The Computer Controller Cookbook
like heaters, hot plates, and air conditioners. If you plan to plug
several medium-power electronic devices into the Desk Switched
Outlet and run the cord more than 15 feet, you might go to the extra
expense of using #12 wire. For most medium-power microcomputer
and home electric systems, #14 wire is adequate, and #16 wire will
suffice for systems with loads of 100 watts or less.
Placing wires in screw terminals looks easy, but it is often done
incorrectly. To attach a wire to a screw terminal, twist the stranded
wire tightly together and form it into a hook. Place the hook around
the screw in a clockwise direction. This is important: you will twist the
wire more tightly as you tighten the screw if the wire is wound
clockwise. If you put the hook on backwards, you will loosen it as you
tighten the screw. Close the hook with long-nose pliers and then
tighten the screw. When you have finished the wiring, go back over all
the screw terminals to be sure they are tight.
Wire Nuts
Wire nuts are small plastic and metal devices for connecting several
wires together. To properly install them, group all the wires together
in a bundle between your thumb and index finger. Cut them off evenly
and strip their insulation back l/2-inch from the end for solid wires
and 3/4-inch for stranded wires. If any of the wires are stranded, you
will need to twist all the stripped wires together into a bundle using
long-nose pliers. If all the wires are solid, as is usual for house wiring,
leave them straight.
Now twist the wire nut on with your fingers as tightly as you can.
Rock the nut back and forth with one finger looped around the bundle
of wires. If the nut has grabbed all the wires, they will move back and
forth as a group. If you can feel any wire moving independently of the
group, take off the nut, even out the bundle, and try again. If you
stripped the wires properly, all the bare copper should be hidden from
view inside the nut.
SAFETY PRECAUTIONS
Please be careful when building the projects in this book. You can
learn from minor mistakes, but serious ones have no redeeming
virtues. Avoid the big mistakes that can cause injuries or damage
valuable equipment.
The Electronics Tutorial 173
Don't burn down your house. Use your soldering stand and unplug
your iron every time you leave the room. Use only outlets that have
proper fuses or circuit breakers and don't plug too many devices into
one outlet.
Avoid electrical shocks. Follow all codes for AC devices. Unplug the
cords before opening the case of an electrical or electronic device.
Don't work on power equipement while you are alone. Always have
another person nearby who can cut off the power or go for help in an
emergency.
Don't plug any device into live equipment. This rule refers to both
connectors and printed circuit boards. In most instances, nothing
untoward will happen if you plug a paddle into your computer when
it is already on, but you could create a spark that in turn could destroy
an electronic component. It is bad practice, so don't take the chance.
Use common sense. Proceed carefully and check your work. Don't
work on equipment when you are ill or overtired or taking drugs of
any kind. The whole point is to do the job right the first time.
174 The Computer Controller Cookbook
REFERENCES
The references below will be useful for understanding the electronics
in the controller projects as well as for a general study of the subject:
•
•
15 Software
These six programs in Applesoft Basic will help you construct, test,
and use your homebuilt controllers. The six listings are:
Controller Checkout
Correction Cap Calculation
Linearity Test
Drawing Program
Digitizer
Annunciator Checkout
178 The Computer Controller Cookbook
All but the Drawing and Digitizer programs can easily be converted
into any other version of Basic with only a few changes. The Drawing
Program contains many graphics handling functions for the Apple,
and the Digitizer has several disk handling instructions. These listings
will require a little more work to adapt them to other computers.
The use of each of the programs is detailed in the project chapter
in which it is first required. The materials in this chapter are therefore
limited to the organization of the program, any unusual features, and
the major variables. This information should help you understand the
listings and make modifications in them to suit your needs.
Software 179
CONTROLLER CHECKOUT
With this program you can check out all the pushbuttons and game
control pots on the controllers you build. You will also need it to make
mechanical adjustments. The listing is introduced in chapter 1 and
referred to in almost all subsequent chapters.
Variables
Variable Line Description
OP$ 25 A string saying OPEN
CL$ 25 A string saying CLOSED
BL$ 25 Blank spaces to remove words
180 The Computer Controller Cookbook
Variable Line Description
PO 210 The reading of pushbutton 0
PI 220 The reading of pushbutton I
P2 230 The reading of pushbutton 2
GO 250 The reading of game control 0
GI 255 The reading of game control I
G2 260 The reading of game control 2
G3 265 The reading of game control 3
CORRECTION CAP
CALCULATION
This program calculates the value of the correction caps needed when
you choose a potentiometer with a lower maximum value than the
standard paddle pots for the computer. This approach works only for
computers that have timer game control circuits, like Apple, Atari,
and the Commodore VIC-20.
The use of this program is described in detail in chapter 1. The
program will be needed whenever you build a controller requiring
correction caps.
keyboard is then checked to see if any key has been pressed (line 1160).
If so, the program is ended (line 1170).
Variables
Variable Line Description
RMX 18 Maximum value of pot for this computer
CI 18 Value of cap inside the computer in
microfarads
NM$ 18 Name of computer
K 19 Constant for the computer system
MA$ 164 Choice between manual or automatic modes
R 175 Maximum value of pot in new controller
C 200 Value of correction cap in microfarads
RC 350 Value of correction resistor in K-ohms
PO 1110 Reading for game control 0
CO 1115 Correction cap for game control 0
PI 1120 Reading for game control 1
Cl 1125 Correction cap for game control 1
P2 1130 Reading for game control 2
C2 1135 Correction cap for game control 2
P3 1140 Reading for game control 3
C3 1145 Correction cap for game control 3
Q 1170 Check for keyboard key being pressed
LINEARITY TEST
The Linearity Test checks the linearity of graphic input devices that
use the game control inputs. Linearity is the ability of an input device
to transform a mechanical input (the turning of a paddle) into an
electronic input accurately. The use of this program is described in
detail in chapter 5 on the Sketch Pad. Linearity is essential to sketch
pad performance as well as to many other forms of data entry.
Variables
Variable Line Description
X(5) 30 A vector of the correct values in the
X axis
Y(5) 30 A vector of the correct values in the
Yaxis
NX 70 Number of the X point being read (0 to 5)
NY 70 Number of the Y point being read (0 to 5)
Software 185
Variable Line Description
18 REM * TOM RILEY COPYRIGHT 83 298 VTAB 14: HTAB 18: PRINT" ".
NORMAL
2J!1 REM * 300 REM READ PADDLES
22 REM *********************** 31111 GOSUB 1111111121
24 REM 312 XE = INT CCX - X(NX» * 100)
3121 DIM X(5), Y(5) / 100:PX = INT CXE / .255)
5111 FOR N = 111 TO 4 / HI
55 XIN) = 255 * N / 4:Y(N) X(N) 314 YE =
INT CCY - YCNY» * 100)
6111 NEXT N / 100:PY = INT (YE / .255)
7121 NX = 0:NY = 0 / 10
9111 HOME 320 REM ** NOTE TEST POINTS
100 REM ** HEADINGS 3:::::121 IF PT$ = "X" THEN VTAB (6 +
11111 PRINT " LINEARITY TES NX): HTAB 18: PRINT X;: HTAB
T" 25: PRINT XE;: HTAB 33: PRINT
12121 PRINT PX:NX = NX + 1
1"",.
L...J PRINT " CORRECT REA 340 IF PT$ = "Y" THEN VTAB (14 +
D ERROR '/.,11 NY): HTAB 18: PRINT V;: HTAB
13111 PRINT " X - AXIS" 25: PRINT YEo: HTAB 33: PRINT
1-;1""",
'_".4, PRINT PY:NY NY + 1
135 PRINT "POINT 121 "; XC0) 342 IF NX > 5 THEN NX = 5
14111 PRINT "POINT 1 "; X(1) 344 IF NY > 5 THEN NX - 5
150 PRINT "POINT 2 II; X (2) "';l,;JW FLASH: VTAB (6 + NX):
16121 PRINT "POINT 3 "; X(3) 18: PRINT" ": NORMAL
17121 PRINT "POINT 4 "; X(4) 365 FLASH: VTAB (14 + NY): HTAB
18111 PRINT 18: PRINT" ": NORMAL
19121 PRINT " Y - AXIS" 37121 FOR N = 1 TO 500: NEXT N
195 PRINT 38121 IF NY = 5 AND NX = 5 THEN GOTO
2121121 PRINT "POINT 0:;:
;;;J "; Y (121) 41!1l21
21111 PRINT "POINT 6 "; Y (1) 39121 GOTO 3121121
22121 PRINT "POINT 7 II; Y (2) 4111111 REM ** TEST AGAIN ?
2:::::111 PRINT "POINT 8 II; Y (3) 41111 VTAB 2121
24121 PRINT "POINT 9 "; Y(4) 42121 INPUT "NEW TEST ? ( Y OR .N
26121 PRINT ";YN$
27i!1 PRINT "PRESENT POSITION" 43111 IF YN$ = "Y" THEN GOTO 70
28111 PRINT 999 END
continued . . .
186 The Computer Controller Cookbook
REM ** READ PADDLES SUBROU 1030 Y = PDL (1)
TINE
101111 X = PDL (!2l) ...•
11114111 VTAB 22: HTAB 25: PRINT "
11112111 VTAB 22: HTAB 1.: PRINT" 111145 HTAB 25: PRINT Y
" .• 1I117l1s P1B = PEEK ( - 16286)
111125 HTAB 1111: PRINT X 108111 IF P1B > 127 AND NY < 5 THEN
111127 P0B PEEK ( - 16287) PT$ = nyu: RETURN
111128 IF P0B > 127 AND NX ( 5 THEN 1!219!21 GOTO 1!21 1111
PT$ = "X": RETURN 9999 END
Software 187
DRAWING PROGRAM
Using this program you can draw directly into the hi-res screen with
any paddle, joystick, or controller. It was written for the Sketch Pad
controller and is described in detail in chapter 4.
Sections
This program uses a Main Menu to direct execution to any of six
subroutines:
Variables
Variable Line Description
Cl 70 Picture elements in the Y axis
C2 70 Maximum game control reading
C3 70 Picture elements in the X axis
188 The Computer Controller Cookbook
DIGITIZING
With this program you can enter data from charts and graphs directly
into your computer with the Sketch Pad. The use of the program is
explained in detail in chapter 4, along with the information on
building the Sketch Pad.
Variables
Variable Line Description
PT% 30 An integer array of the data point
readings
D$ 50 Control D
PTN 60 The number of the point
SN 60 The number of the sheet
F$ 140 The name of the disk file for the data
YN$ 160 The answer to YES/NO questions
Q$ 180 A second YES/NO answer
UX$ 232 Units of the X axis
UY$ 232 U ni ts of the Y axis
XOV 234 Value of the 0 point on the X axis
XMV 234 Value of the 255 point on the X axis
YOV 234 Value of the 0 point on the Y axis
YMV 234 Value of the 255 point on the Y axis
EOF$ 270 End of File marker
X 410 Reading of game control 0
POB 440 Reading of pushbutton 0
Y 460 Reading of game control 1
AX 660 Conversion ratio for X axis
AY 680 Conversion ratio for Y axis
XV 1020 Current value of X
YV 1055 Current value of Y
ANNUNCIATOR TEST
With the Annunciator Test program you can test new controllers that
use the Apple's four annunciator outputs (pins 13, 14, 15, 16) or the
strobe (pin 5). One such device is the Computer Controlled AC Outlet,
described in chapter 12. The test program turns these outputs on and
off at a slow, steady pace and shows their status on the screen. You can
then compare the output of your new controller with the status of the
computer's output.
Variables
Variable Line Description
z 180 Dummy variable for pulsing strobe
SC 185 Count of total strobe pulses
BEL$ 515 Control G, which rings bell
Software 197