Go Down

Topic: ESP32 + multiple i2S MEMS microphones (Read 2815 times) previous topic - next topic

VitaZZ

Hi.
I am using MEMS INMP441 microphone with ESP32-WROOM and it works fine, when I use one microphone. Problem is when I want use two or more microphones. When I want to read values from the first microphone, I call i2s_driver_install(), then i2s_set_pin() and then i2s_read() etc. It works fine. But when I want to switch to second microphone, it returns some bad values. I tried i2s_stop() or i2s_driver_uninstall() and then new installation and i2s_set_pin, but it doesn't works.

So question is if is there some way, how to read values from more than one I2S microphone on ESP32 (change I2S pins "on the fly").
Thank you.


 

Klaus_K

According the datasheet, the INMP441 has a chip enable pin. With this you should be able to switch between devices. Connect one I/O pin for each INMP441 to the CHIPEN pin and drive them low. Whenever you want to read one microphone you can set the pin to high and then read from that microphone. There should be no need to reconfigure the I2S interface.

In Figure 7 of the datasheet it suggests you can group microphones together for stereo operations.

In case you have 4 or more microphones and want to use stero, you could drive both CHIPEN pins with one I/O pin and connect one L/R pin to ground and the other pin high.

InvenSense INMP441 Datasheet

gfvalvo

Why not set up one microphone for the Left I2S channel and the other for the Right I2S channel? That way they could both be enabled and sending data at the same time and you could switch between them "on the fly" by simply taking input from the appropriate channel.
No technical questions via PM. They will be ignored. Post your questions in the forum so that all may learn.

VitaZZ

According the datasheet, the INMP441 has a chip enable pin.
Thank you, I didn't know it. I use this sensors, so I think this CHIPEN PIN is not connected or accessible.

Why not set up one microphone for the Left I2S channel and the other for the Right I2S channel?
I tried it, there were some problems, but I will check it again if it is a way.

VitaZZ

So I tried solution supposed by gfvalvo and it works! I have two (or more) microphones on same i2s bus and I just change L/R channel by giving this pin LOW or HIGH, when I read just left channel. Thanks!

tariqms

can you please provide the pinout i.e. mic pins to esp pins? I've searched for I2S mic with ESP32 but it appears that all other I2S mics have different pins then INMP441, so I am not sure how to wire them up


Hi.
I am using MEMS INMP441 microphone with ESP32-WROOM and it works fine, when I use one microphone. Problem is when I want use two or more microphones. When I want to read values from the first microphone, I call i2s_driver_install(), then i2s_set_pin() and then i2s_read() etc. It works fine. But when I want to switch to second microphone, it returns some bad values. I tried i2s_stop() or i2s_driver_uninstall() and then new installation and i2s_set_pin, but it doesn't works.

So question is if is there some way, how to read values from more than one I2S microphone on ESP32 (change I2S pins "on the fly").
Thank you.


  

gfvalvo

#6
Jan 12, 2020, 12:02 am Last Edit: Jan 12, 2020, 07:42 pm by gfvalvo
can you please provide the pinout i.e. mic pins to esp pins? I've searched for I2S mic with ESP32 but it appears that all other I2S mics have different pins then INMP441, so I am not sure how to wire them up
What do you mean by "different"? The INMP441 has the same signal connections as you expect on any I2S microphone:

SCK: I2S Bit Clock
SD:   I2S Data Out to Processor
WS:  I2S Word Select

The chip's L/R input controls whether it outputs data in the Left or Right of the I2S frame.
No technical questions via PM. They will be ignored. Post your questions in the forum so that all may learn.

Go Up