0
\$\begingroup\$

Using this microcontroller with that electret microphone amplifier, I want to build an unweighted dB(SPL) meter as good as it can get - then compare it to this ready made breakout board, this NIOSH app and that commercial meter. What I know so far:

  • Microcontroller's ADC prescaler set to 32; I am sampling into an array with 512 elements at ~38 kHz and calculate V_rms
  • Electret microphone sensitivity -44 dBV = 6.31 mv/Pa = 0.00631 V/Pa, defined for a 1 kHz sine wave at a 94 dB(SPL) = or 1 Pa sound pressure
  • MAX4466 amplifier gain 25 x to 125 x, gain pot rotaded to centre, so ~75 x gain = 37.5 dB
  • 20 µPa (0.00002 Pa) is the threshold of human hearing

I understood one calculates either dB(SPL) = 20 * log10(p_rms / p_reference) or dB(SPL) = 20 * log10(V_rms/ V_reference). I am dealing with voltages, so it's the latter.

However - where and how do I factor in the microphone's sensitivity of Pa = 0.00631 V/Pa and the amplifier gain of 37.5 dB into the formula? Is, for example, V_reference = microphone's sensitivity value of 0.00631 V/Pa?

Many slightly different formulae suggested as the right one in various places, but none take microphone sensitivity and amplifier gain into account and cite sources for the rightness. I'm none the wiser. Anyone knows how to do it properly, also explaining why, maybe with reference sources? Thanks!

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

You can factor in the sensitivity of the mic at any point you desire.

You know that the mic, when fed with some sound amplitude, either in Pa or dB(SPL), the mic outputs some voltage in V or dB(V), and the amplifier adds a gain which you can handle as a multiplier or dB, and the ADC samples the voltages into some numbers which you need to know what they mean in volts or dB anyway.

So it does not matter at which stage you add it, like multiply sampled numbers to voltage with gain in linear domain, or convert to dB and add the gain in decibel domain.

What you do need is the numbers for each stage. It might help to notice the mic specs are -44 dB(V) equals 94 dB(SPL).

Basically, if you measure something out from the amplifier, it is e.g. 125x muliplied voltage of the mic. If you divide Vrms measurement by 125, and compare that with original mic reference voltage, you get mic output in decibels.

I think your problem is that you have selected such a mic output voltage as reference, which the mic outputs at 94 dB SPL sound. But in voltages, if you use that voltage as reference, you get 0dB as a result when mic sees 94dB. So your formula that dB SPL equals 20log(vrms/vref) does not work, as when vrms == vref the formula outputs 0dB, so you already have a 94 dB offset there built in by selecting incorrect reference. You need 94 dB smaller reference, or add a 94 dB offset, to get SPL.

\$\endgroup\$
8
  • \$\begingroup\$ Thanks, so I would calculate 6.31 mV * 75 = 0.47 V according to sengpielaudio.com/calculator-gainloss.htm and arrive at dB(SPL) = 20 * log10(V_rms/ 0.47V)? In other words, the range of 25 x to 125 x gain would raise the denominator (V_reference = -44 dBV = 0.00631 V/Pa) in the equation to a range from +28 dB = 0.16 V to +42 dB = 0.79 V. Did I understand it correctly? \$\endgroup\$ Commented Mar 29 at 15:40
  • \$\begingroup\$ @Systembolaget I can't follow your logic. If you feed the mic with 94 dB SPL, it gives you -44 dB V. If you add an amplifier of 100x or 40 dB, the same 94 dB SPL gives you now 40 dB higher voltage, so -4 dB V. \$\endgroup\$
    – Justme
    Commented Mar 29 at 15:53
  • \$\begingroup\$ So, with "add the gain in decibel domain" the correct formula would be: dB(SPL) = 20 * log10(V_rms / V_reference) + 37.5 dB (for 75 x gain)? \$\endgroup\$ Commented Mar 29 at 16:14
  • \$\begingroup\$ @Systembolaget I again can't follow why you would do that. The amplifier gain affects the Vrms as you measure it after the amplifier. You measure 37.5 dB more than the mic outputs in mic voltage and compared to mic reference. That would only work if you already adjusted the reference. \$\endgroup\$
    – Justme
    Commented Mar 29 at 16:35
  • \$\begingroup\$ So, then, where and how do I factor in the 25 x, 75 x and 100 x gain in the formula dB(SPL) = 20 * log10(V_rms/ V_reference)? Thanks! \$\endgroup\$ Commented Mar 29 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.