LM358 microphone amplifier

After the unconvincing performance of the LM386 mic amp, another design is put to the test. This time, based around a LM358 operational amplifier.


Operational amplifiers are high-gain voltage amplifiers. There’s a huge amount of information available on how to use them and the guide I followed is TI’s“Op Amps for Everyone”. The schematic is an “Inverting AC amplifier” (A.3.18, p. 424). From the equations there, the voltages on the two outputs are:

  • V_OUT_UC = – V_IN * R5 / R4 + VCC / 2 = – 100 * V_IN + VCC / 2
  • V_OUT = -100 * V_IN, as the C3 capacitor is blocking the DC component

(V_IN is the voltage at pin 2)

Op amps do not provide a lot of output power. In-ear headphones can be driven from V_OUT, but it’s unlikely that a LM358 will power even a small speaker. For a microcontroller, connected to V_OUT_UC, output power does not matter, only voltage does.

LM358 sound sensor performance

As in the LM386 mic amp setup, V_OUT_UC is connected to Arduino’s A0 pin and the Min-Max sketch is uploaded. By using different R5 resistor values (10K, 47K, 100K), gains of 10x, 47x and 100x are achieved:

Gain (Silence) Loud knock
Readings Amplitude Readings Amplitude
10x 510 ~ 512 2 307 ~ 735 428
47x 505 ~ 517 12 17 ~ 754 737
100x 500 ~ 525 25 7 ~ 755 748

Pretty good! The noise level in silence increases linearly with gain. Moving from 10x to 50x gain gives a good increase in the maximum output swing. Pushing the gain to 100x provides only a minor improvement. Overall, the 50x setup gives the best noise vs. output swing results.

The LM358 does not have a true rail-to-rail (0V to VCC) output. The datasheet specifies an “output voltage swing 0V to (VCC – 1.5V)”. This means that when VCC = 5V, the largest possible analog reading is in the 715 – 750 range. In order to get an wider output range, a better op-amp should be used.

Current draw was 1.52mA, in the 100x setup

LM358 sound sensor on a breadboard (click for high-res)

Parts list

Part Value Description
C1 10uF Microphone coupling capacitor
C2 100nF Power supply decoupling
C3 220uF Output coupling
MIC Electret microphone
R1 1 ~ 10K Microphone load resistor
R2, R3 10K Voltage divider: 1/2 VCC
R4 1K Gain = – R5 / R4
R5 100K
VSS 3 ~ 30V Supply voltage


Related posts


