Microphone + amplifier + speaker = fun! :D
In this lab we used all the knowledge we've gained thus far in the semester to build a circuit that takes in a signal from a microphone, amplifies that signal, and then feeds it to a speaker.
Setting the Gain
To get us started we were given the diagram above. We were then tasked with designing CKT #1 so that there would be a reasonable voltage gain and reasonable was defined as having the output voltage be in the range 0V to 3.5V.
We then built this circuit with a 10kΩ resistor in the place of CKT #1 and drove it with a 1kHz sine wave at Vpp = 20mV and no DC offset in order to test that it works as expected. As expected from the lab write-up the output is clipped on the low-voltage (negative voltage) side since the input is symmetric about zero due to being a sine wave and the output cannot go below the value of ground which is 0V. Also we found that the ration of input to output amplitudes in the unclipped regions was approximately 100 as we expected as can be seen in the photo below:
The scale of the yellow is 500mV while the scale of the blue is 5mV showing that there is in fact a 100x increase.
Next we increased the input amplitude gradually in steps of 5mV and watched what happened to the output. When we reached input values above 4V the output was clipped at roughly 4V. This makes sense because the maximum output voltage is approximately 1.5V below the positive supply which is +5V. You can see this clipping in the image below:
Volume Control
The next step in our mission to build an awesome microphone to speaker circuit is to have a volume control knob. First, we needed some sound output so we connected a buzzer as our speaker. The buzzer had one pin grounded and the other connected to the amplifier output. The presence of the buzzer in the circuit changed the output signal as can be seen in the photo below:
Now that we had a volume output, we modified our CKT #1 to give us control over the volume. We did this by adding a potentiometer in series with the resistor that was previously all of CKT#1 with the potentiometer's other side being connected to ground. Since the potentiometer has a resistance of its own ranging from 0Ω to 10kΩ, we swapped the 10kΩ resistor that was previously in CKT#1 with a 5kΩ resistor. This will give our amplifier a gain between 200x when potentiometer is set to 0Ω and 67x when potentiometer is at 10kΩ. Gains were calculated from the ratio of 1MΩ and the resistance of CKT #1.Avoiding Clipping
Now we must change the circuit so that the signal doesn't get clipped below 0V in order to "have room" for the voltage swings of the audio signal. To do this we will make the signal sit on a DC offset. The lab write-up tells us this offset will be 1.75V, however when we drive the circuit with a 20mVpp 1kHz sine wave from the function generator and gradually raise the DC offset by 10mV at a time we find that the output saturates and hits a rail at only a DC offset of approximately 70mV. This is because the DC offset is being routed through the op amp and also receiving a gain of 100.
To prevent the DC offset portion of the signal from being amplified we want the op amp to act as a follower at DC, but an amplifier at AC. This is what a high-pass filter does, so we accomplished this by further modifying CKT#1 to include a high-pass filter. We added a capacitor between the 5kΩ resistor and the rest of the circuit. To select the value of the capacitor we used the formula 1/(w*C) = Zcap < 5kΩ and the fact that we need 20Hz to pass through the amplifier to calculate the capacitance from the following: 1/(2*pi*20*C) = 5000Ω. We end up with C = 1.5 microFarads and since we didn't have a 1.6 microFarad capacitor we used one 1.2 microFarad capacitor and three 0.1 microFarad capacitors in parallel to achieve that value. You can see the resulting circuit (and the several capacitors) in the photo below:
We confirmed that the DC offset at the output is equal to the DC offset at the input while the AC signal is amplified and you can see this in the photo below:
However, the amplifier does not have the same gain at all frequencies and thus the amplifier has distortion. The change in gain between 20Hz and 20kHz was 2.16V to 780mV and thus we know that the amplifier is distorted by a factor of 3.
Now that we have a circuit that will take in a signal and output a volume controlled audio output through the speaker that is not clipped and has "space" to swing as needed, we need to change the circuit so that the input signal comes from the microphone instead of the function generator. We added the microphone to a separate section of the breadboard and set it up as shown in the photo below:
We confirmed that the microphone worked by connecting the Vout of the circuit shown above to the oscilloscope. We could see amplitude changes on the oscilloscope when we spoke into the microphone, but as we have no clue what the signal pattern of our voice should look like we also tested it with a tuning fork. Tuning forks produce a sine wave signal and you can see that test in the video below:
It's important to note that even though the signal in the video is a sine wave it did not come from the signal generator, but from the microphone. We just wanted to make sure everything worked as expected and thus used a tuning fork so that we would know what the output should look like (a sine wave). We tried several different tuning forks and we also raised and lowered our voices in pitch while talking in to the microphone and the higher the pitch the faster/higher the frequency of the signal output.
Connecting the Microphone to Amplifier
Now that we have confirmed that the microphone is working as expected, we need to connected to the amplifier and speaker. However, we cannot just directly them because the microphone's output is a +5V DC signal with a very small AC signal of roughly 20mV on top. This DC signal is too much for our amplifier so we need to remove it from the microphone signal before it reaches the amplifier. However, as we know from the "Avoiding Clipping" section of this lab, we do need some DC offset, specifically 1.75V. To accomplish this we need to design another circuit, CKT#2, to connect the microphone to the rest of the circuit via the (+) input of the amplifier.
First, in order to cut the +5V DC offset off of the microphone signal and isolate the AC signal we need to use a high-pass filter. Then to add back in a 1.75V portion of a DC voltage we need to use a voltage divider made of two resistors. We can combine the high-pass filter and the voltage divider so that the the bottom resistor of both is the same. A sketch of this circuit can be seen below:
Now we just need to determine the values of the components in the sketch above. We will use a +5V voltage source since we have the option of 5 or 12V. The two resistors need to have a ratio of 0.65 in order to pass 1.75V from the 5V voltage source and we want them to be very high in order to have lower power dissipation (P = V^2/R). Thus we chose the values of 1MΩ and 560kΩ (closest to 538kΩ which is the calculated value) for the resistors. Now for the capacitor, we know we want our high-pass filter to pass 20Hz so we use the formula 1/(2*pi*R*20) = C to get a capacitance value of 0.113 microFarads which we rounded to 0.1 microFarads.
Now that all of our components have values, we build the circuit! We lengthened the distance between the microphone and speaker using more of the cables to connect the pins of the microphone and the speaker to the correct spots on the bread board. The circuit worked!!! And it was very fun to play with :).
Unfortunately I don't have any good videos of the microphone and speaker working because there was so much ambient noise in the room and the microphone on my phone isn't very good.
During my playing with the speaker though, I noticed that high frequencies came through more clearly and more loudly than low frequencies. This was especially noticeable when I used the child's xylophone that was in the blue cabinet to produce an octave of frequencies. I think the clarity of the high tones versus the low tones has to do with the properties of our high pass-filter, but it might also be because of the properties of the buzzer itself or even human hearing which is logarithmic. It would be very interesting to explore this further and see what is the cause and how best to compensate. I wonder if this is why speakers for phones and smaller devices often sound "tinny" and don't produce bass notes well.































