The amplifier is the first step in the circuit, it increases the amplitude of the signal from around + or - 200mV to + or - 2.5V (ideally). The other function of the amplifier is to protect the audio source (the thing generating the audio signal in the first place) from the rest of the circuit. The outgoing amplified signal will source all its current from the amplifier, so any load put on it later in the circuit will not be "felt" by the audio source (the microphone element in my case). Do this by setting up one of the op amps in the TL072 or TL082 package in a non-inverting amplifier configuration
The datasheet of the TL072 or TL082 says that it should be powered with +15 and -15V, but since the signal will never be amplified above + or - 2.5V it's fine to run the op amp with something lower. I used two nine volt batteries wired in series to create a + or - 9V power supply.
Wire up your +V(pin 8) and -V(pin 4) to the op amp. Wire the signal from the mono jack to the non-inverting input (pin 3) and connect the ground pin of the jack to the 0V reference on your voltage supply (for me this was the junction between the two 9V batteries in series). Wire a 100kOhm resistor between the output (pin 1) and inverting input (pin 2) of the op amp. In this circuit I used a 10kOhm potentiometer wired as a variable resistor
to adjust the gain
(the amount that the amplifier amplifies) of my non-inverting amplifier. Later in this Instructable, I'll show how you can add an LED indicator to Arduino pin 13 to let you know when you have this pot turned up too high (resulting in clipping
of the incoming signal by the Arduino); this way you know when you should turn the pot down and get the signal back in the range you want (amplitude of ~2.5V). Wire this 10K linear taper pot between the inverting input and the 0V reference.
The following equation describes the relative amplitudes of the signal before and after the non-inverting amplifier:
Vout =~ Vin * (1 + R2/R1)
Vout/Vin =~ 1 + R2/R1
where R2 is the feedback resistor (between the output and non inverting input), R1 is the resistor to ground, Vout is the amplitude of the outgoing signal (the output from the amplifier), and Vin is the amplitude of the incoming signal (the input to the amplifier)
In this circuit R2 is a 100kOhm resistor and R1 is a 10kOhm potentiometer (variable resistor). By turning the pot you can change the resistance of R1 from 0Ohms to 10KOhms. Here are some example calculations:
When the pot is turned all the way to the left the resistance of R1 is 10kOhms and the ratio of Vout to Vin is about:
1+ 100/10 = 11
A signal coming out of the microphone with an amplitude of 200mV (which is fairly loud on my microphone) will be amplified to:
200mv * 11 = 2200mV = 2.2V
this is right in the range we want (amplitude close to 2.5V without going over)
Turning the pot to its halfway position will give it a resistance of 5kOhms, we can calculate the ratio of Vout to Vin again:
1+ 100/5 = 21
now the amplitude gets multiplied by 21
this is too much amplification for the 200mV signal:
200mV * 21 = 4200mv = 4.2V >> 2.5V
but this amplification would be perfect for a 100mV signal:
100mV *21 = 2100mV = 2.1V =~ 2.5V
Turning the pot farther to the right will keep decreasing the resistance of R1 and increase the amplification (also called gain
) of this amplifier theoretically to infinity. Obviously at some point the amplifier will not be able to power a signal with a huge amplitude, but you get the idea. By adjusting the potentiometer you can adjust the gain of the amplifier and tune the sensitivity of the microphone while still keeping it in a range that the Arduino likes.
Note: As you can see in the circuit above, this project only uses one of the two available op amps in the TL072/TL082 package. I used this chip because they are easily sourced (you can even buy the TL082 at Radioshack
these days), they are basically the same price as the single op amp packages (TL071 and TL081), and you may want to use the extra op amp somewhere else on your circuit (another channel of input, an audio out circuit...). But if you have a TL071 or TL081, it will do fine for this project.