best way to measure sound levels?

i'd like to measure sound levels. the area i'd like to track is maybe 5-15ft in diameter. i don't need a decibel reading or anything -- raw numbers in a range is all i need. i don't need it to be super accurate. i just want to be able to tell the difference between silence, some light chatter, and yelling.

what's the simplest hardware solution? a microphone + amp? plugged into an analog pin, would that basically do what i want right there? or will more complicated code to interpret the input be necessary (if so, are there examples?)?

thanks

With an electret microphone and the Arduino in "INTERNAL" you should get enough of a reading.

Check out this spectrum analysis project I worked on: Arduino Spectrum Analyzer - the Musicator - YouTube

i ordered this: http://www.sparkfun.com/commerce/product_info.php?products_id=8669 -- should be enough to at least test and build a prototype. i'm no audio expert so i'm not sure if it'll give me the desired range.

If you've got a computer mic you can try it out. Look at the plug, if it's got 3 bands and the middle one (the ring) is not shorted to ground, then it's likely an electret.

Connect the ring via a 3-5k resistor to +5v, the tip through a 0.1uF to A01, the base to Ground, and you can try the sketch I posted here: http://www.instructables.com/id/The-LED-Matrix-Panel-or-LMP-for-the-Arduino-micr/

it's been a while since my last post but i've recently been tinkering with this. the sparkfun mic came in but doesn't seem of much use... the mic doesn't really react to anything except when i blow into it directly (or put the mic right up to a speaker). readings in a silent room vary quite a bit... like 460-520.

based on something i read on the sparkfun forums, i tried a 10uf and 4.7uf cap between the output and adruino input -- it didn't seem to change anything.

seems unlikely that this sparkfun mic will be able to be adapted enough, so i guess i'm starting from scratch. what are the ingredients i'll need for a mic that can measure noise level in a room? from relative silence to loud discussion.

Offhand, the gain of the sparkfun circuit is much too low. The electret has an output of around 1/2-millivolt, and the circuit only brings it up to about 50mV, which is barely enough for the Arduino to reliably measure.

On the sparkfun, if you can see R5, the 100k, and change it to 1M, you should be able to hear (and measure) the input.

Also see http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1240978930 on connecting electret mics.

it's been a while since my last post but i've recently been tinkering with this. the sparkfun mic came in but doesn't seem of much use... in relative silence it can give values near 600... setting it to ignore all below 600 is pretty good for detecting claps, but not much else. if i'm within a couple feet of the mic and speak loudly, nothing happens -- if i lower the threshold any, i'll just get noise again.

based on something i read on the sparkfun forums, i tried a 10uf and 4.7uf cap between the output and adruino input -- it didn't seem to change anything.

seems unlikely that this sparkfun mic will be able to be adapted enough, so i guess i'm starting from scratch. what are the ingredients i'll need for a mic that can measure noise level in a room?

You will need the Mic Preamp like this one from sparkfun.

Keep in mind that the output of the mic amp is an AC signal which you really should not wire directly to a Arduino A/D pin as it has a negative voltage limit that the pin should not be subjected to. A series diode, with cathode end towards the Arduion and possibly filtered to ground with a cap, would give you a better safe means of measuring for sound bursts. Of course the installed diode means that the sound level needs to be amplified to least be able to overcome the forward voltage drop of the diode and of course the positive peaks should be less then 5vdc.

Lefty

To measure overall sound levels, you need to look at the "envelope", not the individual cycles of the sound.

For the mic preamp, I used a simple 1-transistor circuit someone mentioned in aboard posting here recently.

I was too lazy to come up with the code to determine peaks, so I used a hardware aid: Precision Full-Wave Peak Detector: Detect The Envelope of An Audio Signal – Electronic Circuit Diagram.

The circuit didn't seem to be working quite right with the LF353, so I tried an LM358. It turned out to be a wiring mistake on my part, but I found that it worked fine when I fixed that, so you don't need to buy a CMOS opamp if you have something like LM358s or LM324s handy.

The output seemed to hang around about 1/2 Vcc with little/no sound, and didn't swing a whole lot. So, I connected the output through a .1 capacitor to get rid of the DC component, and tied the output side of the cap to ground through a 100K resistor. To get more output, I added another opamp as a buffer, with a pot in the gain-setting path so I could vary it.

You should be able to find an opamp-based preamp for your mike on the web, so you could do the whole thing with an LM324 and a handful of Rs and Cs.

Ran

if i understand correctly, the peak detector won't output a drop in sound levels -- only change if sound levels rise. i need to be able to detect increases and decreases. so do i only need a preamp with a rectifier circuit? the sparkfun breakout board i have should already have a 100x opamp, so do i just need a rectifier?

if i need more gain, can i do so with additions? or would i need to build a preamp from scratch? any useful links for that?