The Electronics Tutorial

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 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:

 l. 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.

Resistors. These colorful two-wire devices resist the flow of electrical current. A current flow through a resistor results in voltage across it (Ohm's law):

Voltage = Resistance x Current
V = R x I

This equation is used more often than any other equation in electronics. If you know any two of the variables, you can calculate the third.
Resistors are measured in ohms or thousands of ohms (K-ohms). Most resistors are banded, using a standard color code that gives their value in two digits (first and second bands), a multiplier (third band), and a tolerance (fourth band). The colors and corresponding digits are:

Resistor Values
 
Digit
Color
(Bands 1 and 2)
Color
(Band 3)
 
Multiplier
0
1
2
3
4
5
6
7
8
9
Black
Brown
Red
Orange
Yellow
Green
Blue
Violet
Gray
White
Black
Brown
Red
Orange
Yellow
Green
Blue
Violet
Gray
White
1
10
100
1,000
10,000
100,000
1,000,000
10,000,000
Tolerance
(Band 4, if present)


No band    ±20%
Silver         ±10%
Gold          ±5%  (now standard)

Examples of resistor values as indicated by their colored bands are:

330 ohm 5%    Orange, Orange, Brown, Gold
1 K ohm 10%    Brown, Black, Red, Silver
50K ohm 5%    Green, Black, Orange, Gold

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.

Power = Voltage x Current
        P = V x I

Potentiometers. These devices, commonly referred to as pots, are resistors with a sliding contact. They were originally used in a voltage divider circuit called a potentiometer circuit, which is where the name comes from. They can also be employed as variable resistors, which is how they are used in most of the controller circuits. A true potentiometer has at least one wire on each of its three terminals. Pots employed as variable resistors use only two terminals and often have the unused terminal wired to the center terminal.
     Like all resistors, pots are measured in ohms, K-ohms, or meg-ohms (millions of ohms). In operation, most pots make nearly one complete turn (usually about 300 degrees). Other pots, in order of frequency of use, turn one, ten, twenty, five, or three times. It is also possible for a pot to slide in a straight line. The knobs on most electronic devices turn potentiometers.
     In choosing pots for electronic devices, mechanical considerations are usually more important than electrical ones: How good is the bearing? How long is the shaft? Is the shaft round or flattened?
     The primary electrical property we look for is linearity. That is, a graph of the amount of turn of the pot shaft versus the resistance should be a straight line. The description of the Sketch Pad project (chapter 4) goes into linearity in more detail since it is critical for good sketching. Generally, the more expensive the pot, the better the linearity.
     Some of the best available pots are rated "Military Specification" (Mil Spec or Mil No.). These pots have excellent mechanical construction and good linearity, so look for this rating in the electronics catalogs.
     The value of the potentiometers in the standard Apple paddle, 150K ohms or .15 meg-ohms, is an uncommon one. Pots of this value are sometimes hard to find. Chapter 1, "Rebuilding Paddles and joysticks," gives a procedure for using pots with values like 250K, which are easier to find. The Atari and the Commodore VIC-20 computers use the much more common value of 1 meg-ohm.

Capacitors. These components, often called caps, store an electrical charge. Caps always contain two electrical conductors with an insulator between them. They are measured in farads: if a cap is 1 farad, then a current of 1 amp flowing into it for 1 second will charge it to 1 volt. A 1-farad cap would be about the size of a bathtub. The caps we will be working with are measured in microfarads (one-millionth 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 (1 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.

Circuit Board. In many of these projects you have to mount electronic components on a board and attach wires. You can do this job in a professional way by utilizing printed circuit boards (PCB) that come with pre-drilled holes in a regular pattern and copper lanes on one side. All the components and wires are placed on the top side, which is bare, and all the soldering is done on the bottom side, which has rows of copper lanes. The two sides of a circuit board are commonly referred to as the component side and the solder side. One panel of PCB (Radio Shack #276-154) is big enough to make two or three controller circuits.
     You can cut a board by scoring it deeply with an X-acto knife and steel straight edge and then breaking it over the edge of a table. You can also spin the knife to enlarge the holes for mounting bolts and switches. The copper lanes must be cleaned with a pink pencil eraser before you start to solder.
     For the prototypes the circuits were wired by soldering short jumper wires between the pre-formed copper pads on the standard boards. This is called point-to-point electrical wiring and is the best procedure to follow for these small circuit boards. For larger projects you can use a procedure called wire wrapping, in which fine wires are wrapped around metal posts with special tools. Wire wrapping is used extensively to build prototyes of digital circuits that have more than three chips.
     If you were making large numbers of a circuit board you would use photographic techniques to produce custom-printed boards specifically for that circuit. This more complex and expensive procedure would eliminate most of the hand wiring involved in point-to-point wiring and wire wrapping.

Integrated Circuits. These components, the key to digital electronics, are referred to as chips. On a tiny chip of silicon, transistors, diodes, and resistors are arranged in a circuit. The circuits we will use, called DIP (Dual Inline Packages) chips, are encased in black rectangular boxes with silver wires projecting out of the sides, like the legs of a caterpillar.
     We will use three types of chips in these projects. The first, transistor-transistor logic (TTL) chips, have numbers that begin with 74 or 74LS. TTLs, the most common type of digital chip, operate on +5 volts only. They are cheap and easy to find, medium fast, and provide a wide range of functions.
     We will also use a few chips called CMOS (complementary metal oxide semiconductor). They can operate on 3 to 15 volts and consume an amazingly small amount of electrical power. CMOS chips also provide a wide variety of functions and are used extensively in battery-powered equipment. They cost more than TTLs and can easily be ruined by static electricity during installation. Leave CMOS chips in their protective packages until just before inserting them into their sockets.
     The third type we will use, the analog chip, handles continuously changing (analog) signals and is used in amplifiers and voltage level sensors. A piece of digital equipment usually requires at least a few analog chips. They are quite similar to the TTLs but may require voltages other than +5 volts (often ±10 or ±15 volts).

WHERE TO 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.

Discount mail-order houses handle lots of surplus and seconds and their prices are low. Sometimes you get a real buy; sometimes you get junk. These companies periodically mail out fliers and run ads in electronics and computer magazines. They usually require a minimum order of about $10. We have ordered several items from PolyPaks Inc. (16-18 Del Carmine St., Wakefield, MA 01880) with good results.

Small mail-order houses have a limited selection of good quality components and usually put out a catalog that will be sent to you for a 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.

Local over-the-counter stores for the most part sell wholesale to electronic repairmen and commercial customers, but some stores will sell retail for cash. Look in the Yellow Pages under "Electronic Equipment and Supplies-Dealers." Telephone first to find out if they sell to the public and what hours they are open, but don't try to order by phone. The counter people often have encyclopedic knowledge of where to get obscure parts, but they must give preference to their large customers. It is best to go to the counter in person and patiently wait your turn. If the part you need is fairly common or used frequently by repairmen, ham radio operators, or serious electronic hackers, then the store will have it.

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.

Schematic Components

     The solid lines on the schematic represent electrical conductors like wires and printed circuit lanes. If there is a dot where two solid lines meet or cross the conductors are connected. If there is a small loop or no dot the conductors do not connect.
     All the component terminals which are continuously connected by solid lines will be at the same voltage; together these are called a node. In making up the circuit you do not have to make the joint exactly where the dot appears on the schematic. The solder joints can be made at any convenient location as long as the terminals shown as one node are connected in the final wiring.
     The wiggly lines represent resistors and are labeled R1, R2, and so on. A wiggly line with an arrow pointing at it is a potentiometer. The arrow represents the wiper arm of the pot and is usually, but not always, the middle terminal.
     Switches are shown as dots with a swing line that looks like a door. Terminals for switches are labeled n.o. (normally open), n.c. (normally closed), and c (common). For the most part we use single-pole, double-throw switches, with one each of these three kinds of terminals. With a single-pole double-throw switch, a single wire can be switched between two terminals. The small microswitches used for triggers and pushbuttons in many of the projects are single-pole, double-throw. They make an audible click when pressed, a good feature in a controller.
     We also use a pushbutton switch with only two terminals. This is a normally-open momentary-contact switch and usually appears on the schematics as two circles with a curved bar almost touching them. Pushbuttons with tops at least 3/8-inch in diameter are the least tiring to press, and those that make a click are preferable.
     Capacitors show up on schematics in two styles. Both are represented by two parallel lines. For non-electrolytic caps, one of the lines is slightly curved. In the symbol for electrolytic caps, one of the lines has two extensions and looks like a three-sided box reaching out to enclose the other line. The positive lead is marked with a plus sign.
     Chips are shown in this book as dashed lines that form boxes around special symbols. In order to understand how chips are related to their representations on the schematic, it is important to know how the pins are numbered. This is more difficult than you might suspect, and mistaking pin numbers is probably the most frequent cause of burned-up chips.
     Place the chip with its legs pointing down on your worktable, with the notched end away from you. You should be able to see the manufacturer's insignia and read the part number indicating the type of chip, like the 74LS04. That number may begin or end with extra numbers which indicate ratings, for example, the military temperature range. Chips often have a date code that can, unfortunately, be mistaken for the part number. Pin 1 is on the left side closest to the notch and is sometimes marked with a dot or circle. The pin numbering continues down the left side, across the bottom, and up the right side of the chip. For these projects we will be using DIP chips with either 14 or 16 pins.
     The best way to mount chips is to buy chip sockets for them. Make all solder connections to the sockets and then plug in the chips as the last step in constructing the circuit. Pin 1 of a socket is often marked by a cut-off corner.
     The game connector for the Apple is a 16-pin DIP header (sometimes called a component carrier) that plugs directly into a standard chip socket. A DIP header looks similar to a chip but has small forked lugs to which wires can be soldered. Other home computers use different types of connectors. Information about them can be found in the operating manual for the machine or by examining a standard set of paddles for the system.
     Reading schematics is a fundamental requirement for learning about computer hardware. With practice you will soon be able to read them and turn the various symbols into functioning electronic circuits.

A Note on How to Check Your Work
The best way to check your wiring on electronics projects is to make two photocopies 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 ground is described as "floating"), a pull-up or pull-down resistor is used in the circuits. The Apple uses pull-down resistors connected from the input to ground, while the Atari uses pull-up resistors connected from the input to the +5. For the controller prototypes we used 1K ohm resistors for either application. Digital inputs in controllers may be driven by either switches or TTL chips.
     The annunciators are usually rated to drive 1 TTL input. Annunciators can supply no more than 5 milliamps of current. This is not enough for an LED, which needs 20 milliamps. Therefore an inverter or other chip must be placed in the circuit before an annunciator can power an LED or even a large number of TTL inputs.
     Two types of analog inputs are used on home computers: the true analog-to-digital converter and the timer. Some Radio Shack computers and all expensive data logging systems used in industry use true A-to-D converters. In these, a continuously changing (analog) voltage is converted to a series of numbers (digital). When a pot is used as an input device for these circuits it must be wired to provide a varying voltage. To do this, it must be wired in a true potentiometer circuit, which requires three wires (+5, ground, and signal). You can tell that a pot is connected for this kind of circuit if you see that three separate wires are attached to it.
     The timer type of analog input uses a circuit based on a popular chip, the 555 timer. This timer is controlled by both a capacitor inside the computer and by the game control pot wired as a variable resistor (two wires). When a reading is called for, the computer starts the timer and begins to count from 0 to 255. The number it has reached when the timer goes off (see below) is the reading.

Fig.14-1. Timer Chart

     Drawing 14-1 shows how the timer is controlled. When the timer is started, the capacitor is discharged and then allowed to recharge through the resistor in the controller. The resistance of the controller is dependent on the setting of the mechanical knob. The lower the resistance, the faster the capacitor can charge, so less time is available for the computer to count. When the amount of resistance in the controller is high (i.e. the controller is at its highest setting) the capacitor will charge to the trigger reference voltage more slowly, allowing the timer's counter to reach a higher value before the timer is tripped. When the trigger reference voltage (about 1.7 volts) set in the design of the timer is reached, the timer is tripped and sets a flag so that the computer will stop counting. This length of time is controlled by the product of the capacitance times the resistance of the controller. Chapter 1 gives you more information on this kind of circuit in the discussion of correction capacitors.

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.

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 lK 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 1 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 =.001: 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 1K resistors for pull-ups when working with Atari computers.

The Commodore VIC-20
The Commodore VIC-20 has an attractive game input circuit custom-made for this system. You can readily adapt this circuit to the controller projects. The VIC-20, however, has only two analog inputs so you can't use two standard joysticks at the same time or the foot pedals along with the airplane wheel.
     Commodore, like Atari, utilizes a 9-pin D connector. The pinouts for the two systems are identical (as shown in figure 14-2). The system uses the pots in timer circuits. You can use the Correction Cap Calculation by changing line 18 to read: 18  RMX =1000 : CI = .001 NM$ = "VIC-20"
     The pots are 1 meg-ohm and are wired as variable resistors for a timer circuit. The internal capacitors are .001 microfarads. The pushbutton inputs, which can also be made to act as outputs, or annunciators, do not seem to need resistors. We generally add 1K pullups anyway, since it is considered good electronics practice.

IBM Personal Computer
The IBM Personal Computer does not come with a game connector, but you can purchase a game control adapter card that fits into one of the computer's card slots. With this card the computer can read up to four pots and four pushbuttons. All the projects are easily adapted for use with this card, except the controlled AC outlet (chapter 12). The controlled outlet requires an annunciator output, which is not provided by the IBM card.
     Figure 14-3 shows the schematic for two joysticks for the IBM PC. The joysticks have timer-type potentiometer circuits and use l00K pots. The pushbuttons connect from the pushbutton lines to ground and require no pull-up or pull-down resistors.
     The IBM uses a 15-pin D connector, usually available from the same sources as the 9-pin connector used by Atari and the 25-pin (RS-232C) connectors in the D connector series. Note (on figure 14-3) that the +5 volt supply and the ground are available on several pins. You can use any of the pins indicated on the drawing.
     The Correction Cap Calculation should allow you to use lower values for the pot. You will have to change line 18 in the listing to read: 18 RMX = 100: CI =.011 : NM$ = "IBM PC". This line gives the maximum pot value as 100K, 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.

Fig.14-2. VIC-20 and Atari control schematic

Fig.14-3. IBM Control Sxhematic

Radio Shack Models
Some Radio Shack computers come with a game controller; others can take an add-on device to accept the game controller. You can adapt most of these projects to any Radio Shack model that can handle their standard game paddle.
     Radio Shack paddles use the DIN (Deutsche Industrie-Norm) connector. It originated in Europe and comes in several pin configurations. Make certain the connector you buy not only has the right number of pins but also has them in the correct pattern.
     The 100K pots are wired as voltage dividers or true potentiometers. The true potentiometer circuit will accept a wide range of maximum pot values, but since correction caps work with timer circuits only, they cannot be used to control pot values here. This creates a problem with controllers like the Airplane Wheel and Super Stick in which the pots do not travel through their entire range. For these controllers we recommend that you start with a pot of about 250K and use the painting procedure described in chapter 1 under the heading "Zeroing joystick Elements" to reduce the resistance of the unwanted portions of the pot to zero. Complete the mechanical construction and remove the back of the pot by straightening the two metal tabs. Then mark the limits of travel for the pot wiper and paint the pot element with conductive paint from the marks to the terminals.

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 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.

TOOLS REQUIRED FOR THE ELECTRONICS WORK
You will need the tools we discuss here for the electronics work in the controller projects. These tools are also often extremely useful for carrying out other household tasks. You may already have several of them on hand.

Soldering Iron. Most of these projects require a small pencil soldering iron of 25 to 42 watts with a 1/8-inch chisel point. Larger irons are likely to damage the components, the circuit board, or the insulation on the wiring. Different models, even if they have the same wattage, may deliver different amounts of heat to the joint. If you do much electronics work you will probably end up with two or more irons so that you have just the right one available for a particular job.
     You will find these soldering aids indispensable: a roll of solder wick (Radio Shack #64-2040) to correct your mistakes, a piece of wet sponge to clean the tip, and a stand for the iron. Good soldering is the most important skill in electronics and will be covered in detail in the next section.

Long-nose Pliers. A small pair (5-inch) is best for electronics work. Don't use them for jobs like bending coat hangers or you will ruin them.

Diagonal Cutters. You will need diagonal cutters, called dikes, to cut off wires close to the circuit board. Again, a 5-inch pair 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.

Multimeter. Although not absolutely required for these projects, an inexpensive multimeter is extremely useful for checking your wiring before plugging a new unit into your computer. An analog multimeter with a half-dozen resistance and DC voltage ranges will serve nicely. Any Radio Shack multimeter on sale, sometimes for as little as $10, is a good buy. The more expensive digital meters are difficult to use. A less expensive meter will serve you better for these projects.

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 1/8-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.

Buy small-diameter resin-core solder. One acid-core solder joint will destroy an entire electronic device. Acid-core solder is used to work sheet metal and usually comes in large diameters. If you have any doubt about the type of core, don't use the solder. The solder for these projects should be a 50/50 tin/lead alloy about.032-inch in diameter.

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.

Make good mechanical connections before applying solder. Twist multi-strand wire tightly-loose strands will cause shorts. Wrap wire around posts with the long-nose pliers. Push wires through the printed circuit board and bend them slightly on the bottom side. When you are ready to solder, take your hands off the work. All the wires to be soldered should stay in place. You can't hold a wire in place with your finger and start soldering; the result is a bad joint and a burned finger.

Heat 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 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.

Take safety precautions. A poorly handled soldering iron can burn your fingers and your desk or worktable. It could even start a fire. It is important that you buy or make a weighted stand for your iron and then use it to hold the iron. Always unplug the iron when you leave the room, even if you plan to be gone for only a short time. Make this a habit so when you leave your house you won't have to wonder, "Did I unplug the soldering iron?"

Craftsmanship. Soldering is an important skill. Every time you start a new job try to do it better than the last one. This is a key attitude for developing good skills in any field.

AC CODES AND WIRING PRACTICES
It is surprising how many otherwise competent electronic technicians don't know or don't understand the importance of following National Electrical Code guidelines when working on AC devices. We will summarize the parts of the code that are necessary for constructing these projects (see The National Electrical Code Handbook, produced by the National Fire Protection Association, Quincy, Massachusetts). This information is critical not just for working on controllers but for all household electronics work, from rewiring a lamp to installing an outlet in a room.

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 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 fault 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 11 (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. You 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 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 1/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.

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.

Keep stray electrical power out of your computer. Carefully check devices that use alternating current (like the monitor and the controlled AC outlet) to insure that stray AC cannot find its way into the computer. If you are working on a controller with an AC cord, give this device an extra check with the multimeter before connecting it to your computer.

Avoid electrical shocks. Follow all codes for AC devices. Unplug the AC 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.

Don't short the computer power supply to ground. Depending on the computer, a short to ground may blow out a fuse, and could conceivably damage the power supply. Check and recheck the +5 wires on all newly-built devices with a multimeter before plugging them in. On the Apple, the +5 supply (pin 1) must read at least 50 ohms to ground (pin 8), and usually measures much more. The Apple's power supply can provide only 100 milliamps at +5 volts to the game control socket. By Ohm's law a resistance of 50 ohms will draw the entire 100 milliamps, so this value is the lowest resistance allowed. Other computers will have similar limiting current values which must be observed. This information is usually given in the reference manual for a computer, in the section on the game controller connector.
     If you turn on your computer with a new controller plugged in and it doesn't start up in its normal fashion, the +5 may be shorted. Turn the computer off immediately and recheck all your work. A chip plugged in backwards is often the cause of this kind of short.

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.

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:

Engineer's Notebook II: Integrated Circuit Applications, Forrest M. Mims III, Radio Shack Cat. No. 276-5002, $2.49. This softbound volume is perfect for beginners and of great value for professionals. It gives you schematics for hundreds of circuits that you can actually get the parts for. We have a $50 reference book that isn't as good as this one. An essential tool and an incredible buy for the price.

Semiconductor Reference Guide, Radio Shack Cat. No. 276-4006, $3.49. This softbound guide isn't as helpful as Engineer's Notebook II, but it does contain good information on available components. Since much of the material is in the form of measured parameters (voltages, timings, etc.), a beginner may find this guide difficult to use at first. You will soon learn to pick out the specific information you need.

Radio Shack/Texas Instruments Learning Center books on various topics in electronics. These books, sold at Radio Shack, are generally well written and reasonably priced. Several of the volumes cover microprocessors and digital equipment. They tend, however, to stress the achievements of Texas Instruments and overlook everyone else's.

The National Electrical Code Handbook, edited by Joseph A. Ross, published by the National Fire Protection Association, Quincy, Massachusetts, provides excellent guidelines for electricians or electronic technicians working with AC devices. This book is a critical reference tool for using your computer to control AC power, as well as for any household electrical work.

Computers & Electronics (formerly Popular Electronics) and other amateur electronics magazines. These magazines often feature lots of articles on how to build items of dubious utility from parts that aren't available. They do contain excellent learning projects, however, and the ads in the back are helpful in ordering parts from electronics suppliers.

Creative Computing and other computer magazines. These magazines focus on home computers, but stress software and reviews of commercial hardware. The articles on how to build hardware for the computer are usually too advanced for the beginner. After completing several of the projects in this book, however, you will be able to move up and take on these more complex and challenging circuits.


Return to Table of Contents | Previous Chapter | Next Chapter