cancel
Showing results for 
Search instead for 
Did you mean: 

How can I interface an electret microphone (condenser) to STM32F4?

DElec.1
Associate II

I want to interface two electret microphones (stereo sound) to STM32F446 chip. I don't know how to connect it or what protocol or pins I have to use. I have found a lot of information about digital microphones but nothing on this topic.

Thanks.

24 REPLIES 24
gregstm
Senior III

Any special frequencies you want to detect? eg. very low frequencies? - ultra high frequencies? If so, I would go digital microphones. With electret microphones you will either have to create your own analog amplifier circuit - or go with a chip that does most of the work for you eg. the MAX4465/MAX4466 (you can even get a little Adafruit board based on the MAX446 that has most of the things you need on it) - and then use the ADC to input the signal. I used to use electret microphones but now have been using digital microphones (first the I2S type, and now the PDM types) - I have been very impressed with their performance (except that I have destroyed a few with my experiments - when you pull them apart you find that they have very delicate structures inside them). The PDM microphones have been difficult to get right from the digital aspect (setting up the DFSDM, DC blocking, decimating filter) but the hardware simplicity and audio sensitivity has been worth the development pain for me.

@Community member​ "use the ADC to input the signal"

Does the STM32F446 have two ADCs? If not, it'll mean switching the one ADC between the two sources - so @DElec.1​ won't have "proper" stereo ...

So might be better using an external dual ADC?

I'm sure stereo analogue front-ends with ADC must be available...

STM32F446 has Maaaaaaany ADC channels distributed into 3 different ADC periprherals.0693W00000NqTlbQAF.png

we dont need to firmware by ourselves, lets talk

and can they be synchronised? So that the 2 "stereo" samples actually happen at the same time.

@DElec.1​ When you said "stereo", did you really mean that? As @Community member​ suggested, it would be helpful to describe what you're actually trying to achieve here - so that people can give appropriate answers.

"at the same time" doesnt exist, is it 40 nanoseconds "at the same time"?

For audio applications i would say yes.

>and can they be synchronised?

Yes, different ADCs can be syncronized. (not the channels, those are going to be converted in a waterfall fashion)

we dont need to firmware by ourselves, lets talk

Interesting question - what are the normal/standard synchronisation tolerances between the two channels of a stereo pair?

Did a very quick google, but didn't come up with anything.

I guess it would depend on the sampling rate - which we don't know yet.

"not the channels, those are going to be converted in a waterfall fashion"

Exactly - that was my point.

https://asa.scitation.org/doi/10.1121/1.5087566

The IDT limit is somewhere around 10 μs. Also think about how much the sound wave travels in that time - 3,4 mm. Will the listener equalize the distance of ears relative to acoustic systems with such a precision? Anyway, for audio applications nanoseconds are definitely "instant".

Hi! Thanks for your reply. I want to detect natural sounds, from 20 Hz to 25KHz with an analog microphone (it is a specificiation).