Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Advice for using MEMS microphone with ADC

  1. #1
    Junior Member
    Join Date
    Apr 2017
    Posts
    16

    Advice for using MEMS microphone with ADC

    Hey all,

    I'm looking at using an analog output MEMS microphone for a new project. I'm not finding good definitive examples of how to properly hook them up.

    I've found plenty of the guides for single ended inputs using electret microphones; decoupling the output and biasing it to Vmax/2. This however seems to be unnecessary as these MEMS microphones take in power and claim to have an internal amplifier.

    I'm specifically planning to use a SPV1840LR5H-B but I'm open to other options with a bottom port.

    So, my question is, do I just connect the output of the microphone to an ADC on the Teensy? If not, what should I do?

    I have a couple concerns about this:
    1. Don't we have to protect the ADC inputs on Teensy from going above ~1.2V?
    2. What voltage do I use for microphone VDD? Teensy's 3.3V? Or a 1.8V supply? (Will microphone output be proportional to VDD?)
    3. The datasheet for SPV1840LR5H-B says it has a "DC Output" of 1.1V with VDD at 1.5V. If we have a +/- swing from there, as I'm not finding a pk-pk voltage rating, I'm guessing we'd go over the 1.2V limit. I've seen other microphones with a DC Output around 0.6V. Does this mean I need a different mic?
    4. The datasheet shows an example amplifier circuit with a decoupling capacitor and referencing VREF. Is VREF VCC/2? Or ADC max (1.2V)? Or 0.6V?

    Thanks for looking. Cheers!

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,155
    Quote Originally Posted by cinderblock View Post
    Hey all,

    I'm looking at using an analog output MEMS microphone for a new project. I'm not finding good definitive examples of how to properly hook them up.
    Use the interface circuit example from the documentation with 'Ref' (or '+') pin of the OPamp set to 0.6V or 0.5 VREF teensy.
    You can supply Mic with what-ever Vdd you want (you are AC coupled) (e.g. with a 1.2V battery)
    You can set external gain to either amplification or attenuation, whatever is appropriate
    without OPamp: use C for AC coupling, and put a 50 % V divider from Teensy Vref to ADC input to generate proper DC offset

    On the Vref confusion:
    AFAIK:
    For Opamps Vref typically means bias voltage (DC value; voltage extended Vref +/- amplitude)
    For ADC Vref typically means max voltage (e.g. voltage expected from 0 to VREF)

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,101
    Quote Originally Posted by cinderblock View Post
    1. Don't we have to protect the ADC inputs on Teensy from going above ~1.2V?
    Going over 1.2V will clip the signal, but you're not risking damage to the Teensy until the signal goes over 3.3V (or over 5V if using Teensy 3.2 or 3.5 and any of the pins which can also do digital signals).

    However, driving the pin below GND risks damage.

    2. What voltage do I use for microphone VDD? Teensy's 3.3V? Or a 1.8V supply? (Will microphone output be proportional to VDD?)
    3. The datasheet for SPV1840LR5H-B says it has a "DC Output" of 1.1V with VDD at 1.5V. If we have a +/- swing from there, as I'm not finding a pk-pk voltage rating, I'm guessing we'd go over the 1.2V limit. I've seen other microphones with a DC Output around 0.6V. Does this mean I need a different mic?
    I'm not familiar with this particular mic. But one with a 0.6V DC bias would very nicely match the 0.6V bias of the ADC pin.

    Otherwise, you would probably need to build a circuit similar to the one recommended in the documentation (right side panel under "Hardware").

    Some MEMS mics have direct I2S digital output. Many require 64 bits per LRCLK frame. Until recently the I2S object used 32 bits, but this was changed to 64 in the latest 1.38-beta to (hopefully) improve compatibility with those I2S mics.

    There have been discussions elsewhere on this forum where people have made those I2S mics work with modified code. Hopefully with 1.38 that will no longer be necessary and these I2S mics will "just work". But if not, there is code people have used....

  4. #4
    Junior Member
    Join Date
    Apr 2017
    Posts
    16
    Quote Originally Posted by WMXZ View Post
    Use the interface circuit example from the documentation with 'Ref' (or '+') pin of the OPamp set to 0.6V or 0.5 VREF teensy.
    You can supply Mic with what-ever Vdd you want (you are AC coupled) (e.g. with a 1.2V battery)
    You can set external gain to either amplification or attenuation, whatever is appropriate
    I was hoping to avoid an amplifier. However, I may not be able to. Looking around, trying to convert from the mic's sensitivity (dBV/Pa) to a pk-pk voltage, taking rough numbers from these sources, it seems the microphone I've picked will not produce much signal at all.

    S ~= -38 dBV/Pa => ~ 11mV/Pa => ~ 11mV swing for talking loudly. This seems like not enough.

    I'm getting some parts today or tomorrow and I'll be able to test this.

    Quote Originally Posted by WMXZ View Post
    without OPamp: use C for AC coupling, and put a 50 % V divider from Teensy Vref to ADC input to generate proper DC offset
    I'm leaning away from this option because of the power draw of keeping a voltage divider running.

    Quote Originally Posted by WMXZ View Post
    On the Vref confusion:
    AFAIK:
    For Opamps Vref typically means bias voltage (DC value; voltage extended Vref +/- amplitude)
    For ADC Vref typically means max voltage (e.g. voltage expected from 0 to VREF)
    This matches my observations. Thanks.

    Quote Originally Posted by PaulStoffregen View Post
    Going over 1.2V will clip the signal, but you're not risking damage to the Teensy until the signal goes over 3.3V (or over 5V if using Teensy 3.2 or 3.5 and any of the pins which can also do digital signals).

    However, driving the pin below GND risks damage.
    Thanks for clarifying this. Since the microphone is a powered device with an amplifier, I'm assuming an op-amp is driving its output and thus won't be able to drive beyond it's GND-VCC range.

    Quote Originally Posted by PaulStoffregen View Post
    I'm not familiar with this particular mic. But one with a 0.6V DC bias would very nicely match the 0.6V bias of the ADC pin.
    I guess it's worth comparing the microphones with varying DC levels. Some have suggested that the DC level of the microphone is proportional to the mic's VCC. I have not seen evidence of this one way or another. I would not be surprised if it was bandgap (or some other fixed) voltage referenced.

    Quote Originally Posted by PaulStoffregen View Post
    Otherwise, you would probably need to build a circuit similar to the one recommended in the documentation (right side panel under "Hardware").
    Yeah, I was looking at those schematics. I'm trying to stay away from that for power saving reasons.

    Quote Originally Posted by PaulStoffregen View Post
    Some MEMS mics have direct I2S digital output. Many require 64 bits per LRCLK frame. Until recently the I2S object used 32 bits, but this was changed to 64 in the latest 1.38-beta to (hopefully) improve compatibility with those I2S mics.

    There have been discussions elsewhere on this forum where people have made those I2S mics work with modified code. Hopefully with 1.38 that will no longer be necessary and these I2S mics will "just work". But if not, there is code people have used....
    Good to know. My searches have found that I2S mics are more expensive than their analog equivalents. Since the quality from the Teensy ADC should be fine, and we're using I2S (mono in & out) for the other half of this project, I didn't want to try using an I2S microphone as well. Maybe this is naive. If I need an extra amplifier, it is probably cheaper ($, space, complexity) to just use a PDM or I2S mic... Should I be able to do two I2S mono inputs with one I2S mono output and one DAC mono output? (With the 3.2) I saw that quad I2S was working which makes me think this could/should be possible.

  5. #5
    Junior Member
    Join Date
    Apr 2017
    Posts
    16
    Well, I got a sample of the microphone. A couple observations.

    1. DC voltage of microphone seems to be VCC dependent. With VCC = 3.3V, I get ~0.7V for the SPV1840LR5H-B.
    2. I was having a lot of trouble seeing any audio data using my noisy bench supply (noise is about 20mV). This partially confirms my suspicions that the amplitude of this pressure sensor will need to be amplified. Blowing "puffs" of air resulted in ~150mV spikes.

    On interesting thing I noticed was that the AC component of the output signal never brought the output below the resting DC output voltage.

  6. #6
    Hi Paul,

    Could you elaborate on the 1.2 V limit? I'm guessing it's because the INTERNAL reference setting is invoked -- is that correct?

    I ask because I'm also having some issues with using the ADC pins for audio sampling and I've been using your very nice Audio System Designer to quick start the coding process.

    Thanks much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •