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.
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.
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.
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.
It is missing a bypass cap from pin 3 to ground, I'd guess about 0.1uF will work.
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.
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.