Measuring sound level (decibels)

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
JurgenG
 
Posts: 2
Joined: Tue May 29, 2012 8:50 am

Measuring sound level (decibels)

Post by JurgenG »

Hi,

I'm trying to find a way to measure sound levels (decibels). Even though there's a ton of pretty cheap sound level meters out there (doing an acceptable job) - I can't seem to find a way to connect this information to an arduino board. I guess this would be a good idea for an Arduino shield - but since it doesn't exist yet, I was hoping someone could help me with some pointers on how to start creating this yourself...

Thanks,
Jurgen.

User avatar
cstratton
 
Posts: 294
Joined: Wed Sep 29, 2010 3:52 pm

Re: Measuring sound level (decibels)

Post by cstratton »

There are two main problems you face

First there is the matter of converting from a linear reading such as you get from an ADC to a logarithmic one. If your ADC readings are reliably zero-centered, you can square them and then take the log using a library function, then multiple by ten (for the deci-). Or you can take the absolute value, take the log, and multiply by 20. More fun can be to do it all with integer math - squaring a reading will get you a big number. Start assuming the power level is 0db and shift your big number left by one place, subtracting the approximate 6dB worth of a bit each time, until your MSB is non-zero. Then if you want you can lookup the next few bits in a table to obtain fraction-bit resolution.

Your second problem is calibration, weighting, and time averaging. It's not enough to just take any microphone, sample it perfectly, and measure the instantaneous power. Real meters have filter to compensate for the characteristics of the microphone and adapt them to standard weighting curves, perhaps those approximating the frequency response of the ear. You will also need to average / filter over some period of time to produce output at a useful rate. And of course you would ultimately have to calibrate the magnitude of the overall response against some known source or against a calibrated meter.

Hmm, interesting question - I wonder if there is any way to a produce a known sound pressure level by exploiting some physical phenomenon. Perhaps if it were possible via stroboscopy to measure the displacement of a speaker cone of known diameter?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”