Mems Microphone advice

Thread Starter

DJ_AA

Joined Aug 6, 2021
305
Hi

I am interested in using Mems Microphones for an audio sensor.

Has anyone else used these microphones before?

I am looking to use multiple on PCB to create a sense of direction or some type of 3D audio patern to detect where the sound is coming from?
Can this be done?

And what type of interface is best to use i2c or PDM?

If I am correct with MEMS I do not need to use an ADC, as the output is already digital.
 

Ian0

Joined Aug 7, 2020
9,814
I have used them before and prefer them to the usual "condensor microphone insert", although they are a bit fiddly to solder down, and if you get too much solder on it blocks the hole where the sound goes in.
There are three types: analogue, PDM and I2S (not I2C).
PDM is a bit of a pain, as the resolution is not good, especially at high frequency and there are very few interfaces.
I2S is the newer type - if your MCU has an I2S interface then you are cooking with gas. You can generally set one to "left" and one to "right" and connect two microphones to one I2S "pair".
Analogue is also easy to deal with as it has a push-pull output and doesn't need a bias resistor, but it does need amplification: I generally used a 74HCU04.
Most types are omnidirectional, so you would have to judge direction by phase difference, rather than by amplitude.
All types that I have looked at have a respectable treble response (usually to 20kHz, but always better than 10kHz)
But check the bass response, as some are designed for telephones and rolloff the bass below 100Hz.
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
305
Thanks for your reply.

I will be using a stencil to place the paste, then it will go into a reflow oven.

I2S looks interesting. I will be using the SAMD21J18A, so I will check if it can support it. It seem this interface is like SPI, maybe there is library for this.

If this does not work then Analogue it is. My microcontroller has 12-bit ADC, would i need more resolution such as 16 bit ADC?

Is there a good manufacture to us?

I seen ST has Audio processor for multiple microphones.

So for the best environmental recording is 20 Khz better?

Do we need to also compress the audio?
 

Ian0

Joined Aug 7, 2020
9,814
I will be using a stencil to place the paste, then it will go into a reflow oven.
If you are stencilling by hand, don't get too much paste on.
I2S looks interesting. I will be using the SAMD21J18A, so I will check if it can support it. It seem this interface is like SPI, maybe there is library for this.
SAMD21J18A has I2S. At a guess it will interrupt when the FIFO needs new data, or has received data to process. You will have to service the interrupts every 22us. You might have to write it in assembler.
If this does not work then Analogue it is. My microcontroller has 12-bit ADC, would i need more resolution such as 16 bit ADC?
My application was different - I was just looking for a beat in music, and it worked with a 10-bit A/D. I don't know what you are recording. If you have a large variation in sound level, then you may need better resolution, or you may need to compress the signal before sampling it.

[/QUOTE]
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
305
Well I am developing a experimental road side/environmental audio sensor.

I would like to be able to detect certain types of sound(pre-set) for e.g. cars horning or heavy vehicles driving past.

I am aware that to detect these types of sound, I would need DSP and possible some form of AI to detect audio signatures for the sound I am try to detect.

Therefore I was aiming to capture the sound using MEMS microphone, the TX the files to my server and use MATLAB to detect what I need and once I happy it working on MATLAB , trying to embed the model on a device so it can work without the need of a server/MATLAB.

So in regards to what i am trying to capture and its purpose, how good should the audio quality be in terms of sample rate and ADC?
 

Ian0

Joined Aug 7, 2020
9,814
I don't know - but I'd suggest you download a copy of Audacity, and record some samples with your computer.
Then you can FFT the samples to see if there is much energy in the higher octaves, and if there isn't you can reduce the sampling rate.
You'll get about 70dB signal-to-noise with a MEMS microphone, which suggests that 12 bits might be enough.
When you say "TX" - how are you going to send the data? That might be the limiting factor.
 

MrChips

Joined Oct 2, 2009
30,806
ST has a MEMS microphone demo using two microphones to determine direction of sound source.
If I can find the demo I will post the link.

Search ST for other mems microphone examples.

 

Thread Starter

DJ_AA

Joined Aug 6, 2021
305
I don't know - but I'd suggest you download a copy of Audacity, and record some samples with your computer.
Then you can FFT the samples to see if there is much energy in the higher octaves, and if there isn't you can reduce the sampling rate.
You'll get about 70dB signal-to-noise with a MEMS microphone, which suggests that 12 bits might be enough.
When you say "TX" - how are you going to send the data? That might be the limiting factor.
Yes TX is when my GSM modules send the audio file to the cloud storage.

I am looking into various solutions from multiple manufactures, does the sensitivity of the MEM device need to be calculated for the design, or is it best to go for the highest sensitivity so that all sound is picked up?
 

Audioguru again

Joined Oct 21, 2019
6,691
Today I heard what sounded like a World War II four engine bomber coming to land on my street.
Nope, it was a teen's Subaru car with its muffler replaced with tuned pipes. It revved then produced backfire explosions.
I hear motorcycles blocks away, and large trucks using engine braking.
How will your DSP deal with these sounds?
 
Last edited:

MrSalts

Joined Apr 2, 2020
2,767
Why tie one hand behind your back and limit yourself to audio. If your going full Ai on this, you may as well add a camera module and correlate the sound to the vehicle.
 
Top