Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Electronics_Projects_For_Dummies

.pdf
Скачиваний:
37
Добавлен:
10.06.2015
Размер:
17.71 Mб
Скачать

90

Part II: Sounding Off!

The following sections explore the schematic elements in detail.

Fancy Footwork: Exploring the

Dance to the Music Circuit

To make your musical score light up in response to the music, you need to make a circuit that uses a microphone, as well as two operational amplifier ICs in combination with some resistors, capacitors, and transistors. Working together, these control which group of LEDs lights up to a particular frequency of music.

Here’s the overview of the schematic elements that you use to control your project:

The circuit starts with an electret microphone, which transforms sound into electrical signals.

R1 connects the microphone to positive voltage and supplies about 4.5 volts required by the microphone to function.

C1 and C2 are capacitors that block the DC voltage on the input signal and allow the AC signal to pass.

At this point, the circuit splits: The signal processed by the upper half of the circuit powers the LEDs blinking in response to high-frequency sound; the signal flowing through the lower half of the circuit powers the LEDs blinking in response to low-frequency sound.

IC1 is an operational amplifier (op amp) that amplifies the signal from the microphone. The IC contains two op amps; one half of IC1 is used in the upper circuit, and one half of IC1 is used in the lower circuit.

R2 and R5 in the upper circuit and R19 and R22 in the lower circuit set

the gain for each side of IC1. Because R5 is 50 times R2, a signal processed by the op amp is amplified approximately 50 times.

Gain is the amplitude of the voltage out divided by the amplitude of the voltage in: in other words, how much more juice goes out than comes in.

R3, R4, and R6 in the upper circuit and R20, R21, and R23 in the lower circuit provide a DC bias to the op amp that allows the full AC signal to be amplified. If these resistors were not there, the portion of the AC signal coming into the op amp with voltage less than 0 volts would be lost.

Chapter 5: Making Light Dance to the Music

91

Filters

The portion of the circuit made up of C3 and R8 is an RC high pass filter. This pass has nothing to do with a tricky move in football. Rather, with this filter, signals above a certain frequency — determined by the value of C3 and R8 — pass through more easily than signals below that frequency. The strength of signals below this key frequency is therefore reduced. This type of filter is made up of the capacitor in line with the signal path and the resistor between the output of the signal and ground.

Correspondingly, the portion of the circuit made up of R25 and C6 is an RC low pass filter. Here,

signals below a certain frequency — determined by the value of R25 and C6 — pass through more easily than signals above that frequency. The strength of signals above this key frequency are reduced. This type of filter has the resistor in line with the signal path and the capacitor between the output of the resistor and ground.

For both types of filters, increasing the value of either or both the resistor or capacitor lowers the value of the key frequency. Lowering the value of either or both the resistor or capacitor increases the value of the key frequency.

Bias involves applying voltage that is above ground to a portion of the circuit to amplify both the positive and negative sides of a signal. Without DC bias, you would lose part of the signal.

C2 and C5 remove any DC bias from the signal coming out of the op amps.

R7 and R24 are potentiometers that allow you to adjust the sensitivity of the circuit in relation to how loud the music is.

C3 and R8 function as a high pass filter, and R25 and C6 function as a low pass filter. These filters are what make higher-frequency sounds light up LEDs 1–8 and lower-frequency sounds light up LEDs 9–16.

IC2 is an op amp that is used to amplify the signal that passes through the filter. The IC contains two op amps; one half of IC1 is used in the upper circuit, and one half of IC1 is used in the lower circuit.

R9 and R10 in the upper circuit and R26 and R27 in the lower circuit set the gain of the op amp. Because R10 is 200 times R9, a signal processed by the op amp is amplified approximately 200 times.

Q1, Q2, Q3, and Q4 in the upper circuit and Q5, Q6, Q7, and Q8 in the lower circuit are 2N3904 transistors whose bases are connected to the output of the op amps in IC2. When the output of the op amp reaches about 0.7 volts, the transistors turn on, and current flows through the LEDs.

92

Part II: Sounding Off!

The circuit won’t mean a thing if you don’t set up the lights for it to control. That’s where the two groups of LEDs and resistors come in. They include

LED1–LED8 to light the display for the high-frequency circuit and LED9–LED18 to light the display for the low-frequency circuit.

R11–R18 in the upper circuit and R28–R35 in the lower circuit are resistors, that in series with LEDs, limit the current running through the LEDs to approximately 10 milliamps.

Building Alert: Construction Issues

Behind the musical score, we drew on the box that holds the circuit, and all the resistors and LED leads are soldered together. To make sure that leads that get bent and touch don’t cause a short, they need to be protected. Rather than using electrical tape, we use liquid electrical tape to coat the exposed leads.

Wires run between the circuit board resting on the bottom of the box and the LEDs that you insert in the top of the box. Be sure to cut your wires long enough so that when you open the box (which moves the LEDs in the top farther away from the circuit in the bottom of the box) that you don’t rip out the wires. Also be careful that you leave room to tuck those long wires inside the box when closed so they don’t poke out the sides or get caught in the hinges. This is one case when stranded wires work better than solid wires because they are more flexible.

Perusing the Parts List

It’s off to your nearest electronics store or online vendor for those electronic parts you use to build the circuit and assemble the box that contains all those LEDs.

The circuit that transforms music into your dancing light show involves the following parts, several of which are shown in Figure 5-3:

2.2 kohm resistor (R1)

Eight 220 ohm resistors (R11–R14, R28–R31)

Chapter 5: Making Light Dance to the Music

93

Eight 100 ohm resistors (R15–R18, R32–R35)

Two 10 kohm potentiometers (R7, R24)

Four 47 kohm resistors (R3, R4, R20, R21)

Two 100 kohm resistors (R5, R22)

Two 2 kohm resistors (R2, R19)

Two 5 kohm resistors (R6, R23)

Two 1 kohm resistors (R9, R26)

Two 220 kohm resistors (R10, R27)

0.001 microfarad ceramic capacitor (C3)

Two 0.1 microfarad ceramic capacitors (C1, C4)

Two 10 microfarad electrolytic capacitors (C2, C5)

Eight green size T-1 34 LEDs (LED1–LED8)

Eight red or orange size T-1 34 LEDs (LED9–LED16)

Two LM358 op amps (IC1 and IC2)

Electret microphone

We use the Horn part #EM9745-38 electret microphone for two reasons: high sensitivity and a reasonable size that makes it easy to handle. You can use other electret microphones; see Chapter 3 for the criteria to help you choose one.

Two 830-contact breadboards

One 4 AA battery pack with snap connector

Eleven 2-pin terminal blocks

Two knobs (for the potentiometer)

Eight 2N3904 transistors (Q1–Q8)

A wooden box

We found one at a local craft supply store that was just the right size to hold the electronics for this project.

An assortment of different lengths of prestripped, short 22 AWG wire

Several feet of black 20 AWG wire

Several feet of red 20 AWG wire

94

Part II: Sounding Off!

Electrolytic capacitor

Potentiometer

Ceramic capacitor

Figure 5-3:

Important pieces of the Dance to the Music project

.

LED

Terminal block Resistor

Op amp

 

Transistors

Electret microphone

On/off switch

Taking Things Step by Step

To make the lights dance to the music, you have a few tasks to perform:

1.Build the circuit that makes it all run.

2.Assemble the lights on the surface of the wooden box that you place the circuit in.

3.Attach knobs, an on/off switch, a microphone, potentiometers, and a speaker to the box; then insert the breadboard containing the circuit in the box and connect everything.

And that’s what we cover in this section.

Building a circuit

Time to go one-on-one with your breadboard. Grab your schematic, tape it to the wall, and get going.

Chapter 5: Making Light Dance to the Music

95

Here are the steps involved in building the circuit:

1.Place the two LM385 ICs (IC1 and IC2) and 11 terminal blocks on the breadboard, as shown in Figure 5-4.

As you can see in this figure, each terminal block has connections for two wires. Here’s what the wires get from each block will be connected to:

Wires from one of the terminal blocks on the right side of the figure go to the battery pack.

