How to make a pre-amp for a electret? microphone

Now that we have the microphone experts here, can I ask a question?

I have a couple of microphones (I think) that look like this:

I'm not at all sure how to wire them up, but I used this circuit for a sound detector and it seemed to work:

If there are any egregious errors, please let me know. :)

This particular circuit was for firing a flash, full description here:

http://www.gammon.com.au/forum/?id=11671

For audio amplification I think you need to provide a virtual ground near mid-supply to allow decent signal swing without clipping - not an issue for a sound detector. The LM358 has an input noise voltage of 40 nV/sqrt-Hz, so not low-noise.

To expand on Marks’ reply, for the “virtual ground” I suggest you add a 220K resistor between pin 3 of the LM358 and +5V, and put a 10uF capacitor in series with R1. This will keep the LM358 in the linear region. The reason for using 220K rather than 100K is that the LM358 does not have rail to rail output, instead its output can go from just above zero to about +3V (depending on load) when running from a 5V supply.

Virtual ground, right.

If you want to suggest a better op-amp, I’m all ears. :slight_smile:

Your advice may help me with my grandfather clock tick-detector.

dc42: To expand on Marks' reply, for the "virtual ground" I suggest you add a 220K resistor between pin 3 of the LM358 and +5V, and put a 10uF capacitor in series with R1. This will keep the LM358 in the linear region. The reason for using 220K rather than 100K is that the LM358 does not have rail to rail output, instead its output can go from just above zero to about +3V (depending on load) when running from a 5V supply.

No, that's not right, both opamp inputs refer to ground, and virtual ground has to be stiff. The traditional way is to split supply with a resistor divider (plus a decoupling capacitor to true ground), use a unity-gain opamp stage to stiffen it up (make a low- impedance virtual ground)

This diagram I found is the idea (but you need to decouple the lower resistor in the divider or you have a large noise-source! The output resistor isn't useful either. The opamp used should be low-noise if your circuit needs to be low-noise.

In the original circuit the feedback network has a 1k resistor to ground from pin 2 - that also needs to go to virtual ground and that ground has to source/sink current without changing, hence the need for an actively buffered virtual ground.

MarkT:

dc42: To expand on Marks' reply, for the "virtual ground" I suggest you add a 220K resistor between pin 3 of the LM358 and +5V, and put a 10uF capacitor in series with R1. This will keep the LM358 in the linear region. The reason for using 220K rather than 100K is that the LM358 does not have rail to rail output, instead its output can go from just above zero to about +3V (depending on load) when running from a 5V supply.

No, that's not right, both opamp inputs refer to ground, and virtual ground has to be stiff. The traditional way is to split supply with a resistor divider (plus a decoupling capacitor to true ground), use a unity-gain opamp stage to stiffen it up (make a low- impedance virtual ground)

Mark, why do you think the virtual ground needs to be "stiff"? It only needs to be stiff if a load is placed between the output and the virtual ground - and I don't think Nick is proposing to do that. In which case, there is absolutely no need to use an op amp to generate a virtual ground.

What accuracy do you need? Electrets work quite well without pre-amps if all you need to do is detect noises.

I was hoping to detect a clock ticking.

Not very sensitive without a preamp or amp. On the order of 1mV out at conversation levels. Are you sure you aren't thinking of piezo mics?

Just an idea of something to experiment with ... after all, analog electronics is a lot about tweaking until it works the way you want.

Try an LM386 for the gain amp. May be too noisy running off the same v.reg as a cpu, but if it works ok, and you laid out a pcb for this, then more or less the same ckt with a few component changes could be used for either electret amp'ing or speaker output. Just a thought.

How about this?

http://www.newcircuits.com/circuit.php?id=aum002

It is missing a bypass cap from pin 3 to ground, I'd guess about 0.1uF will work.

http://www.newcircuits.com/chimage.php?s=cir_aum002.gif&w=600 Edit: dunno why that would not load as an image, try it as a link. It is just the schematic from the link above.

The problem with an LM358 is that it isn't great at approaching Vcc. Runs out of steam about 1.5V below it.

Just about any reasonable rail to rail Op Amp will work. You aren't building a mixing console, so noise isn't really an issue.

You are only interested in the waveform envelope, correct? The LM358 inputs can go down to ground, as can the output. So wire it up with ground as the reference, inverting amplifier. The Op Amp will only amplify the negative going part of the mic output, only going positive for them. Up to 3.5V on 5V power. Send that through an RC smoothing circuit, it'll end up being a max of about 1.5 to 2V. Now use the internal 1.1V analog reference. Adjust the microphone preamp accordingly.

Oh, yeah, lots of bypass caps on Vcc. Maybe even an RC network on Vcc to the Op Amp Vcc.

I've not breadboarded this:

10mVpeak 1kHz sine wave, offset 1.5V to simulate a rather loud sound in an electret mic.

The LTSpice file:

http://www.polyphoto.com/tutorials/ElectronicsGeneral/LM358ElectretEnvelope.asc

You'll also need this LM358 file:

http://www.polyphoto.com/tutorials/ElectronicsGeneral/LM358.MOD

OK, thanks. Well before I change anything I decided to measure the performance of the existing setup (see original post).

Yellow is on pin 3 of the op-amp (+ input) and blue is on pin 1 (output).

Measuring with the cursor (from 0V) I get:

  • Input: 24 mV
  • Output: 1.64 V

So I make that a gain of 68, not quite what the circuit should do. Have I hit some limit of the performance of the op-amp?

Also, is that about what you expect out of a electret mike? 24 mV isn't much, right?

This is with the mike draped over a speaker playing music quite loudly.

24mV is not out of line with an electret mic right on a speaker. Microphones generally don't put out much.

There are input offset voltage and offset current, if that goes in the wrong direction with an Op Amp referenced to ground with a single supply... the end result can act as if there were a reverse bias on the microphone input. I think you are measuring 24mV at the rightmost peak of the mic, but what I see is a lot of high frequency noise. The average of the noise looks more like 17 or 18mV, making 1.64V a lot closer to 100 times the input.

With your circuit I got this:

Based on the readings on the screen, the gain is: 3.6 / 0.026 = 138

I had to ditch the 1 µF capacitor on the right (C2), that seemed to be sucking the output away.

It seemed to clip if the music was much louder, but I guess that since that isn't a rail-to-rail op-amp, you would expect that after about 3.6V.

Yeah, my example circuit is rather optimistic with an attempted gain of 1000, and a very artificial continuous 1kHz tone.

C2 is meant to be a smoothing capacitor, so you'd not see much except a little DC.

That should really be a two stage amplifier. Gain no more than 100 per stage.

Even in LTSpice, 10mV peak input only got us 2.8V peak.

[quote author=Nick Gammon link=topic=191774.msg1421524#msg1421524 date=1381289089]

Yellow is on pin 3 of the op-amp (+ input) and blue is on pin 1 (output).

[/quote]

But we are using an inverting circuit where the opamp inputs are virtual ground, right?

Not in the original circuit, I don’t think (first post).