Experiment 8: Adventures in Audio - Make: More Electronics (2014)

Make: More Electronics (2014)

Chapter 8. Experiment 8: Adventures in Audio

It’s time to venture into the fascinating world of analog devices. In an analog circuit, voltages can be below zero, as well as above; they can fluctuate in mysterious and unpredictable ways; and the voltage you get at the output can be 100 times the voltage at the input—or more.

Our journey will begin with a microphone and an amplifier. Because of the fickle behavior of components in the analog world, you’ll need ways to find out exactly what is happening in a circuit, and this will require a detour into methods of measurement (which is why I included an exercise in transistor measurements in Experiment 2).

After acquiring some necessary knowledge, in Experiments 13 and 14 you can ultimately build an entertaining gadget that fights noise by making more noise. I have to warn you, though, that like any quest into the unknown, this one will involve at least one wrong turn before we find our way through to a successful conclusion.

Amping Up

Near the center of the analog world we find one component: the op-amp. Its name is an abbreviation for “operational amplifier.”

The op-amp existed before the comparator. In fact, the comparator evolved from the op-amp, but I showed you the comparator first because its simple high or low output provided an easier introduction.

Both components share the same schematic symbol, because they both work by comparing two inputs. Their purposes are different, though. Comparators are mostly used to get rid of annoying intermediate voltages by using positive feedback. Op-amps usually need to preserve every little intermediate fluctuation in the input, and for this purpose, as you’ll see, they use negative feedback.

Introducing the Electret

A microphone provides a simple and convenient way to demonstrate the capabilities of an op-amp, so that’s where I’m going to start. An electret type of microphone is available very cheaply (often, for less than $1), and its performance is sufficiently good that it is used in dozens of consumer-electronics devices, from cell phones to intercoms to gaming headsets.

Why is an electret called an electret? It contains a piece of ELECTRostatically charged film that behaves a bit like a magnET, being permanently charged. Sound waves change the capacitance between the film and another element adjacent to it. A tiny preamplifier built into the microphone senses these changes and generates an output. The output is still very small, which is why we need an op-amp to amplify it some more.

Some electrets have three terminals, but the two-terminal type is more common, and I’ll be using it here. One of those terminals has to be connected to negative ground, but at first glance, there’s no way to distinguish it from the other. Worse still, the manufacturer’s datasheet probably won’t tell you which is which. For reasons that remain unknown (to me, anyway), electret documentation is very uninformative compared with the datasheets for most other types of components.

Fortunately, the ground terminal can be identified with just a little detective work. When you look at the underside of an electret, you should find that there is a translucent insulating layer, beneath which you can see some metal fingers reaching out from one of the terminals to the cylindrical shell. This is the negative, or ground, terminal.

Take a look at the undersides of two electret microphones in Figure 8-1. One of them is manufactured with leads attached, while the other just has solder pads for surface-mount applications. In each case, you can see little green metal fingers extending from the righthand terminal, which is the ground terminal.

The undersides of two typical electret microphones, one with leads, the other with solder pads for surface-mount. The ground terminal is on the right in each case, as indicated by the metal “fingers” visible through the green translucent insulating layer.

Figure 8-1. The undersides of two typical electret microphones, one with leads, the other with solder pads for surface-mount. The ground terminal is on the right in each case, as indicated by the metal “fingers” visible through the green translucent insulating layer.

There are a few electrets that don’t resemble the ones in my photographs. They may have larger terminals, or an insulating layer that isn’t green. You should still be able to see a silver-colored or gold-contact connection between one terminal and the shell of the microphone, just under the insulating layer.

If your electret doesn’t have leads attached, you’ll need to solder on your own, so that you can plug it into a breadboard. You can use a couple of pieces of 24-gauge wire, with appropriately colored insulation to remind you which terminal is which.

Figure 8-2 shows the desired result.

An electret that lacks leads must have short pieces of wire soldered to it for breadboard work, as shown here. The wires should have appropriately colored insulation.

Figure 8-2. An electret that lacks leads must have short pieces of wire soldered to it for breadboard work, as shown here. The wires should have appropriately colored insulation.

