Doug Lowe

Electronics All-in-One For Dummies


Скачать книгу

pad and trim off the excess wire.

      6 Install the LEDs.Remember that LEDs are directional and must be installed in the correct direction or they won’t work. One lead is shorter than the other to help you tell which lead is which. This short lead is the cathode, and the longer lead is the anode.The following table shows where to install the LEDs:LED ColorCathode (short lead)Anode (long lead)Red1213Green32When you install the LEDs, do not push the LED in until it is flush with the circuit board. Instead, push just a little bit of the leads into the holes so that the LED stands up about an inch from the top of the board.

      7 Install the jumper wires for the metal contacts.Cut two, 2-inch lengths of stranded wire and strip about ⅜ inch of insulation from each end. Solder one end of each wire into holes in strips 1 and 11 and leave the other ends free. When the circuit is installed in its final enclosure, you connect the ends of these wires to the metal posts that the user will touch to activate the coin-toss circuit. Feeding the stranded wire through the holes in the circuit board can be tricky. First, carefully twist the loose strands until there are no stragglers protruding from the end of the wire. Then, carefully push the wire through the hole. If any of the strands get caught and refuse to go through the hole, pull the wire out and try again.

      8 Connect the push button.Cut a 2-inch length of stranded wire and strip about ⅜ inch of insulation from each end. Solder one end to either terminal on the push button (it doesn’t matter which). Push the other end through a hole in strip 10 and solder it in place.

      9 Connect the battery snap connector.Strip off about ⅜ inch of insulation from the end of both leads. Then, solder the black lead to the free terminal on the push button (the terminal you did not use in Step 8) and solder the red lead to a hole in strip 20 on the PCB.

      10 Connect the 9 V battery to the snap connector.The red LED should immediately light up, indicating that the circuit is ready to do its decision-making work.

      11 Turn off your soldering iron.You’re done!

      Test the circuit by pinching both of the free jumper wires between your fingers. The LEDs should alternately flash until you let go, at which time one or the other will remain lit.

image

      If you don’t want to spend the money for a bona fide electronic project box, here are a few alternative ways to find the perfect enclosure for your project:

       Shop discount department stores for small storage boxes. You might find one that’s just the right size and shape for much less money than an official project box of the same size would cost. (If the storage box is an unattractive color, you can always give it a quick coat of paint.)

       In the electrical department of any hardware store, you’ll find inexpensive plastic and metal boxes designed for household wiring. Many of these boxes can be adapted for your electronic projects.FIGURE 6-17: Project boxes come in a variety of shapes and sizes.

       Before you throw away an old electronic gizmo, take a quick look at the box it’s contained in. If you think it might be useful for a project someday, take it apart and discard all the innards, keeping only the empty carcass. Be careful whenever you disassemble any electronic device. Make sure you have first completely removed the power source and watch out for large capacitors that may be holding on to their charge.

       If you frequent yard sales, be on the lookout for items that might be useful as containers for your projects.

      Working with a project box

      Most project boxes are made of plastic or metal and have a detachable lid that’s held on with four screws, one at each corner of the lid. To gain access to the insides of the box, you simply remove the screws to release the lid.

       You’ll need a good assortment of small drill bits to drill holes through the box to mount your components. You’ll need to drill holes to mount the circuit board as well as such things as battery holders, switches, LEDs, speakers, and whatever else your project may require.

       Make a good sketch of your project box and how its parts will be arranged before you start drilling holes. When you’re sure that you have everything laid out the way you want, use a marker to indicate the exact position of the holes you need to drill.

       To mount the circuit board, use standoffs to provide some empty space between the board and the case. A standoff is a screw that allows you to mount the board so that it is raised above the bottom of the project box. You can purchase standoffs from any electronic parts supplier, but they are surprisingly expensive, often as much as 45 cents each. If you have an ample supply of nuts and bolts, you can fashion your own standoffs simply by cutting a short length of plastic tubing — my favorite material is ¼-inch drip irrigation hose — and feeding a long bolt through it.

       Consider mounting the circuit board on the back of the lid rather than inside the body of the box. This sometimes frees up more room within the box for larger items such as batteries or a speaker.

       Most switches can be mounted to a box by drilling a hole large enough to allow the neck of the switch to pass through. The switch comes with a nut that you can tighten over the neck of the screw to secure the screw to the box.

       Some components don’t have mounting nuts to secure them to the box. For them, a small amount of epoxy or other glue can help set the component in place.

       Use stranded wire for connections within the project box. Stranded wire holds up better to the handling it occasionally gets when you open the box, for example, to change the batteries.

      Mounting the coin-toss circuit in a box

      In this section, you finish the coin-toss project by mounting its circuit board in a plastic project box along with a 9 V battery, a power button, and the two metal contacts that the user can touch to toss the coin.

Quantity Description
1 Project enclosure 5 x 2½ x 2 inches
1 9 V battery holder
8 ½-inch 6-32 standoff male-to-female