Make: More Electronics (2014)
Chapter 9. Experiment 9: From Millivolts to Volts
In the previous experiment, you determined that your electret was working. Now we can begin to make it do something useful.
Putting a Cap on It
The first step is to install a coupling capacitor, as shown in Figure 9-1. If you remember the basics, you already know that it will block DC voltage while allowing a pulse to pass through. In fact, depending on the size of the capacitor, it will be transparent to many small voltage fluctuations—such as those in an AC audio signal.
Figure 9-1. This simple test with a multimeter demonstrates that the capacitor blocks DC voltage while passing an AC audio signal.
First try measuring DC volts (relative to negative ground) above and below the capacitor. You should find that at the upper measurement point, you have almost the full 9VDC from your battery. At the lower point, you only have a tiny fraction of a volt, because the capacitor is blocking the DC voltage. (If the capacitor is doing its job well, you should not be able to measure any voltage at all.)
Now if you reset your meter to measure AC millivolts, and do your “Aaah” test again with the microphone, you should get almost the same reading from above and below the capacitor. The lessons are simple but important:
§ The capacitor removes the 9VDC from the signal.
§ The capacitor allows the AC signal from the microphone to pass through.
We do not want our op-amp to amplify the DC voltage. But we do want it to amplify the AC signal from the microphone. Therefore, the capacitor is just what we need to couple the microphone with an amplifier.
If you’re wondering why the capacitor value happens to be 0.68µF, that’s a more difficult question. A larger-value capacitor generally should work better in this kind of application, but bigger capacitors tend to cost more than smaller capacitors, and a smaller capacitor should filter out some high frequencies, which may be desirable. You can try various capacitor values, repeat the “Aaah” test, and see if you measure any differences.
Introducing the Op-Amp
Time, now, to amplify the microphone signal. A bipolar transistor is not the right tool for this job, because it will amplify current rather than voltage. We need a voltage amplifier. You already saw in Experiment 6 that a comparator will amplify voltage, because its power supply does not have to be the same as the voltage applied to its open-collector output. An op-amp can function in a similar way. It can convert the plus-or-minus 20 millivolts from your microphone into an output of plus-or-minus 2 to 3 volts.
I’m going to use the LM741 as our op-amp. It’s one of the oldest chips around but is still manufactured and used in large quantities because it’s cheap, easily obtainable, and does the job. The pinouts are shown in Figure 9-2, and you’ll see that unlike the LM339, which contained four comparators, the LM741 contains just one op-amp. As I noted before, the symbol for an op-amp is the same as the symbol for a comparator, because they both work by comparing two inputs. If you are looking at a schematic and wondering whether the triangular symbol is identifying an op-amp or a comparator, the part number and the accompanying text should make that clear.
Figure 9-2. The primary pin functions of an LM741 op-amp. Pins 1 and 5 are included for calibration, but are not often used. Pin 8 has no internal connection.
What’s the Difference?
Here’s the plan. I’m going to apply a 4.5VDC voltage to the inverting input of the op-amp (the one with the minus sign) by using a voltage divider. This will be my reference voltage. I’m going to apply 4.5VDC separately to the noninverting input (the one with a plus sign) using another voltage divider, and will add the signal from the microphone (through the coupling capacitor) to the noninverting input. This will make the voltage on the noninverting input fluctuate above and below the 4.5VDC level, as illustrated in the top half ofFigure 9-3, where the input signal is the wavy green line and the 4.5 voltage is shown as a horizontal black line.
The op-amp will amplify the differences between the noninverting input and the reference voltage on the inverting input, ideally creating an output as shown in the bottom half of Figure 9-3.
Figure 9-3. The basic concept of an op-amp is to amplify the differences between an input signal and a reference voltage (4.5VDC in this example). The input is shown here in green, the output in orange, and the reference voltage is a horizontal black line. The variations shown by the green line have been exaggerated to be visible.
For this to work, I need to apply the same basic reference voltage to both of the inputs of the op-amp—although one will have the alternating voltage from the microphone added to it. This means I need two separate supplies of the same voltage. I can use two separate voltage dividers, but to make sure they deliver the same voltage, the two resistors in each divider must be accurately matched with each other.
Figure 9-4 shows how the circuit will look. It can be built as an add-on to the simple electret test circuit that you created previously.
Figure 9-4. Setting up two voltage dividers to test the op-amp. If your battery does not provide exactly 9VDC, the voltage at the midpoint of the A divider will not be exactly 4.5VDC. It should be half of the actual battery voltage. (This circuit is intended to clarify the way the op-amp functions. It is not typical of real-world applications.)
The microphone isn’t connected yet. I’ll get to that in the next step. First we have to deal with the problem of matching the resistors.
A Perfect Pair
Because of manufacturing imperfections, the actual values of resistors will vary. If they have a 5% tolerance, 100K resistors can have actual values as low as 95K and as high as 105K. Even if they are manufactured to a 1% tolerance, they can range between 99K and 101K.
To deal with this, you will have to use your meter to find a “matched pair” of resistors. Here’s how you do it.
Measure the values of, say, ten 100K resistors. Select two that have identical values, at least within the limits of accuracy of your meter. It doesn’t matter what the resistor values are, so long as they are almost the same as each other. Use them as the “A” pair inFigure 9-4.
Select another two that have identical values, and use them as the “B” pair. To avoid confusion, try to be methodical about this, laying out your resistors until you find a couple of good pairs, as shown in Figure 9-5.
Figure 9-5. Finding two matching pairs of 100K resistors.
Notice that each “A” resistor does not have to be the same as each “B” resistor. The “A” resistors just have to have the same resistance as each other, and the same is true of the “B” resistors.
§ When measuring resistance, don’t press the probes of your meter against the leads of a resistor while holding them in your fingers. The resistance of your skin will give you an erroneous value. Lay each resistor on an insulator such as a dry piece of plastic, paper, cardboard, or wood before you press the probes against its leads. Alternatively, consider setting up the resistor-testing mini-breadboard that I described in the introduction to this book. See Figure 18.
Are you wondering if you will have to go through this time-consuming process of selecting resistors every time you use an op-amp? No, definitely not! Matching the resistors is necessary only in this test circuit, because I will be using it later to make some accurate measurements of op-amp performance. Also, having two voltage dividers makes it easy to see what’s going on in the circuit.
Measuring the Output
After you create the circuit in Figure 9-4, test the voltages on the inverting and noninverting inputs, relative to negative ground. They should both be equal to half of your battery voltage (which may be slightly more or less than 9VDC). If there is a tiny difference, don’t worry about it. If there is a significant difference (such as one input being 4.7VDC and the other being 4.4VDC), you didn’t select your resistor pairs carefully enough.
Now you’re ready to complete the circuit by wiring the microphone into it. This is shown in Figure 9-6.
Figure 9-6. Complete circuit for verifying op-amp performance with an electret microphone.
A photograph of the breadboarded version appears in Figure 9-7.
Figure 9-7. A circuit to assess the amplified output from an electret microphone. The red and blue jumper wires below the circuit are connected with a meter set to measure AC volts. The power supply for the buses of the breadboard is a 9V battery (not shown here).
The microphone section has been linked with the noninverting input of the op-amp through the coupling capacitor and a 1K resistor. The output from the op-amp passes through another coupling capacitor, and you measure it with your meter set to AC volts—not millivolts, anymore, because the voltage will be amplified.
§ Note that unlike the LM339 comparator, which has an open-collector output that requires a pullup resistor, the LM741 has a “real” output capable of delivering a small amount of current. No pullup resistor is needed.
If you attached your meter between the output pin of the op-amp and the center point of the “A” voltage comparator, you’d be measuring deviations above and below the reference voltage. But after the op-amp output has passed through another coupling capacitor, the DC component of the signal is blocked, and you can now measure the signal with reference to 0V ground.
Make an “Aaah” sound into the microphone, and sustain it to give your meter time to respond and stabilize. You should find that an input of around 20mV from the microphone creates an output of greater than 2V. The op-amp is increasing the voltage by a factor of more than 100:1. This is known as its gain.
Now, how can we use this amplified output? We can use it in many ways, beginning with the very next experiment.