Posted on May 21, 2011, in Electronics and tagged , , , , , , . Bookmark the permalink. 39 Comments.

  1. Thank you very much for a good picture of the board and a straight forward write up, it helped me alot!

  2. You’re welcome, Chris!

    • William Moreno

      Hi, I am tried to test, followed your instructions here, but I have having problems with noise, please give me any suggestion ?

      • Hi, William,

        Can you describe your setup in more details? Like, are you using the audio output V_OUT or the microcontroller output V_OUT_UC? How is this noise showing up – unstable Arduino readings or poor-quality audio? What is the op-amp gain set to?

        As general suggestions, you should double-check all connections. Are the power rails (+5V and GND) properly routed over all breadboard sections? Then, check if the polarized components (mic and caps) are correctly oriented. Finally, you may try lowering the value of R1, the microphone load resistor, down to 4.7k or 1k

  3. Hey, this is exactly what i was looking for!
    Thanks for all the info!

  4. Lukasz Adamczak

    Hi Dimitar, thanks for a great article.
    I’m planning a similar circuit, but getting audio input from a guitar jack.
    My guitar signal is up to 600mV peak-to-peak (for the loudest possible chord strum). What values of R5 & R4 would you recommend? I believe I need less than 10x gain to fit within 5V range. Am I right?

    Also, can you explain the role of R1? Will I need one for the guitar input?

    • Lukasz,

      For a 10x gain, you can leave R4 at 1k and reduce R5 to 10k. The R1 resistor is part of the microphone setup, you won’t need it in the general case.

      Please keep in mind that the LM358 op-amp is probably not the best choice for quality audio applications. This amplifier may work as a proof-of-concept, but you may want to search for better, specialized guitar amplifier schematics.

  5. is it possible to get the Digital O/P from the circuit to drive digital circuit what ill be the o/p voltage

    • LM358 does not have a rail-to-rail output and with a +5V supply, its maximum output voltage is ~3.5V. This may be too low for some digital inputs to register as a logic “1” / “HIGH”. A comparator (like LM393) or a Schmitt trigger IC may be used to reliably convert the output to digital.

  6. Hi,
    Thanks for this post, it has been a geat help!!

    I got best results with slightly different values for resistors and capacitors:
    R4 = 0 (Removed it completely!)

    Power supply is 3.3V and I also have a low pass filter on the power.
    I’m using the V_OUT_UC connected to to an ATMEGA and eventually converting this to audio. Voice is loud and noise level is low enough.

    Why is R4 needed at all in this circuit?

    • Hello,

      With R4 shorted out (i.e. R4 = 0), the op-amp would work in what looks like a comparator mode, i.e. with maximum amplification. The output would swing to either ~0V or ~3.5V even for slightest changes in the input signal and I’d expect the output to be clipped and distorted.

      But I’ve never tried such a setup and if it works fine for you – that’s great!

      • Dimitar – It did not behave that way. I agree that according to the formulas it should (with an ideal opamp), but it didn’t happen this way in real life. It had the effect of increasing the gain but not to a full swing between GND and VCC.

  7. Hi I want to connect output to the XBee but ADC range of XBee is 0-1.2V what i should do sir ?
    and if i want to select frequency in range 40-300 Hz could you guide me ?

    • For scaling down the output voltage from 0-5V to 0-1.2V you can use a voltage divider at the output, with a pair of 10k & 3.3k resistors (or a similar pair with a 3:1 ratio). The voltage across the 3.3k resistor will be 1/4 of the output voltage.

  8. Hello,
    I am trying to do a small voice recognition circuit using an arduino mega2560 i bought earlier last year. Are there any changes that i will need to make to this circuit for it? I tried but it gave me no results. I checked everything thrice, still. Should i use a pre-amp circuit as well? if yes, which one would you suggest?
    Thank you.

  9. Thanks Man

  10. Dear Dimitar, thanks a LOT for your design, it works perfectly, you saved my day !!

  11. Thanks for share.
    How do I design this circuit for “differential microphone”?
    Thank a lot!

  12. Hi Dimitar, Great writeup. I am trying to build a hearing aid for my elderly father. I found an exisiting preamp mic http://www.dfrobot.com/wiki/index.php?title=Analog_Sound_Sensor_(SKU:_DFR0034) that can directly well to a headphone, but I am short on the gain a little. I found the schematic here, can I increase the gain by changing the R7 value from 100K to 150K, and how does will affect the sound? and how does this schematic compare to the example you used, it seems that it is using both stages here..


  13. It seems like this LM358 (operating as a differential op amp) is going into saturation or not operating at all because you have the matching Vcc or Vdd 10k impedance’s to both the positive rail and negative rail.
    Take away R2 and it will actually be amplified. Not sure what the open loop feedback is but you can always trade R4 with a pot (potentiometer) to change the gain and experiment to get better results.

  14. Great instructions! Thank you for sharing, I was trying to find a way to measure stereo sound from two microphones for a project and by reading this I got the big picture of how to do it.

  15. hi this is a good experiment. here my experiment : i built a simple micro electret amplifier with 1 transistor c9014, 3 resistors and a capacitor. that give me a result :
    silence –> amplitude around 100
    loud knock –> amplitude around 997 (it’s the maxi)
    i know an op amp is good for this kind of project but the results with a simpliest circuit is also fine for a clap switch application with an arduino.

  16. Valter Fukuoka

    Dimitar, nice article/tutorial, with lots of infos, thanks for the good information you are sharing…

    I did a 1 transistor and also 2 transistor mic pre-amp but the LM358 is really nice option, very popular, easy to use and cheap device, and also can deal with 2 mics (dual op-amp capability) if needed (which in my case I think it makes a lot of sense)…

    [Human Presence Science]
    What I am thinking is to create a very simple device to detect human presence inside an environment (like a room), then use this information to control stuff like the intensity of illumination (light)…

    My current plan is to use a LDR (light dependent resistor) with the LM358 sound detector as described in your project, combined them and start to collect some DATA in a “scientific” (as possible) fashion, so that the resulting device/knowledge can be put to use to control LED Light in a, intended, “intelligent” way…

    First I want to collect as much DATA as possible, then, develop a body of knowledge around the human-presence subject, enough to start to play with the idea of having “intelligent light”…

    The goal for the device is to be as simple and cheap as possible, so that it can be “incorporated” (embedded) into all kinds of products, not only lamps…

    This “human presence detector” is part of a large thinking, to create things more “ECO” such as [desktop size] solar panels with rechargeable batteries, that can be used to provide illumination at night… and, the key for this thinking is POWER EFFICIENCY, so, first, I believe, we need to create some understanding around the subject and also a simple and cheap device to detect when there is human presence or not (inside an environment)…

    So, what I can think for now is that we need 2 things:
    a) Some data and thinking over the subject (of human presence)
    b) A simple device to help detect human presence

    The LDR + Mic-LM358 is a good starting point… perhaps 2 LDRs and 2 Mics (full use of the LM358 dual op-amp)…

    Following are some pictures/diagrams I am creating around the subject…

    [Human Presence Detector and Science]
    “I often say that when you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meagre and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely in your thoughts advanced to the state of Science, whatever the matter may be.”
    Lord Kelvin, 1883

    [Illumination Levels]
    The current “Neanderthal” lamps offers ON (100%) or OFF (0%), but perhaps there are others acceptable levels that may turn out to be practical and coherent…

    [ECOx Stuff]
    I think that “ECO” is a good choice of word to use…

    [A sustainable village as inspiration]
    Also, a very inspirational village in Germany…

    I will be doing experiments and sharing the results, hopefully, your little tutorial/project can grow to became a “universal sound detector module” for human presence detection…


  17. Valter Fukuoka

    Hi, I just want to share the initial setup/experiments/thinking…
    I am experimenting with different values of resistors (picture)…

    [Different values of resistors]

    [Quiet (with little noise from outside)]

    [Saying “hello”, 30cm from the top of the mic, 45 degrees]

    [Knocking the table where the device is…]

    [Higher Sensitivity, for noise detection]
    Not sure about the results or even about the need of such possibility but perhaps we can get more sensibility (to detect small noise variation) by powering the amp with higher Voltage…

    1) Power with 12V, [for example] (LM358 can work with ~32V…)
    2) Shift the “silent” output level to around 2.5V (half the 1024 value for 5Volts ADC resolution), by changing the R2/R3 values (Voltage divider)…
    3) Clipping the output using a Zener diode to limit it to 5 Volts…

    Next picture illustrate the thinking…

    [R2/R3 Voltage Divider?]
    Did test changing R2/R3 “Voltage Divider Ratio”, at least for the noise-detection it seems to work… following pictures “test A” and “test B” shows the results…

    [R2 = 100k, R3 = 100K]

    [R2 = 100k, R3 = 33K]

    [THE LM358]
    Dimitar, I think your choice of the LM358 is a powerful solution, it ENCAPSULATES complexity in such a way that we can change input and output signals with relative simplicity, also the LM358 is very cheap and also very popular (easy to find) and considering that it is a dual-independent-amp channels, it can handle 2 microphones (makes sense for noise-detection) at the same time… everything in a compact 8 pin package…

    For the moment, this CHIP (and the design) will be very helpful to investigated/experiment with the subject of human-presence-detection…


  18. Valter Fukuoka

    [About the last post…]
    The “source” files here (made with Eagle Light Free version):

    Modification 1

    Modification 2 (12Volts?)


  19. Fernando Lichtschein

    Thank you for the post, I adapted it for the EL40X Berkeley edX robot project, I had to change the resistors tor the noniverting input bias so the output would lie between the maximum and minimum voltages (0 and 3.5 V). The photos helped a lot.

  20. Reblogged this on amurchick and commented:
    Усилитель на Lm358

  21. Asking questions are actually pleasant thing if you are not understanding anything fully, except this article gives pleasant understanding even.

  1. Pingback: Sound sampling with the Atmega32u4 breakout board+ « bobanaut

  2. Pingback: Side Project – High Speed Photography trigger « Giant Pong – Making of.

  3. Pingback: Basic Analog Circuits Exercise – Feb 26 | Kangmunicate Here

  4. Pingback: Sound analysis in Arduino | Bocho's Blog

  5. Pingback: Quanto rumore? : QUELog

  6. Pingback: Controlling RGB LEDs with Music | jsimunic

  7. Pingback: #9 | interruptserviceroutine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: