Electret Microphone

Hi. I'm new to the arduino and have no formal knowledge on electronics. I just got an electret microphone and, for starters, would like to use it to monitor sound volume in a room. I looked at the data sheet and realized the mic has some kind of amplifier in it, so I supplied it with 5V from the arduino using an 8?? resistor. However, I guess the signal was still not strong enough. So, I tried using a TL082CP op amp http://www.datasheetcatalog.org/datasheet2/1/02rs8oykg9u7xo6h1lrftr6jx6ky.pdf. I connected 2 9V batteries in series and brought the voltage down to 15V using a voltage divider. I connected the 15V to pin 8 of the op amp. Then, I connected pin 4 to ground, the positive terminal of the 5V-supplied microphone to pin 3, and its negative terminal to pin 2. I then connected pin 1 to A0 of the arduino. However, the microphone does not seem to be responding and I think it has something to do with the op amp, rather than the mic itself. Can anyone help me?

Make sure that you don’t supply a negative voltage to the Arduino. It will cause damage.

and brought the voltage down to 15V using a voltage divider

You can't use resistors voltage divider in this case, use voltage regulator. Here is drawings, how connect electret mic to arduino, NE5532 could be replaced by LM358. http://coolarduino.wordpress.com/2012/06/22/audio-input-to-arduino/

What microphone? Datasheet link? Is it balanced output with phantom power or unbalanced with bias supply?

opamp circuits must have negative feedback, if you've not got a negative feedback network you are doing something wrong.

I would not use an LM358 for a microphone amplifier, its not low noise, the NE5532 is far superior in that regard. However it is inconvenient not using a rail-to-rail opamp, a good low-noise one I've used recently is the AD8656, 2.7nV/root-Hz (The LM358 is 55nV/root-Hz, 26dB worse)

For more information on how your electret is likely to be configured, see the Wikipedia article, with schematic: http://en.wikipedia.org/wiki/Electret_microphone

It sounds as though you're using your op-amp incorrectly:- You're putting the electret across the inputs. In normal operation, there's a DC voltage across the electret, so, when it's across the inputs, the op-amp's output will be either at the positive rail or at the negative rail. The op-amp isn't in its operating range unless the voltage between the input pins is very, very close to zero. - It's certainly unusual to use a voltage divider as a power supply. It's usually ineffective, and it didn't really help, since the op-amp is rated for +/- 15V power supplies.- You don't say how you connected the grounds of the battery system and the Arduino, and it matters. Depending on where it's connected, the input voltage to the Arduino could be ground, 9V, or somewhere around 12V. Two of those voltages can damage the Arduino. Op-amps are great. A well-chose circuit may be the answer for you. But, if you try to use one without understanding how it works, or what you're circuit does, you're likely to be frustrated at best, and surrounded by thin blue smoke if you're less lucky.

I think that the best course is to start with the electret circuit, and verify that it's working. I'd try connecting it just the way that you did in the first place: 8k resistor to 5V, positive end of the electret to the 8k, negative end of the electret to ground. Then, measure the voltage across the electret. If the electret is going to work, that voltage needs to be somewhere between, say, 1.5 and 3.5 volts. It'll work best if the voltage is right at 2.5V DC - right in the middle of the power supply voltage. You can adjust that voltage by changing the resitor between the electret and 5V. A smaller resistor will raise the voltage, a bigger one will lower it. It would be great if we could calculate the resistor, but, in my experience, documentation on electrets is notoriously lacking in hard information. After that, we'll try to detect a response from the electret.

Give it a try, and tell us what you got. If you can't get the electret voltage into that range, it might be connected backwards, or it might have failed during its earlier adventures.

Thank you all for your quick replies.

dxw00d: Make sure that you don't supply a negative voltage to the Arduino. It will cause damage.

I see. Well, I haven't caused any damage yet, I hope, but how much negative voltage can the arduino handle?

Up to a massive -0.5V.

tmd3: For more information on how your electret is likely to be configured, see the Wikipedia article, with schematic: http://en.wikipedia.org/wiki/Electret_microphone

It sounds as though you're using your op-amp incorrectly:- You're putting the electret across the inputs. In normal operation, there's a DC voltage across the electret, so, when it's across the inputs, the op-amp's output will be either at the positive rail or at the negative rail. The op-amp isn't in its operating range unless the voltage between the input pins is very, very close to zero. - It's certainly unusual to use a voltage divider as a power supply. It's usually ineffective, and it didn't really help, since the op-amp is rated for +/- 15V power supplies.- You don't say how you connected the grounds of the battery system and the Arduino, and it matters. Depending on where it's connected, the input voltage to the Arduino could be ground, 9V, or somewhere around 12V. Two of those voltages can damage the Arduino. Op-amps are great. A well-chose circuit may be the answer for you. But, if you try to use one without understanding how it works, or what you're circuit does, you're likely to be frustrated at best, and surrounded by thin blue smoke if you're less lucky.

