Hi all,
I want to connect the MEMS-microphone ICS43434 to the ESP32. This microphone chip comprises I2S Interface to transmit the audion data stream. There is an "I2S.h" library compatible for the Arduino board MKRZero. I'm looking for a library for ESP32. Has somebody already done the porting or using similiar library for ESP32 ?
ESP32 using ICS43434 as MEMS microphone in Arduino IDE
Re: ESP32 using ICS43434 as MEMS microphone in Arduino IDE
+1
I am able to use these mics with the nRF52 and STM32L4 and Teensy (various) but am not sure if there is an easy way to do so with the ESP32 Arduino core.
I am able to use these mics with the nRF52 and STM32L4 and Teensy (various) but am not sure if there is an easy way to do so with the ESP32 Arduino core.
Re: ESP32 using ICS43434 as MEMS microphone in Arduino IDE
did you try simple insert the megaphone c code example in your arduino project?tolo69 wrote:Hi all,
I want to connect the MEMS-microphone ICS43434 to the ESP32. This microphone chip comprises I2S Interface to transmit the audion data stream. There is an "I2S.h" library compatible for the Arduino board MKRZero. I'm looking for a library for ESP32. Has somebody already done the porting or using similiar library for ESP32 ?
try it - i am sure it work's
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: ESP32 using ICS43434 as MEMS microphone in Arduino IDE
The microphone data can be captured. But in the Serial plotter I'm facing square wave, but I would expect analog graph. What do I have to change in my Code?
Code: Select all
#include <WiFi.h>
#include "driver/i2s.h"
void i2s_config() {
// http://esp-idf.readthedocs.io/en/latest/api/perip herals/i2s.html
// input
i2s_config_t i2s_in_config = {
mode: (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX),
sample_rate: 44100,
bits_per_sample: (i2s_bits_per_sample_t)32,
channel_format: I2S_CHANNEL_FMT_RIGHT_LEFT,
communication_format: (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB),
intr_alloc_flags: ESP_INTR_FLAG_LEVEL1,
dma_buf_count: 14,
dma_buf_len: 64
};
i2s_pin_config_t i2s_in_pin_config = {
bck_io_num: 16,
ws_io_num: 4,
data_out_num: -1, //Not used
data_in_num: 17
};
pinMode(17, INPUT);
pinMode(16, OUTPUT);
pinMode(4, OUTPUT);
i2s_driver_install((i2s_port_t)0, &i2s_in_config, 0, NULL);
i2s_set_pin((i2s_port_t)0, &i2s_in_pin_config);
}
void read_i2s() {
uint32_t sample_val[2] = {0, 0};
uint8_t bytes_read = i2s_pop_sample((i2s_port_t)0, (char *)sample_val, portMAX_DELAY);
Serial.println(sample_val[0]);
}
void setup()
{
Serial.begin(115200);
delay(4000);
i2s_config();
}
void loop()
{
read_i2s();
}
Re: ESP32 using ICS43434 as MEMS microphone in Arduino IDE
I don't use arduino, but just looking at your code, here are some ideas:tolo69 wrote:The microphone data can be captured. But in the Serial plotter I'm facing square wave, but I would expect analog graph. What do I have to change in my Code?
1. "sample_val" should be signed (aka "int32_t", not "uint32_t")
2. the println might be slowing down your sampling. Might want to buffer up (maybe 100 samples atleast?) and print them all at once
Re: ESP32 using ICS43434 as MEMS microphone in Arduino IDE
Correcting the data type of sample_val to int32_t solved the problem Not it works
Thanks a lot
Thanks a lot
Re: ESP32 using ICS43434 as MEMS microphone in Arduino IDE
Please post the entire working Arduino sketch or link to a github repository where I can find it. Thanks!
Re: ESP32 using ICS43434 as MEMS microphone in Arduino IDE
It is same sketch as posted above. Just 1 line has to be replaced:
uint32_t sample_val[2] = {0, 0}; ---> int32_t sample_val[2] = {0, 0};
uint32_t sample_val[2] = {0, 0}; ---> int32_t sample_val[2] = {0, 0};
Who is online
Users browsing this forum: No registered users and 15 guests