3
\$\begingroup\$

I've got a Knowles SPH1642HT5H-1 (pdf link) analog MEMS microphone that I'm planning to connect to one of the ADC inputs on an STM32. I've done what I think are the correct calculations to determine the gain and offset that I will require but would like someone to just check that my interpretation of the datasheet is correct.

The sensitivity of the microphone is -38dbV/Pa and the MCU AVDD is 3.3V. The small signal is carried on a relatively large DC offset. I calculate for the signal:

$$ Vrms = 10^{-38/20} = 12.589mV\\\\ Vpp = Vrms . \sqrt{2} = \pm 17.8mV\\\\ Gain = \frac{AVDD}{2 . Vpp} = 92\\\\ Offset = \frac{AVDD}{2} = 1650 $$

To make full use of the range of the single-ended ADC I need to design a pre-amp with a gain of 92 and an offset of 1650mV.

For reference, these are the datasheet parameters:

Edit

Based on the @JRE's comments below I can recalculate as follows.

If I want 70dB SPL to be full scale on the ADC then, using this calculator I convert dB SPL to Pa and get 0.0632Pa. The new gain calculation will be:

$$ Gain = \frac{\frac{0.5 . AVDD}{\sqrt{2}}}{10^{-38/20}. 0.0632} = 1466 $$

Based on @Andy aka's answer I can adjust further based on how things actually perform in the real world.

\$\endgroup\$
4
  • \$\begingroup\$ I don't think those specifications mean what you think they do. They are not saying the output level is -38dB. They are saying that given a particular volume of sound, you will get a particular output level. The value given can be used to work backwards from the measured signal to determine the sound pressure level for a given voltage - or to estimate the expected voltage if you know the real SPL. The microphone can, however, accept louder noises and will then output a higher signal. \$\endgroup\$
    – JRE
    Commented Oct 18, 2018 at 12:43
  • \$\begingroup\$ How much gain you really need depends on the SPL of the things you want it to "hear." If you are trying to record jack hammer sounds 2meters away, you will need less gain than if you are trying to record cat snores at the same distance. \$\endgroup\$
    – JRE
    Commented Oct 18, 2018 at 12:45
  • \$\begingroup\$ @JRE the sound would be similar to a person speaking normally from about 1 foot away. This site seems to think that's about 70dB. I can certainly design in a variable gain if I can narrow down on the range required. \$\endgroup\$
    – Andy Brown
    Commented Oct 18, 2018 at 13:29
  • \$\begingroup\$ This site says 94 dB SPL is 1 pascal. Your mic is rated -38dBV at one pascal. So, you will need about 20dB more gain if you want a normal speaking voice to be full scale. Maybe a little less for people who like to talk loud. Call it 10 to 15db more than you calculated. \$\endgroup\$
    – JRE
    Commented Oct 18, 2018 at 13:47

1 Answer 1

2
\$\begingroup\$

Well that calculation works fine for sine wave audio being measured by the microphone but real audio has a significant crest factor and this means that the peak voltages will be much greater for the same acoustic power signal. If you want to avoid distortion/clipping consider crest-factor: -

enter image description here

Picture from here.

You should also consider that your ADC will never be operating fully from rail to rail so assume 50 mV top and bottom of the 3.3 volt range is off-bounds. This is because of zero offset and gain errors.

\$\endgroup\$

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.