LM386 microphone amplifier

In this schematic, a LM386-based audio amplifier takes its input from an electret microphone.

There are two output signals. V_OUT carries an AC-only voltage and should be used when interfacing with another piece of audio equipment. The voltage at V_OUT_UC is biased at 1/2 of the supply voltage VCC and is the better option for microcontroller input.

If volume control is needed, the VR1 potentiometer from the original schematic can be added back, before the input pin 3.

Sound sensor for the Arduino

Arduino’s analog pins map a 0 ~ 5V voltage to a 0 ~ 1023 integer. In silence, an ideal sound sensor should consistently give readings of 511-512 – half of the 0 ~ 1023 range, corresponding to 1/2 VCC = 2.5V. When there’s a very loud sound, the readings should sweep all the way to 0 and 1023. Moderate sounds should have readings somewhere in between. This makes it easier to set a threshold for detecting sounds of a given strength.

Sound Readings range (ideal) Amplitude (ideal)
(Silence) 511 ~ 512 1
Talking 300 ~ 723* 423*
Loud knock, broken glass 0 ~ 1023 1023

* These particular values are just an example

For battery-powered applications, the current draw of the circuit may also be a concern.

LM386 sound sensor performance

Let’s see how the LM386 sensor fares, in its 20x gain configuration (no C2 capacitor). V_OUT_UC is connected to Arduino’s A0 pin and the Min-Max sketch is uploaded.

Sound Readings range (LM386) Amplitude (LM386)
(Silence) 455 ~ 547 92
Loud knock 132 ~ 897 765

Not too bad, not too great either. A loud knock gives a decent output sweep, but the readings in (relative) silence cover quite a wide range. The current draw of the sensor was 5.54mA.

Increasing the gain to 50x or 200x is unlikely to bring much improvement. It may push the output range a bit closer to 0 ~ 1024, but will increase the noise as well. At 20x gain, the output already covers 75% of the 0 ~ 1024 range.

Side note: Picking the value for R2

Most sources suggest using a 1K ~ 10K resistor for R2. The easiest way to test which value works best is to use a trim-pot

Sound Readings range (LM386) Amplitude (LM386)
(Silence), R2=2K 369 ~ 576 207
(Silence), R2=5K 420 ~ 564 144
(Silence), R2=10K 447 ~ 549 102
Loud knock (R2=2K, 5K, 10K) 132 ~ 896 764

These are the results for my particular setup. The maximum output sweep was virtually identical for all R2 values tested and R2 = 10K yielded the lowest noise in silence.

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

Parts list

Part Value Description
C1 1~10uF Bypass capacitor
C2 10uF Gain 200x. Optional.
C3 220uF Output coupling capacitor
C4 47nF Boucherot cell
C5 100nF Power supply decoupling
C6 100uF Power supply decoupling
C7 10uF Microphone coupling capacitor
MIC Electret microphone
R1 10R Boucherot cell
R2 1 ~ 10K Microphone load resistor
VSS 4 ~ 12V Supply voltage

Downloads

Related posts

Links

About these ads

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

  1. This works well!! But, do you think i’ll be able to actually acquire the signal into matlab…and read it as a wave file…????

    • Thanks for the comment!

      It’s certainly possible to send the readings from Arduino to a PC, using some of the “oscilloscope”-type sketches. However, the resolution of the audio signal (10 bit) and the sampling rate (5-10kHz, limited by the speed of ADC & Serial) may be too low for most applications.

      The quality will be much better if the microphone is connected to the computer’s sound card.

  2. If you used an external adc could you achieve higher recording quality?

    • Well, yes, Arduino’s ADC is not really up to the task of high quality sound recording, mostly because of its fairly low sampling rate.

      But the setup described here is for a much simpler tasks – monitoring the overall ambient sound level, detecting loud noises, etc. For this you won’t gain much by using a higher-quality external ADC.

  3. Sweet. Works as advertized. I’m getting ~780 differential using an electret out of a Furby we are hacking. This was perfect. Thanks for doing all the leg work and documenting it so well!

  4. the preamp circuit works for dynamic microphones?.

  5. In the image of the Setup you made, where is the (C3)220uF ? (C2) is series to (C3) and connected to 10Ohm resistor, are both (C2)and(C3) a ceramic capacitor?

    • The 220uF C3 is not present on the image, as the setup uses the V_OUT_UC output. C2 is not present either, as it’s optional. And there are two ceramic capacitors that form C4 – I didn’t have a 47nF cap and used 2x 100nF as substitute.

      When installed, C3 would be an electrolytic capacitor.

  1. Pingback: Dan’s Perodic Table Display « The Mind of Bill Porter

  2. Pingback: The Elemental Illuminator « The Mind of Bill Porter

  3. Pingback: Arduino Lichtorgel, Teil 1: Hardware | TechBlog

  4. Pingback: Atelier pratique : Capter et mesurer une intensité sonore | Œuvre | Imaginaire | Numérique

  5. Pingback: Ojacevalnik za electret mikrofon

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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: