Chapter 17
IN THIS CHAPTER
Creating unique light blinkers and flashers
Rigging an alarm
Constructing an adaptable siren
Sounding off with your own amplifier
Designing a traffic signal
Making beautiful music
Getting up to speed on electronics really pays off when you get to the point where you can actually build a project or two. In this chapter, you get to play with several fun, entertaining, and educational electronics gadgets that you can build in half an hour or less. I selected the projects for their high cool factor and their simplicity. I’ve kept parts to a minimum, and the most expensive project costs under $15 or so to build.
I’ve given you some detailed procedures for the first project, so work through that one first. Then, you should be able to follow the circuit schematics and build the rest of the projects on your own. Check Chapter 11 if you need a refresher on schematics, and browse through Chapter 3 if you’d like to review basic circuit concepts. And if the projects don’t seem to work as advertised (it happens to the best of us), review Chapter 16, arm yourself with a multimeter, and start troubleshooting!
You can build all the projects in this chapter on a solderless breadboard. Of course, feel free to build any of the projects on a regular soldered circuit board, if you want to keep them around. There’s more detail about breadboarding and building circuits in Chapter 15. If you get stuck on any of these projects, hop to that chapter to help you through.
Unless otherwise noted, use these guidelines when selecting components:
Your first mission — should you choose to accept it — is to build a circuit containing a single light-emitting diode (LED) that blinks on and off at a rate that you can vary. This may sound simple (and, thanks to the 555 timer IC, it is), but getting the LED to blink means you must successfully build a complete circuit, limit the current in your circuit so that it doesn’t fry your LED, and set up a timer to switch the current on and off so that the light blinks. After you accomplish your mission, you modify the circuit to create a multi-LED flasher that you can mount to the back of your bike to alert motorists to your presence.
You can see the schematic of the single LED flasher in Figure 17-1. (If you need a quick refresher course on reading schematics, flip to Chapter 14.) Here are the parts you need to build this circuit:
Before you build the LED flasher, you might want to do a quick analysis to understand exactly how it works.
The cornerstone of the LED flasher (as well as other projects in this chapter) is the 555 timer IC. You can use this versatile part in a variety of ways, as explained in Chapter 11. For this project, the 555 timer is configured as an astable multivibrator (which is a fancy way of saying it’s an oscillator) generating an ongoing series of on/off pulses at regular intervals, sort of like an electronic metronome. The output of the 555 timer IC, at pin 3, is what you use to switch on and off the LED current.
Resistor R3 is there to keep you from frying your LED. This lowly resistor performs the important job of limiting the current passing through the LED. The output voltage at pin 3 of the 555 timer varies between 9 V (the positive power supply) when the pulse is on and 0 V when the pulse is off.
Assuming the forward voltage drop across the LED is about 2.0 V (a typical value), you know that when the pulse is on, the voltage drop across resistor R3 is about 7 V. You get this result by taking the 9 V at pin 3 and subtracting the 2 V dropped across the LED. From that, you can use Ohm’s Law (see Chapter 6) to calculate the current through R3, which is the same as the current through the LED, as follows:
Now, that’s a current your LED can safely handle!
Resistors R1 and R2 and capacitor C1 control both the width and the on/off timing interval of the pulse generated by the 555 timer IC (see Chapter 11 for details). This project uses a potentiometer to vary R1 so you can change the rate of the blinking light from slow waltz to fast samba.
The time period, 003A4, is the total time it takes for one up-and-down pulse:
To see whether the light blinks at about the rate your calculations say it should, build the LED flasher circuit and try it out! Use Figure 17-2 as your guide. If this is the first circuit you’re building, you may want to follow the detailed instructions in this section.
Here are the steps to build the LED flasher circuit:
Collect all the components you need for the project.
See the parts list in the “Exploring a 555 flasher” section for a rundown of what you need. Nothing is worse than starting a project, only to have to stop halfway through because you don’t have everything at hand!
Carefully insert the 555 timer chip into the middle of the board.
It’s common practice to insert an IC so that it straddles the empty middle row of the breadboard and the clocking notch (that little indentation or dimple on one end of the chip) faces the left of the board.
Insert the two fixed resistors, R2 and R3, into the board, following the schematic and the sample breadboard in Figure 17-2.
Insert the two capacitors, C1 and C2, into the board, following the schematic and the sample breadboard in Figure 17-2.
As noted in Chapter 11, the pins on IC chips are numbered counter-clockwise, starting at the clocking notch. If you’ve placed the 555 timer IC with the clocking notch facing the left side of the board, the pin connections are as shown in Figure 17-2.
Solder wires to the potentiometer (R1) to connect it into the breadboard.
Use 22-gauge solid-strand hookup wire. The color doesn’t matter. Note that the potentiometer has three connections to it. One connection (at either end) goes to pin 7 of the 555; the other two connections (at the other end and the center) are joined, or bridged, and attached to the positive side of the power supply.
Connect the LED as shown in the schematic and the photo.
Observe proper orientation when inserting the LED: Connect the cathode (negative side, with the shorter lead) of the LED to ground. Check the packaging that came with your LED to make sure you get it right. (If you don’t, and you insert the LED backwards, nothing bad will happen, but the LED won’t light. Simply remove the LED and reinsert it, the other way around.)
Use 22-gauge single-strand wire, preferably already precut and trimmed for use with a solderless breadboard, to finish making the connections.
Use the sample breadboard shown in Figure 17-2 as a guide to making these jumper-wire connections.
Finally, attach the 9 V battery to the positive supply and ground rails of the breadboard.
It’s easier if you use a 9 V battery clip, which contains prestripped leads. You may want to solder 22-gauge solid hookup wire to the ends of the leads from the clip; this makes it easier to insert the wires into the solderless breadboard. Remember: The red lead from the battery clip is the positive terminal of the battery, and the black lead is the negative terminal, or ground.
When you apply power to the circuit, the LED should flash. Rotate the R1 knob to change the speed of the flashing. Does the LED blink at the rate you expect it to? If your circuit doesn’t work, disconnect the 9 V battery and check the connections again.
Here are some common mistakes to look for:
You can use your multimeter to test voltages, currents, and resistances in your circuit. As described in Chapter 16, such tests can help you identify the cause of circuit problems. Your multimeter can tell you whether your battery has enough juice, whether your diode is still a diode, and much, much more.
You can expand the simple LED flasher circuit to create an inexpensive multi-LED flasher that you can use to increase your safety when you go for out for a ride on your bike or a run in the park. Or you can just wear it on your shirt to impress your friends.
Look at the circuit in Figure 17-3. Other than the additional LEDs at the output of the 555 timer IC and the use of a fixed resistor instead of a potentiometer for R1, this circuit seems identical to the simple LED flasher circuit from the previous section. And it is. Well, except for the values of R1, R2, and C1, which are the components that determine the pulse rate that controls the blinking of the LEDs.
For a bike flasher, you want the LEDs to flash at a rapid clip, but not so fast that you can’t distinguish one blink from another. The values shown next for R1, R2, and C1 generate a timing interval of roughly two pulses per second (2 Hz). I also suggest that you use ultrabright LEDs, which are similar to standard LEDs except that they have clear plastic cases so that the light appears to be brighter.
Here is the parts list for the LED bike flasher:
If you’d like to change the flash rate, try using different values of R1 (or R2 or C1). For instance, using 220 Ω resistors (red-red-brown) for both R1 and R2 produces a flash rate of about 10 pulses per second (10 Hz). And remember to add an on/off switch for the battery if you make this circuit permanent.
Figure 17-4 shows you a schematic of a light-sensing alarm. The idea of this project is simple: If a light comes on, the alarm goes off.
You build the alarm around a 555 timer chip, which acts as a tone generator. The 555 timer is configured (once again) as an oscillator, and the values of R3, R4, and C1 are selected to create an output pulse train (on pin 3) at a frequency in the audible range (20 Hz to 20 kHz).
So, to make the 555 timer sound the alarm only when light is present, you need to create a light-sensitive switch and use it to control the reset pin on the 555 timer. The left side of the circuit in Figure 17-4 provides the light-sensitive switch in the form of a photoresistor-transistor combination.
Transistor Q1 plays the role of the switch, sometimes conducting current and sometimes not conducting current. (You find out what controls Q1 soon.) Transistor Q1 controls the 555 timer reset pin as follows:
When the transistor is not conducting current, the voltage on pin 4 (reset) of the 555 timer goes low.
If the transistor is not conducting current, no current is flowing through resistor R2, so the voltage drop across R2 is 0, and the voltage where the collector of transistor Q1 (that is, the terminal on the lower right side of the transistor in Figure 17-4) meets pin 4 of the 555 timer is 0.
When the transistor is conducting current, the voltage at pin 4 (reset) of the 555 timer goes high.
In Chapter 10, you see that when a transistor is fully conducting, the voltage drop from the collector to the emitter is nearly 0, so in this circuit, the voltage at the collector is nearly equal to the 9 V power supply voltage.
The bottom line is that the light alarm has two possible states:
Here’s the shopping list for the light alarm project:
You can apply this light alarm in several practical ways. Here are a few ideas:
Figure 17-5 shows a schematic for a primitive electronic keyboard. The circuit may look complicated, but it really is fairly simple if you understand how the 555 timer IC operates as an oscillator.
Here are the parts you need to build the C-major scale circuit:
The frequency at which the 555 timer output oscillates depends on the values of two resistances and a capacitor, as you see in Chapter 11 and in other projects in this chapter. Resistor R1 and capacitor C1 are two of the three values that go into the frequency calculation. The other value that helps determine frequency is the resistance found between pins 7 and 2.
There’s no rule that says you have to use a single resistor between pins 7 and 2. The total resistance between the pins helps determine the frequency. In this circuit, you use a series of eight pushbutton switches to select a series of resistors in such a way that the total resistance between pins 7 and 2 helps generate a frequency that corresponds to a specific note. You use a 10 kΩ resistor (R2) as the base resistance, a 10 kΩ potentiometer (R3) to tweak, or tune, all the notes in the scale, and additive resistors (R4–R10) for the total resistance required for each individual note in the C-major scale.
The values of resistors R4–R10 have been carefully calculated to produce the correct tones. For instance, the frequency of the note A on the equal-tempered scale is 440 Hz. The resistance you need between pins 7 and 2 to produce a 440 Hz pulse train is roughly 15.1 kΩ. (You can calculate this resistance yourself by using the formula in Chapter 11 for the frequency of a pulse train produced by the 555 timer used as an astable multivibrator.) By pressing SW3, you are connecting resistors R2, R3, R4, and R5 in series between pins 7 and 2. (Be sure to follow the path of the complete circuit and see for yourself what the total resistance is.) The total resistance (R2+R3+R4+R5) is 12.6 kΩ plus the value of the 10 kΩ pot (that is, R3). If your circuit is tuned properly (by adjusting the pot while using a tuning fork or your accurately tuned piano, if you like), the pot value is roughly 2.5 kΩ. (Keep in mind that resistor values can vary, so your pot value may be a little higher or lower than 2.5 kΩ.)
Set up the circuit and try it out! You can play the C-major scale on it, and maybe even the beginning of a few tunes, such as “Do Re Mi” and “America the Beautiful.” Eventually, you’ll find that you need more notes, such as sharps and flats, or notes beyond one octave. Armed with your knowledge of the 555 timer IC, adding resistors in series, and opening and closing circuits with switches, you can build out this C-major circuit to create more interesting tunes.
Unless you carry a badge (a real one, not the one in your toy box), you can’t arrest any bad guys when you set off the warbling siren that you build in this project, shown in Figure 17-6. But the siren sounds cool, and you can use it as an alarm to notify you if somebody’s getting at your secret stash of baseball cards, vintage Frank Sinatra records, a signed copy of Mister Spock's Music from Outer Space record, or whatever.
To start alarming your friends, gather these parts to build the circuit:
This circuit (refer to Figure 17-6) uses two 555 timer chips. You rig both chips to act as astable multivibrators; that is, they constantly change their output from low to high to low to high — over and over again. The two timers run at different frequencies. The timer chip on the right in Figure 17-6 is configured as a tone generator, producing an audible frequency at its output pin, pin 3. (Humans can hear frequencies in the range of 20 Hz to 20 kHz, give or take a few frequencies.) If the timer chip on the right were acting alone, you would hear a steady, medium-pitch sound from the speaker connected to its output. But instead, the 555 timer chip on the right is acting in concert with the 555 timer chip on the left.
The timer on the left operates at a lower frequency than the timer on the right and is used to modulate (okay, warble) the signal produced by the timer chip on the right. The signal at pin 2 of the 555 chip on the left is a slowly rising and falling ramp voltage, which you connect to pin 5 of the 555 chip on the right.
By adjusting the two potentiometers, R2 and R4, you change the pitch and speed of the siren. You can produce all sorts of siren and other weird sound effects by adjusting these two potentiometers. You can operate this circuit at any voltage between 5 V and about 15 V. To power the gadget, use an easy-to-find 9 V battery (included in the parts list in the preceding section).
Give your electronics projects a big mouth with a little amplifier designed around parts that are inexpensive and easy to find at most electronics suppliers, such as the LM386 power amplifier IC. This amp boosts the volume from microphones, tone generators, and many other signal sources.
Figure 17-7 shows the schematic for this project, which consists of just 10 parts and a battery. You can operate the amplifier at voltages between 5 V and about 15 V. A 9 V battery does the trick.
Here’s a rundown of the parts you need for this project:
Just connect a signal source (for instance, a RadioShack condenser microphone, part 270-092, which requires a DC power source) across the inputs, making sure to connect the ground of the signal source to the common ground of the amplifier circuit. The LM386 does most of the work for you in this little circuit. Here’s what the other parts in this circuit do:
This simple circuit puts out a whole lotta sound in a small and portable package. And the better the microphone and speaker, the better the sound!
If you were a fan of the Knight Rider television series that aired in the ’80s, you remember the sequential light chaser that the KITT Car sported in front. In this section, I show you two versions of the light chaser, each of which uses just two inexpensive ICs and a handful of other parts. You may want to choose one circuit or the other to build. Light Chaser 1 is a little easier to understand. Light Chaser 2 adds a layer of complexity to increase the cool factor.
The parts lists for the two circuits are nearly the same. The main parts list, which includes labels that reference the schematics shown in Figures 17-8 and 17-9, for both circuits is as follows:
In addition to the main parts list, Light Chaser 1 uses these parts:
In addition to the main parts list, Light Chaser 2 uses these parts:
The schematic for Light Chaser 1 is shown in Figure 17-8. For this design, each of 10 LEDs will light up in succession (that is, following the pattern 1-2-3-4-5-6-7-8-9-10), and the pattern will repeat itself continuously as long as the circuit has power.
The circuit for Light Chaser 1 in Figure 17-8 has two sections:
You can build Light Chaser 1 on a solderless breadboard to try it out. If you plan to make it into a permanent circuit, give some thought to the arrangement of the ten LEDs. For example, to achieve different lighting effects, you can try the following:
Figure 17-9 shows another way to build a light chaser. The left side of Light Chaser 2 is the same as the left side of Light Chaser 1, so the brains of both circuits operate in the same way. The right side of Light Chaser 2 is set up so that the LEDs light up sequentially from LED1 through LED6 and then back down to LED1. The lighting sequence follows this repeating pattern: 1-2-3-4-5-6-5-4-3-2. By adjusting the pot (R1), you can change the speed of this bidirectional lighting sequence.
In this section, I show you how to use a 555 timer chip and the 4017 decade counter (once again) to build a simulated green-yellow-red traffic signal. The schematic for the traffic signal is shown in Figure 17-10. Here are the parts you need to build this circuit:
The 555 timer chip is used in astable mode to generate a low-frequency square-wave pulse on output pin 3. Note that the value of capacitor C1 is 100 μF — much larger than the C1 value used to control the light chaser circuits in the previous section. The larger the capacitance, the longer it takes to charge the capacitor, and the longer it takes to trigger the 555 chip via pin 2. So the 555 timer output (pin 3) oscillates at a much slower rate than in the light chaser circuits.
By varying the resistance of the potentiometer (R1), you control the timing cycle, but because this pot is smaller than the pot used in the light chaser circuits, you can’t vary the timing quite as much. The full duration of the timing cycle (that is, the time it takes to complete one up-and-down pulse on pin 3 of the 555 timer IC) is designed to range from about 3 seconds to about 10 seconds.
Here are some ways in which you can tweak your traffic light design:
Maybe you may know some kids who would love to have a traffic signal to use while they’re playing with toy cars and trucks, riding their Big Wheels in your driveway, or playing “Red Light, Green Light, 1-2-3!” with a bunch of friends. You can test the circuit on a solderless breadboard, tweak the design to suit the needs of your young customers, and then build a permanent circuit and enclose it in a shiny box that has three holes for the LEDs and a hook or stand for mounting. (If you do create such a project, remember to include an on/off switch for your battery.)
3.138.37.20