Easiest way to detect sound

Thread Starter

stoopkid

Joined Mar 3, 2011
146
I'm working on an LED thing for a music project. I want to be able to detect sound so that it can dim down after music stops and come back up when it starts again. The only thing is that the music will likely be very loud and "no music" will still likely be at least a bit noisy.

It doesn't need to be super accurate or quick, but it just needs to still be useful for detecting loud vs louder. I will be measuring with arduino, so it could be calibrated. But it still needs to not have an upper limit of just "fairly loud." Could this be done with a piezo buzzer?

Thanks
 

Adjuster

Joined Dec 26, 2010
2,148
A piezo buzzer is not a condenser microphone. In particular, the buzzer will have a narrow frequency response and may not be a good choice for this. The condenser microphone would have a much wider frequency response, but if using one you would have to supply it with some bias, typically via a 1kΩ resistor returned to a few volts supply.

Edit: Depending on the output of whatever transducer you finally pick and the sensitivity of your Arduino input, you are likely to need some sort of amplifier between the two.
 

Audioguru

Joined Dec 20, 2007
11,248
A piezo "buzzer" has a built-in oscillator so it continuously beeps when powered.
You want a piezo transducer that can be a high frequency microphone or speaker.
 

lowprofile

Joined Oct 31, 2011
33
I think that what you want to do can be accomplished with op-amps.

A microphone circuit will output a voltage that will be compared against an adjustable threshold (so you can set its sensitivity). The op-amp can be used such that the output turns ON or OFF when there is sound, whichever you prefer, for driving further circuitry.

Here is a video that is very related. He has schematics in the video.
http://www.youtube.com/watch?v=TQB1VlLBgJE

There is also another video by the same youtube user that describes a simple addition to the sound detector circuit: a peak detector. This might be another option, depending on the exact behavior you are looking for.

These circuits are very simple and might take some of the work off the shoulders of your arduino. Or maybe it's not a concern.
 

Audioguru

Joined Dec 20, 2007
11,248
Afroman used a real electret microphone, not an awful piezo whistle.
But he used a horrible and old LM324 opamp instead of a much better one.
 

Audioguru

Joined Dec 20, 2007
11,248
you can use condenser mic with simple common base amplifier set up
No and no.
Use an electret mic, not a condenser mic.
Use a low noise opamp not a transistor.
Don't use a common base amplifier because its input impedance is too low.

The electret mic needs a preamp with a fairly high input impedance to avoid being loaded down so a common base amplifier with its very low input impedance cannot be used (it is used for a low impedance dynamic mic or a speaker used as a mic).
The opamp preamp should have a fairly high input impedance of 30k to 100k ohms which is easy if it is non-inverting.
 

colinb

Joined Jun 15, 2011
351
The opamp preamp should have a fairly high input impedance of 30k to 100k ohms which is easy if it is non-inverting.
Is it harder achieve 30k to 100k ohms input impedance for an inverting op-amp circuit than for a non-inverting op-amp circuit? Why is this so?
 

Audioguru

Joined Dec 20, 2007
11,248
Is it harder achieve 30k to 100k ohms input impedance for an inverting op-amp circuit than for a non-inverting op-amp circuit? Why is this so?
Most preamps for an electret mic have a voltage gain of 200. Then for an inverting opamp with a 100k input resistor the feedback resistor must be 20M ohms which is very high.
A non-inverting opamp can have a 1k resistor to ground and a 200k feedback resistor.
 

Audioguru

Joined Dec 20, 2007
11,248
Why couldn't you use an inverting op-amp configuration with, for instance, Rin=1k and Rfb=200k?
Because the 1k ohms input resistance will attenuate the output of an electret mic that has an impedance of 3k ohms.
You don't want to attenuate the mic, you want to amplify it.
 

colinb

Joined Jun 15, 2011
351
Because the 1k ohms input resistance will attenuate the output of an electret mic that has an impedance of 3k ohms.
You don't want to attenuate the mic, you want to amplify it.
But that 1k is in addition to the op-amp's input impedance of several hundred kohms to several megohms.
 

Audioguru

Joined Dec 20, 2007
11,248
But that 1k is in addition to the op-amp's input impedance of several hundred kohms to several megohms.
No.
Due to the extremely high open-loop voltage gain of an opamp and due to a lot of negative feedback, the (-) input of an inverting opamp is ZERO ohms.

Look in Google at how an opamp works. Here is what I found:
 

Attachments

colinb

Joined Jun 15, 2011
351
No. It does not talk about inverting and non-inverting opamps.
What? Op amps are not inherently “inverting” or “non-inverting” amplifiers: that is a property of the circuit in which the op amp is placed.

From AAC Op-amp Divided feedback:

  • A negative-feedback op-amp circuit with the input signal going to the noninverting (+) input is called a noninverting amplifier. The output voltage will be the same polarity as the input. Voltage gain is given by the following equation: AV = (R2/R1) + 1
  • A negative-feedback op-amp circuit with the input signal going to the "bottom" of the resistive voltage divider, with the noninverting (+) input grounded, is called an inverting amplifier. Its output voltage will be the opposite polarity of the input. Voltage gain is given by the following equation: AV = -R2/R1
Please correct me if I'm wrong.
 
Last edited:

Audioguru

Joined Dec 20, 2007
11,248
The AAC op amp chapter does not say that the inverting opamp has a completely different input resistance than a non-inverting opamp.
 

hgmjr

Joined Jan 28, 2005
9,027
No.
Due to the extremely high open-loop voltage gain of an opamp and due to a lot of negative feedback, the (-) input of an inverting opamp is ZERO ohms.

Look in Google at how an opamp works. Here is what I found:
Did you mean to state that in the inverting opamp circuit in question, the (-) input of inverting opamp in your above statement was ZERO volts rather than ZERO ohms?

In the presense of negative feedback, the output impedance of the opamp is very nearly ZERO ohms.

hgmjr
 
Top