Like any small component, an electret microphone can be damaged by heat, and if you’ve added your own leads, you may be wondering if the component has survived its ordeal. So let’s find out.

Can You Hear Me?

In a circuit schematic, a microphone can be represented by any of the symbols shown in Figure 8-3. The symbols in the top row can be used for any microphone, while those in the bottom row are used specifically for electrets. The part inside the circle that looks like a capacitor represents the plates that are contained in the electret.

Various schematic symbols are used to represent a microphone. Almost always, sound waves are imagined to enter from the left. The symbol at top-right can be confusing, as it may also represent an earphone or headphone if it faces the other way. The two symbols at the bottom specifically represent electret microphones, but many schematics that require an electret use a generic symbol to represent it.

Figure 8-3. Various schematic symbols are used to represent a microphone. Almost always, sound waves are imagined to enter from the left. The symbol at top-right can be confusing, as it may also represent an earphone or headphone if it faces the other way. The two symbols at the bottom specifically represent electret microphones, but many schematics that require an electret use a generic symbol to represent it.

I’ll use the symbol at bottom-left, as it’s slightly more common than the symbol at bottom-right.

In Figure 8-4 you’ll find a schematic for the simplest possible microphone test. You’ll see that it bears an uncanny resemblance to the test circuit that was shown for a phototransistor in Figure 4-2. This is because both components contain an integrated transistor amplifier with an open-collector output. By the time you reach the end of this book, you’ll find that almost every sensing device these days has that kind of output.

The simplest possible circuit to verify the functionality of an electret microphone.

Figure 8-4. The simplest possible circuit to verify the functionality of an electret microphone.

Note that I am suggesting a 9VDC power supply. A 9V battery will do the job, and you don’t need to add a regulator or smoothing capacitors. I’ve shown a 4.7K resistor, but you may substitute a resistor with a value as low as 1K. Here again the datasheets for microphones tend to be uninformative, and after you build the audio circuits that I’m going to describe, you can try various resistor values to find out which works best with your electret. By this I mean which value results in the best combination of sound volume and quality.

Install your electret with correct polarity, and set your meter to measure AC voltage. Yes, AC, not DC! Any DC voltage that you measure will not be meaningful.

If your meter does not have autoranging, be sure to select millivolts, not volts.

Apply the meter probes, and after the reading has stabilized, you should see a very small voltage—perhaps 0.1mV. Now make an “Aaah” sound into the microphone, and the voltage should jump up to between 10mV and 20mV. Your electret is listening and responding to you.

§ Because microphones are relatively sensitive devices, it’s not a good idea to test them by tapping them or blowing on them. You should test them with sound waves, the stimulus for which they are intended.

Background: Microphone Miscellany

The first practical, mass-produced microphone was developed for use in telephones. Patented by Thomas Edison in 1877, it consisted of carbon granules compressed between two plates. One of the plates vibrated in response to sound waves, and each tremor pushed the carbon granules momentarily closer together. This lowered their overall resistance and modulated a DC current passing through them.

Carbon microphones were primitive devices with a very limited frequency response, but they were cheap and rugged, and were still being used in telephones as late as the 1950s (even later, in some countries).

The condenser microphone was an innovation that varied the capacitance of two electrically charged plates in response to sound waves. It functioned similarly to an electret, but required a constant polarizing voltage. “Condenser” was an early term for a capacitor.

Ribbon microphones, such as the early Shure series used by rock artists of the 1950s (including Elvis Presley and James Brown), contained a metallic ribbon that vibrated in response to sound. This design was displaced by moving coil microphones, which function like a loudspeaker or headphone in reverse. A diaphragm causes a coil to vibrate in a magnetic field, inducing current in the coil.

The big challenge in microphone technology has always been to create a mechanical design that responds equally to a wide range of sound frequencies. When the electret microphone was developed at Bell Labs in the 1960s, its performance was limited by available materials. Developments in the 1990s greatly enhanced the component to the point where it now performs almost as well as the old high-end moving coil microphones, but at a fraction of the price.

Ups and Downs of Sound

In Figure 8-4, the electret responds to an external signal by sinking current through an external resistor. As I just mentioned, this is an open-collector system very similar to that used in a phototransistor, but quite apart from the higher values for the pullup resistor and the power supply, there is a much more significant difference. You measure AC from the microphone instead of DC.

This is because audible sound consists of alternating pressure waves, which range in frequency from around 20Hz to 15KHz (although some people claim to be able to hear up to 20KHz). By comparison, a phototransistor responds to light waves, which have such a high frequency, they can be thought of as being a steady source of energy. This is why the phototransistor appeared to create a DC voltage.

The frequency of sound is much lower, and because it induces nerve impulses by vibrating a diaphragm in the ear, we have to preserve the fluctuations to maintain their audibility.

In Figure 8-5, the upper section of the figure shows a person making a sharp sound that travels as a high-pressure wave, shown in white. Because the vocal cords fluctuate to and fro to make the sound, the wave of relatively high pressure is followed by a wave of relatively low pressure, shown in black in the figure.

Because I am talking about “relative” pressure, you may be wondering, “Relative to what?” The answer is, relative to ambient air pressure—the pressure that is all around us. This is shown in gray in the figure.

The lower half of the figure shows the ideal electrical output that should result from the sound input. The voltage varies as a precise imitation of the varying pressure of the sound waves, fluctuating above and below a reference level of 0 volts that corresponds with ambient air pressure. This means that our op-amp must accept voltages that are both more-positive and more-negative than the reference level—and indeed, most op-amps are designed to do this.

A good amplifier will create an output in which the variation in voltage matches the variation in pressure created by the sound input.

Figure 8-5. A good amplifier will create an output in which the variation in voltage matches the variation in pressure created by the sound input.

For this purpose, they often require what is known as a split power supply. A typical supply could provide +12VDC, 0V, and −12VDC. For the experiment in this section of the book, we’ll need +4.5VDC, 0V, and −4.5VDC. This is an annoying requirement, because most other types of components do not require a split supply, and I’m sure you don’t want to buy an entirely separate power supply just to satisfy the needs of an op-amp. Fortunately, there is a workaround that I will use in our op-amp experiments.

The workaround is simple enough in theory, because the high voltages and low voltages are only “relative” to the zero voltage, just as high pressure and low pressure are relative to ambient pressure. So, for example, instead of +4.5VDC, 0V, and −4.5VDC, we could use +9VDC, +4.5VDC, and 0V. Because the differences between high, middle, and low voltages are the same, the components in the circuit won’t notice any difference.

But if we only have a 9V battery, how do we create that intermediate +4.5VDC voltage? Figure 8-6 shows the answer. The top section of this figure is what we want, while the middle section shows how we can simulate it with a simple voltage divider, using two resistors of equal value.

Ideally an op-amp should have a split power supply, with a neutral center reference value that is depicted by a ground symbol in schematics, as shown in the top section of this figure. The split supply can be emulated with a voltage divider, as in the middle section. But the center value will be affected by any component sinking power into it (or drawing current from it), as shown in the bottom section.

Figure 8-6. Ideally an op-amp should have a split power supply, with a neutral center reference value that is depicted by a ground symbol in schematics, as shown in the top section of this figure. The split supply can be emulated with a voltage divider, as in the middle section. But the center value will be affected by any component sinking power into it (or drawing current from it), as shown in the bottom section.

Unfortunately there is a snag to this. If you attach a component between the 9VDC bus and the 4.5VDC midpoint of the voltage divider, the resistance of the component is now in parallel with the left half of the voltage divider. This is shown in the bottom section ofFigure 8-6. Now we don’t know exactly what the voltage at the central point is, because the component has altered the resistance between the positive power supply and the midpoint of the voltage divider. This will tend to increase the midpoint voltage above 4.5VDC.

The best we can do to deal with this problem is use relatively low resistor values, while any component attached to the midpoint of the voltage divider should have an effective internal resistance that is as high as possible. It will still affect the midpoint voltage to some extent, but the effect will be minimized.

I’ll be coming back to this issue in our next experiment.