I think that the best course is to start with the electret circuit, and verify that it's working. I'd try connecting it just the way that you did in the first place: 8k resistor to 5V, positive end of the electret to the 8k, negative end of the electret to ground. Then, measure the voltage across the electret. If the electret is going to work, that voltage needs to be somewhere between, say, 1.5 and 3.5 volts. It'll work best if the voltage is right at 2.5V DC - right in the middle of the power supply voltage. You can adjust that voltage by changing the resitor between the electret and 5V. A smaller resistor will raise the voltage, a bigger one will lower it. It would be great if we could calculate the resistor, but, in my experience, documentation on electrets is notoriously lacking in hard information. After that, we'll try to detect a response from the electret.

Give it a try, and tell us what you got. If you can't get the electret voltage into that range, it might be connected backwards, or it might have failed during its earlier adventures.

  • So, does that mean that I can't use an op amp to amplify the already pre-amplified electret microphone?
  • Oh, that +/-15V means that it need to be supplied with an AC of +/-15V. I though it meant that either will do.
  • I connected the negative terminal of the first battery to the arduino's ground pin, its positive terminal to the other battery's negative terminal, and the second battery's positive terminal to the voltage divider.

I tested the electret circuit and I'm getting a reading of approximately 3.1V. However, as I suspected, I cannot see the voltage spike generated by sudden noise as my voltmeter is not fast enough (at least I think that's why). So, I guess the electret circuit is working. Since the voltage is high enough to be measured by the arduino though, is there a way to "slow it down" for the arduino to read?

Grumpy_Mike: Up to a massive -0.5V.

Oops. I hope I didn't burn anything out. Thanks by the way.

So, does that mean that I can't use an op amp to amplify the already pre-amplified electret microphone?

No it does not. It means you have to make sure you don't apply voltages outside the supply rails of the arduino to the arduino.

that +/-15V means that it need to be supplied with an AC of +/-15V.

No no no, you always give it DC.

I connected the negative terminal of the first battery to the arduino's ground pin, its positive terminal to the other battery's negative terminal, and the second battery's positive terminal to the voltage divider.

What? Can you draw a diagram?

is there a way to "slow it down" for the arduino to read?

I think it might be time to do a bit of theory reading. The arduino is fast enough to sample any audio signal.

Gepapado:
So, does that mean that I can’t use an op amp to amplify the already pre-amplified electret microphone?

No, it just means that it’s not as simple as hooking the electret across the op-amp’s inputs. A simple way to amplify the electret’s AC signal might be to capacitively couple the output to a single-supply op-amp circuit, biased at VCC / 2. You can find a link to single-supply op-amp circuits in the Wikipedia article, “Operational amplifier applications.” It wouldn’t hurt to read read up on operational amplifiers in general, either.

Oh, that +/-15V means that it need to be supplied with an AC of +/-15V.

It doesn’t mean AC. Do not attempt, because it will destroy your op-amp. You really do need to read up on op-amps before you try to design an op-amp circuit again. Your operational amplifier will function with 30V DC between VCC+ and VCC-. There’s also an indication that it will function at anything between 10V DC and 30V DC. So, an appropriate power supply might be two 9V batteries in series, with the most negative terminal connected to VCC-, and the most positive to VCC+, and the junction between the two batteries as ground, and tied to your Arduino ground. For the steady state, if you used a unity-gain circuit, you could connect that to an Arduino pin. With that rig, though, you’d want to apply some protection to your Arduino input, since the output voltage of the op-amp could easily go to something like +6V or -6V - outside the allowable range of -0.5V to 5.5V, and, at power-up, the output voltage could be anywhere between the supply voltages.

I connected the negative terminal of the first battery to the arduino’s ground pin, its positive terminal to the other battery’s negative terminal, and the second battery’s positive terminal to the voltage divider.

That means that the output voltage could go as high as 12V relative to ground, which is too much for the Arduino input pin. Again, for this setup, some protection is in order. We don’t know what the voltage was at the pin, and we don’t know if the pin, or the processor, was damaged. It might be okay, the pin might be bad, or there may be a more widespread failure in the processor.

If you use a single-supply op-amp circuit, with a 5V supply, you don’t have to worry about overdriving the Arduino pin. You’d want an op-amp that will operate at 5V - and it looks like your op-amp won’t - and you’d want one that bills itself as “rail-to-rail,” to be able to get output swings that are close to 5V or ground.

I cannot see the voltage spike generated by sudden noise as my voltmeter is not fast enough.

Then look for steady noise. It sounds like the electret is biased okay. Set your voltmeter for AC, and sing to it from really close. Your voltmeter is probably optimized for 60Hz AC, but it may be able to measure higher frequencies accurately; if not, you should probably still see something. 60Hz is about five frets below the low “E” string on a guitar - I can’t get that low with any appreciable volume; you may be able to get closer, or maybe your best friend is an honest-to-goodness bass. See if you get an AC reading on the voltmeter - that’ll determine whether the electret is delivering an AC output. If you get anything out of that, then hook the ouput to an analog pin, write a loop to sample and Serial.print() the ADC reading continuously, and see if you get audio-like variation. The Arduino can sample fast enough to see reasonable audio, but, to pick up a clap, for example, you’d have to be sampling at just the right moment.