Wires from the other terminal block on the right go to the microphone.

Wires from the terminal blocks in the center go to the potentiometers.

Wires from the terminal blocks on the left side of the breadboard go to the LEDs.

2.Place the eight 2N3904 (Q1–Q8) transistors on the breadboard, as shown in Figure 5-4.

IC2

IC1

Figure 5-4:

Place the LM385 ICs, 2N3904 transistors, and terminal blocks.

Q1

Q2

Q3

Q4

Q5

Q6

Q7

Q8

96

Part II: Sounding Off!

Insert each transistor lead into a separate breadboard row with the collector lead to the left side (as shown in Figure 5-4), the base lead in the center, and the emitter lead to the right. The pin designations of the 2N3904 transistors are shown in Figure 5-5.

Figure 5-5:

The 2N3904

transistor

pinout.

Emitter Collector

Base

3. Insert wires to connect the ICs, the battery pack terminal block, the microphone terminal block, and the potentiometer terminal blocks to the ground bus. Then insert wires between the ground buses to connect them to each other, as shown in Figure 5-6.

The ground buses are designated by a negative (–) sign on this breadboard.

4.Insert wires to connect the ICs, the battery terminal block, and one of the LED terminal blocks to the +V bus. Then insert wires between the

+V buses to connect them, as shown in Figure 5-7.

The +V buses are designated by a + sign on this breadboard.

5.Insert wires to connect the ICs, terminal blocks, and discrete components, as shown in Figure 5-8.

Chapter 5: Making Light Dance to the Music

97

Figure 5-6:

Shorter wires connect components to ground bus; the two long wires on the right connect the ground buses.

LED terminal block to +V

 

Battery terminal block to +V

 

Pin 8 of IC2 to +V

Pin 8 of IC1 to +V

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 5-7:

Connect components to the +V bus.

98

Part II: Sounding Off!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Potentiometer R24 terminal block to open region

Pin 7 of IC1 to open region

 

Pin 5 of IC2 to open region

 

 

 

Pin 6 of IC1 to open region

 

Pin 6 of IC2 to open region

 

 

 

 

 

Connecting two rows

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 5-8:

Hook up the IC, terminal blocks, and discrete components.

Pin 2 of IC2 to open region

 

 

Microphone terminal

Pin 3 of IC2 to open region

 

block to open region

 

 

 

 

 

 

Potentiometer R7 terminal block to open region

Pin 2 of IC1 to open region

 

 

 

Pin 1 of IC1 to open region

6.Insert wires to connect IC2 to the transistors and the base pins of the transistors to each other, as shown in Figure 5-9.

7.Insert three 0.1 microfarad capacitors (C1, C4, and C6), two 10 microfarad capacitors (C2 and C5), and one 0.001 microfarad capacitor (C3) on the breadboard, as shown in Figure 5-10.

Use both the schematic and the photo to place each component. For example, the schematic shows that the + side of C2 is connected to Pin 1 of IC1 and that the other side of C2 is connected to potentiometer R7, so insert the long lead of C2 in the same row as the wire connected to pin 1 of IC1 and the short lead in the same row as the wire connected to the terminal block for potentiometer R7.

Chapter 5: Making Light Dance to the Music

99

Pin 7 of IC2 to base of Q5

Pin 1 of IC2 to base of Q1

Base of Q1 to base of Q2

Base of Q2 to base of Q3

Base of Q3 to base of Q4

Figure 5-9:

Connect IC2 to transistors.

Base of Q7 to base of Q8

Base of Q6 to base of Q7

Base of Q5 to base of Q6

8.Insert eight 1 kohm resistors (R15–R18, R32–R35) from the emitter pins of each transistor to the ground bus, as shown in Figure 5-11.

9.Insert one 2.2 kohm resistor (R1), one 2 kohm resistor (R2), two 47 kohm resistors (R3 and R4), one 100 kohm resistor (R5), two 5 kohm resistors (R6 and R8), one 1 kohm resistor (R9), one 5 kohm resistor (R6), and one 220 kohm resistor (R10) on the breadboard, as shown in Figure 5-12.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]