Sound Level Detector

Hello Arduino Community,
I need to do a project to check for ambient sound level, and if a sound abnormally exceeds that sound level it starts flashing a LED. I need to put a sound sensor. when a sensor detects a loud noise, triggering a LED. Maybe I need another sensor to capture ambient sound too? Is there any ambient sound senor for arduino? something that feeds ambient noise level. I have been checking the web all day,and I have came up with some not so clear ideas.
Any ideas?? Any suggestions?
Thanks

Is there any ambient sound senor for arduino?

This kind of sensor is called a microphone. With the right type of microphone you can connect it to an analog input of the Arduino, read the values and if the average value is above some level for some time activate your alarm.

There was a project here a few years ago when someone wanted to have a sign light up in a canteen when the noise level got excessive. He reported back that after several months of trying he couldn't get any reliable correlation between the microphone readings and the actual perceived loudness level of the environment.

Anyway if you want to try then what you need to try is a microphone and amplifier with an envelope detector on the end.

With the right type of microphone you can connect it to an analog input of the Arduino

Not sure I would agree with that. What is the right sort of microphone, it would have to be one with a built in amplifier.

Not sure I would agree with that. What is the right sort of microphone, it would have to be one with a built in amplifier.

Yep, something like this:

The brick includes a "high sensible microphone", but no amplifier, which isn't very "sensible".

...if a sound abnormally exceeds that sound level it starts flashing a LED.

That should be possible as long as you have access to a real SPL meter for calibration.

I built a VU meter "effect". It's a string of LEDs that bounce up & down to the loudness of the music, but it's not a true meter because it's not calbrated so it can't truly measure anything... In fact-it "self-calibrates" to the changing long-term average for lots of "meter action" no matter what the volume setting. (My meter effect doesn't have a microphone, it hooks-up to the line-output of an audio device. If I wanted to use a mic, I'd also need a preamp.)

Note that with music the average is typically around 18dB below the peak. The average correlates with perceived loudness better than the peak. So, you'll probably want a short-term average (at least a second or so).

Also, since our ears don't have flat frequency response, there is something called [u]A-Weighting[/u]. You may be able to ignore this if you don't need super-accurate readings and if the "character" of the sound is always the same (crowd noise, music, etc.) as long as you calibrate with an accurate A-weighted SPL meter.

If you need A-Weighting, I'd guess it's easier to implement on the analog side, before the signal hits the Arduino ADC.

Maybe I need another sensor to capture ambient sound too?

If you want to digitally record the sound, uncompressed audio takes a ship-load of memory and I wouldn’t recommend the Arduino.

If you just want to record the loudness or the loudest reading, that’s easier (depending on how many data-points you want to save).

It would also be super-easy to add a 2nd LED that latches-on (stays on) to "remember" if the threshold was exceeded.

The brick includes a "high sensible microphone", but no amplifier, which isn't very "sensible".

[u]This one[/u] does have a preamp.

I believe the output is also biased at 2.5V, which takes care of the negative-half of the waveform. (You can damage the Arduino if you fed-in negative voltage, or voltage greater than +5V.)

You may need to subtract-out the bias from your ADC readings, and/or account for the fact that an AC signal has an average around zero...

:smiley: I assume the SparkFun guys know the difference between "sensitivity" and "sensible"! :smiley:

Jane Austin wrote a book about them. Sense and sensitivity.

I have played around with a sound sensor board to emulate the "clap on" "clap off" gizmo on tv. My board is built around a LM393. It runs off 4 - 6 volts and outputs an analog signal that varies according to the level of the noise. It has a built in microphone. I bought my from china for about 3 dollars. If you research LM393 I think you can find some devices.

"...sound abnormally exceeds that sound level" and "sensor detects a loud noise" are somewhat different. The former requires an sound level average while the latter, peak detection.

Do you want one (which one) or both? The Arduino can do both in software (with a little hardware to create an amplitude envelope, a "DC" level that reflects the sound amplitude) or both can be done in hardware and the Arduino can simply read the two levels.

Thank you all for your kind suggestions.

rickso234:
Do you want one (which one) or both? The Arduino can do both in software (with a little hardware to create an amplitude envelope, a "DC" level that reflects the sound amplitude) or both can be done in hardware and the Arduino can simply read the two levels.

I have looked into some of previous "sound level average" circuits using ZX-Sound or LM393. Do you have any particular circuit in mind for that?

Grumpy_Mike:
Jane Austin wrote a book about them. Sense and sensitivity.

Lol I though this book was about microphone sensitivities and circuitry.

I actually found an app called awareness!
https://itunes.apple.com/ca/app/awareness!-the-headphone-app/id389245456?l=fr&mt=8
It functions a lot like what I am looking to build, but of course in Arduino platform (Not dependent to any other device like iphone...)

Have a look at...

http://tim.cexx.org/?page_id=374

and about halfway down the page is a schematic and description of an "Analog beat detector".

This circuit should do what you want. The comparator output is an impulse detector that tracks along with the background sound level. The lower Diode/C/R network at the "-" input is the "reference" or "sound level average" network.

Hi,

I think what you want is a measurement of "Loudness".. This is a complex subject, because the psycho-acoustics that control human perception of loudness do not map to a simple electrical signal level.

See: Loudness - Wikipedia
and about measuring it: Loudness monitoring - Wikipedia

I looked in some detail at the work CBS did in the late 70's when I was designing automated FM stations (Please don't groan..) Remember the Loudness Wars about TV commercials being "Louder" than the regular program material? The VU meters read peaks of 100 for both but everyone perceived the commercial as louder. And they were, because of the audio processing done by the audio engineers producing those commercials.

If you really want to do this effectively, you will need to use spectrum analyzer chips (There is an Arduino shield from Sparkfun: SparkFun Spectrum Shield - DEV-13116 - SparkFun Electronics) Bliptronics did that shield.. You would need to digitize the output of the different spectrum bands, get some syllable time interval averages (say 150 Ms) for each, and devise a weighting algorithm of the bands outputs based on human hearing (Fletcher-Munson curve) characteristics. Could be done...

I had fun working on the audio processing and filtering driving a 35,000 watt (Yes, I mean it) audio amplifier at WMCA in New York in the early 70's. That's what you needed for a 100 percent AM modulated input to a transmitter putting OUT 50,000 watts.

I got a high sensitivity sound level detector with an alarm threshold working nicely with the Arduino Uno, an op-amp and comparator. More on my blog Internet of Things: High Sensitivity Arduino Sound Level Detector