Go Down

Topic: How to make a pre-amp for a electret? microphone (Read 17469 times) previous topic - next topic

nickgammon

Oct 05, 2013, 07:27 am Last Edit: Oct 05, 2013, 11:12 pm by Nick Gammon Reason: 1
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
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

MarkT

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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

nickgammon

Virtual ground, right.

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

Your advice may help me with my grandfather clock tick-detector.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

MarkT


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.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

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.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

fungus

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

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

nickgammon

Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

polymorph

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?
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

oric_dan

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.

polymorph

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.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

polymorph

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
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

nickgammon

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.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

polymorph

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.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

nickgammon

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.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Go Up