Go Down

Topic: Sound Level Detector (Read 4773 times) previous topic - next topic

JJoll

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

pylon

Quote
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.

Grumpy_Mike

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.

Quote
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.

pylon

Quote
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:

http://shop.boxtec.ch/electronic-brick-sound-sensor-microphone-brick-p-40472.html

rickso234

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


DVDdoug

Quote
...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 A-Weighting.   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.

Quote
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.

DVDdoug

Quote
The brick includes a "high sensible microphone", but no amplifier, which isn't very "sensible".
This one 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...

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

Grumpy_Mike

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

brucemac

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.
Bruce

rickso234

"...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.

JJoll

Thank you all for your kind suggestions.


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?



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...)

rickso234

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.

terryking228

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:  http://en.wikipedia.org/wiki/Loudness 
and about measuring it: http://en.wikipedia.org/wiki/Loudness_monitoring

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: https://www.sparkfun.com/products/10306) 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. 
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

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 http://davidhoulding.blogspot.com/2014/02/simple-high-sensitivity-arduino-sound.html

Go Up