ESP32 Audio Input Showdown: INMP441 vs SPH0645 MEMS I2S Microphones!

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 130

  • @atomic14
    @atomic14  3 роки тому +4

    Interested in ESP32 Audio: ua-cam.com/play/PL5vDt5AALlRfGVUv2x7riDMIOX34udtKD.html
    Looking for all my ESP32 projects: ua-cam.com/play/PL5vDt5AALlRdN2KyL30l8j7kLCxhDUrNw.html

    • @brodietaylor7467
      @brodietaylor7467 3 роки тому

      @Kairo Kabir instablaster ;)

    • @yangjack8695
      @yangjack8695 2 роки тому

      however esp32s3 can't driver sph-0645 microphone sensor ! mybe the register address is different

    • @djkgk
      @djkgk 7 місяців тому

      Hello I have an Invensense Ics 43432 microphone how can I use it to calculate decibels values of sound ? Thank You.

  • @GadgetAddict
    @GadgetAddict 4 роки тому +20

    Wow these videos are going to save me a lot of time. Thanks for doing these tests. I'm glad you also tested them without your filter.

  • @leozendo3500
    @leozendo3500 3 роки тому +4

    this is a perfect conversion from information to knowledge.

  • @jonaslima4398
    @jonaslima4398 3 роки тому +1

    Thanks a lot! I thought the INMP1441 I had bought was broken because it didn't work at all, but your explanation and your code made it work beautifully!

    • @atomic14
      @atomic14  3 роки тому +1

      That's great news. It can be really hard to debug these things. I've just spent a day trying to work out why an SPI peripheral wouldn't work. Sometimes we really are just fumbling around in the dark.

  • @NickReynolds
    @NickReynolds 4 роки тому +3

    Thanks, for a clear simple comparison between these and the analogue input.

    • @atomic14
      @atomic14  4 роки тому +1

      Thanks! I'm surprised at how much better the I2S microphone board is performing. I guess it's a much more modern bit of tech and the processing of the signal is a lot more advanced.

    • @NickReynolds
      @NickReynolds 4 роки тому

      @@atomic14 I'm thinking about adding a microphone to an ESP32-CAM board, need to check which pins are free (there aren't many) to see if it's practical or not.

    • @atomic14
      @atomic14  4 роки тому +1

      Yes, the ESP-CAM is a bit of a pain as they haven't left may pins open. I think you can free up some pins by disabling the flash card if you aren't using it and you can re-use the serial lines once you've programmed the board.

    • @atomic14
      @atomic14  4 роки тому

      If you can find 3 spare pins then you should be good - I know the ESP32-CAM board is pretty limited as they've used up a lot of the pins already.

  • @davidt1516
    @davidt1516 4 роки тому +4

    And to add insult to injury, with the SPH0645 there is a positive "DC offset" in the digital that is limiting the dynamic range of the linear pcm by 20%-30% in the positive side

    • @sjetmand
      @sjetmand 6 місяців тому +1

      Anyone figure out why / a solution to this?

  • @AndrewTuline
    @AndrewTuline 3 роки тому +1

    This as well as the analog video (at ESP32 Audio Input Using I2S and Internal ADC - UA-cam) are gospel. They sure demonstrates some of the issues we've encountered with our sound reactive fork of WLED.

    • @atomic14
      @atomic14  3 роки тому

      Sound reactive WLED sounds really interesting! I'll have to check it out.

  • @maximus6884
    @maximus6884 2 роки тому

    Thanks for sharing the audio clips. very useful to get the idea before purchase.

  • @julioguzman5197
    @julioguzman5197 Рік тому +1

    Great job on explaining this, I am a total noob but it kind of gives me a broad idea of how I should try doing RCA inputs or 3.5 jack input as im using it for the WLED in a car

  • @ijustwanttogosailing8248
    @ijustwanttogosailing8248 4 роки тому +3

    You might want to add such 'peace of mind' power supply to your ebay page..
    Even if as a bare PCB - people who might want one either already have parts to populate it or can get them easily.

  • @ardhanswareska6838
    @ardhanswareska6838 3 роки тому

    Wow, great video. its very helpful for my examination project! Thanks a lot

    • @atomic14
      @atomic14  3 роки тому

      Glad it was helpful! Hope the project went well.

  • @autorlss1542
    @autorlss1542 4 роки тому +1

    really good, really helpful! Thanks!

  • @gang208
    @gang208 2 роки тому +1

    At time 2'40", you have the GPIO35 wired as SCK (BCLK) which is clock output to the serial clock of the I2S microphone. However, on most (if not all) ESP32, GPIO35 is an input only pin. You code looks correct when using GPIO32, but the Dout should be on a pin other than GPIO32.

    • @atomic14
      @atomic14  2 роки тому

      oooh - good spot! The diagram is wrong.

  • @imjustger
    @imjustger Рік тому

    Thank you so much, this was so useful.

  • @seanyong1123
    @seanyong1123 4 роки тому +2

    Hi atomic14, really really enjoying your videos and the work you've put into them. I'm trying to follow along with the projects and have downloaded the source code to play around with. I currently am using the INMP441 microphone connected to the ESP32 as per the wiring diagram on the github page. I have been able to get the esp32 to connect over wifi to stream the i2s data back. However, I am running into an issue with the quality of the audio received. I have been importing the audio into audacity with the settings - 16 bit signed PCM, 16000hz sampling rate and mono channel. While I am able to hear most of the high level features of the audio, the audio file is generally very distorted and has lots of hissing and popping noises in the background which is very different to what I've seen in your videos. Do you have any suggestions or advice on what I could potentially be getting wrong? Thanks

    • @atomic14
      @atomic14  4 роки тому

      Hi Sean,
      Can you open up an issue on the GitHub repo and we can try and troubleshoot what you are seeing, If you can attach a sample of the audio you are getting that would be really useful.
      Thanks
      Chris

  • @hassaansaleem6886
    @hassaansaleem6886 3 місяці тому

    Hi there, this is Hassan, at 2:51, you shared the schematic diagram of the circuit, could you let me know which platform you used to make it on. I have a similar project, and I had to make a schematic of it. Unfortunately, I couldn't find any online tool where the mic module could be available.
    My project uses an SD card, and an esp32 as well, I hope to hear from you soon.

  • @wasauce
    @wasauce 4 роки тому +2

    Great video. Thank you! Do you have the specs / schema for the PCB you created and had made for you? I'd be interested in taking a look and having one made so I can try to follow along directly. I'm new to this and interested in learning. Thank you very much!

    • @atomic14
      @atomic14  4 роки тому +3

      Here you go - easyeda.com/chris_9044/esp32-audio-board
      With the INMP441 I'm not sure it's really needed as it seems to handle the noisy power supply pretty well.

    • @wasauce
      @wasauce 4 роки тому

      @@atomic14 Thank you for the reply. I greatly appreciate it!

  • @HokageUub
    @HokageUub Місяць тому

    Hi, I noticed that GND and VDD are not connected to anything in the circuit diagram. Are they supposed to be connect to something?

  • @anuragpaul2582
    @anuragpaul2582 2 роки тому

    Hi
    First of All thanks for the demo. I am trying to implement the same and I wanted to ask how are you taking care of the data that's coming as 2's compliment.

  • @abhiroy1993
    @abhiroy1993 4 роки тому

    Thanks a lot. Helped me greatly.

  • @dirrelito
    @dirrelito Рік тому

    Nice video! I'd be very interested in your choice of components for the power supply filtering. What values did you use?

  • @alhdlakhfdqw
    @alhdlakhfdqw 2 роки тому

    really amazing video thank you very much! subbed :)

  • @raffyturc
    @raffyturc 3 роки тому

    wow! what a BIG difference in audio. I hope youd have a project INMP441(mic) and output it in analog(esp32?) with agc.

    • @atomic14
      @atomic14  3 роки тому

      I've been thinking about doing this for a while!

  • @emabelloni
    @emabelloni 3 роки тому +1

    Great videos, they helped me a lot! Thank you. I am trying to use a INMP441 to build a guitar tuner but I cannot use the autocorrelation functions to do that. Anyone has ever built a Guitar Tuner with I2S and Esp32?

  • @swagathprakash2044
    @swagathprakash2044 3 роки тому +1

    Could you please make a video on how to record voice commands and with esp8266 send the audio to raspberry pi over local wifi...please

  • @nicolascumu7044
    @nicolascumu7044 4 роки тому +1

    Nice video. One of the big advantage of i2s micro mems is the known value of the expected RMS level for 94dB @ 1000 Hz . So you do not really need to calibrate the microphone. I would like to know the diameter of the INMP1441, it would be good if it fit inside 1/2" tube.

    • @atomic14
      @atomic14  4 роки тому

      My callipers says it's about 14.5mm (0.57inch) diameter. All the breakout boards that I've been able to find follow the same form factor.
      There is this later version of the microphone - the ICS43434 - and there are some breakout boards for it that are really tiny. Unfortunately, they only seem to be available shipped from the US - www.tindie.com/products/onehorse/ics43434-i2s-digital-microphone/

  • @darealspectrum3637
    @darealspectrum3637 11 місяців тому

    Thanks for the video very helpful, by chance i have question which of these sensors (mems or analog ones) is capable to use in such projects like beehive sound detection? any advice ..

  • @TheKitKiln
    @TheKitKiln 2 роки тому

    Thanks for the video! I have been working on an audio project with the ESP32 and digital mics and have been having trouble getting anything to work. Do you have any tutorials on how to use your source code? I am not sure how to get it on to the ESP32. Thanks!

  • @Shadoweee
    @Shadoweee Рік тому

    Would it be posibble to use a proper mic capsule (ie JLI-2555BXZ3-GP) somehow? Then transfer it via wi-fi like You did in one of Your other videos.

  • @abhiram4032
    @abhiram4032 6 місяців тому

    @ atomic14 may i know how to save the recorded audio from the inmp441 to the audacity?

  • @islamothman2755
    @islamothman2755 2 роки тому

    I'm really having problems converting adc buffer or captured sound buffer to a playable .wav format.
    How did u do it ?
    Thanks in advance

  • @Paolosito1245
    @Paolosito1245 3 роки тому

    Great video, look forward to use it in my projects, although I have a question, why do you connect the L/R pinout of the INMP441 to 3v3?

    • @atomic14
      @atomic14  3 роки тому +1

      Hi Gian, I2S is very much based around stereo audio so you have a left and right channel with only one data line for the left and right. You need to tell devices if they are on the left or right channel otherwise they won't know when to send their data. Tieing the L/R line to 3v3 tells it that it should send its data when the left channel is requested.

  • @SA-oj3bo
    @SA-oj3bo 2 роки тому

    Hi, is it possible to use an I2S microphone + ESP32 and stream the audio captured by the microphone to a PC or RP where it is recorded and analyzed later? Thx for y advise.

  • @gang208
    @gang208 2 роки тому

    Thanks for the convincing demonstration that whenever possible I2S microphone is a better choice. However, it's not clear to me why the INMP441 is "hands down" better than the SPH0645. From the audio, they sound quite similar. Can you elaborate?

    • @atomic14
      @atomic14  2 роки тому +1

      From what I read there is some weird timing incompatibility - it can be worked around, but it’s not ideal: hackaday.io/project/162059-street-sense/log/160705-new-i2s-microphone

    • @gang208
      @gang208 2 роки тому

      @@atomic14 Ah, thanks! I thought the mis-alignment was the problem of the ESP32 I2S, but after reading your code on Github, I realized that the workaround is only needed for the SPH0645. Yes, that makes the INMP441 the preferred device.

  • @roysigurdkarlsbakk3842
    @roysigurdkarlsbakk3842 Рік тому +1

    I wonder how you managed to make the ESP32 output the clock signal on GPIO35 - it's input only…

    • @atomic14
      @atomic14  Рік тому +1

      Good spot - that's an error in the diagram. The linked GitHub repo uses the following pins:
      .bck_io_num = GPIO_NUM_32,
      .ws_io_num = GPIO_NUM_25,
      .data_out_num = I2S_PIN_NO_CHANGE,
      .data_in_num = GPIO_NUM_33

  • @chenweiguang
    @chenweiguang 2 роки тому

    Can i read four INMP441 sound signals at the same time? I want to use esp32+4*inmp441 to make a voice location. Thank you

  • @hanswurst9866
    @hanswurst9866 2 роки тому

    could you try out the Adafruit PDM Microphone which is digital but not I2S and not PWM?

  • @mariomame609
    @mariomame609 3 роки тому

    Very very good

  • @romainboutet8364
    @romainboutet8364 Рік тому

    Hi there ! I'm facing a strange issue, the SPH0645 only works when I put WS to ground, I'm using an ESP32-S3 on a custom PCB and I used your tweak settings to make it work however the only way to get a valid output from the mic is to try putting WS to the ground multiple times after the startup...
    If I don't do that I get random and incoherent values.
    I'm really struggling to get around this problem, so any help would be welcome ^^

    • @atomic14
      @atomic14  Рік тому

      If you join the discord server you can share your schematic+code we can have a look and see if anything is obvious.discord.gg/PKrNGqN6

  • @Avisqq
    @Avisqq 3 роки тому

    Do you know of any microphones compatible with the esp32 that can handle 120db +?

  • @TechInventorAman
    @TechInventorAman 4 роки тому

    Tell me something , what interface did you use to capture the audio directly into the audacity software. Like the mic is connected to the esp32 and is there any plugin that directly sends the audio to the audacity ?? i would like to know that in detail .

    • @atomic14
      @atomic14  4 роки тому

      Hi there, we stream the audio from the ESP32 to a server running on a laptop or desktop and save the audio to a file. That file can then be loaded into Audacity using the import raw audio feature. Code for the server should be in the repo here - github.com/atomic14/esp32_audio. I don't think there is any plugin that will let you send the audio directly to Audacity,

    • @TechInventorAman
      @TechInventorAman 4 роки тому

      @@atomic14 Well i did not found the code in order to interface the i2s mic to the esp. I was specifically trying to look for an ino file but i did not found any . Could you guide me as to where is that code in that repo ( sorry if my question sounds stupid to you ) as i am not a very advanced programmer rather a noob but i'm good with hardware stuff .

    • @atomic14
      @atomic14  4 роки тому

      @@TechInventorAman Hi Aman, the code in the demo repo is using platform.io for the IDE. There is a much simplified version here which will work with the Arduiono IDE - github.com/atomic14/ICS-43434-breakout-board

  • @Zuzu7570
    @Zuzu7570 Рік тому

    Hi mr atomic14, I faced this error: [E][WiFiClient.cpp:268] connect(): socket error on fd 48, errno: 104, "Connection reset by peer" , could you help me please!

  • @user-ml1jx3oi8r
    @user-ml1jx3oi8r Рік тому

    Is it possible to use audio input (e.g. inmp441 i2s) or audio output (e.g. max98357A i2s) via a port expander? If yes how is it done, especially the pin config? Thanks for any advice.

    • @gauravpurohit1234
      @gauravpurohit1234 Рік тому

      please tell me can we use both to make a line pass for hearing aid solution

  • @wuyongzheng
    @wuyongzheng 3 роки тому

    1:00 the sensor is soldered on the bottom. What's the reason? avoid wind noise? avoid collecting dust? I put the sensor on top, because I think that's where the sound comes from.

    • @atomic14
      @atomic14  3 роки тому

      MEMS microphones come in two different styles, top ported and bottom ported. Top ported versions have a hole in the top of the microphone for the sound to enter. Bottom ported have the hole in the bottom and you need to have a matching hole in the PCB to let the sound in. Both the INMP441 and the SPU0645 are bottom ported.

    • @wuyongzheng
      @wuyongzheng 3 роки тому

      @@atomic14 oh I see. Thank you.

  • @gauravpurohit1234
    @gauravpurohit1234 Рік тому

    how to pass the INMp441 to speaker directly ...is this possible

  • @seget96
    @seget96 3 роки тому

    Great video! I'm planning to use esp32-cam for an IoT project. There's going to be live video and audio input to watch on smartphone. And there will be a motor and 2 sensors. Can esp32 handle these together? Or is there any other recommendations?

    • @atomic14
      @atomic14  3 роки тому +1

      An esp32 can certainly handle all of that together. You may struggle with the number of available GPIO pins on the esp-cam boards. A lot of the pins are taken up by the camera board so you aren't left with many.

    • @seget96
      @seget96 3 роки тому

      @@atomic14 Thank you so much for your attention to my question. I'll consider this.

    • @atomic14
      @atomic14  3 роки тому +1

      @@seget96 There's a good guide here - randomnerdtutorials.com/esp32-cam-ai-thinker-pinout/ if you aren't using the SDCard you'll get a few pins back.

    • @seget96
      @seget96 3 роки тому

      @@atomic14 Wow I didn't know that! I appreciate it! Thanks a lot :)

  • @aliyunoura
    @aliyunoura Рік тому

    Hello sir, please can i have the schematics of the filter? Thenko

  • @rickyelqasem
    @rickyelqasem 3 роки тому

    Is there a breakout board that allows for a line-in instead of a microphone? So it can take audio from an analog source?

    • @atomic14
      @atomic14  3 роки тому

      There's a couple of options, you can use the built-in ADCs - ua-cam.com/video/pPh3_ciEmzs/v-deo.html There are also some I2S ADC boards, but they seem to be quite unusual. The majority seem to be I2C. I did find this one though - www.sparkfun.com/products/retired/9365

    • @rickyelqasem
      @rickyelqasem 3 роки тому

      @@atomic14 what about a decent library? On conventional Arduino there is an audio library that doesn't require a lot of setup... play, record, and not much more .

  • @raffyturc
    @raffyturc 3 роки тому

    is the esp32 powerful enough to bandpass 300Hz-3KHz + DAC?

    • @atomic14
      @atomic14  3 роки тому

      Hi Raffy, it should be yes - they are pretty powerful processors.

  • @167mm167
    @167mm167 2 роки тому

    awesome ..

  • @sjs5256
    @sjs5256 2 роки тому

    What is the PC software to Display and record the sound data?

  • @mmm-xs5en
    @mmm-xs5en 3 роки тому

    YOU ARE THE BEST

  • @calebhopper7371
    @calebhopper7371 3 роки тому

    Hey chis, I'm wondering if you can help me out with the server side?

    • @atomic14
      @atomic14  3 роки тому

      If you raise an issue on the GitHub project I'll try and help. The server side is very basic - it just records raw audio to a file.

  • @kellyrummins3338
    @kellyrummins3338 3 роки тому

    I'm in NZ so hard to get components. I can source the SPH0645 from Aussie. I am using the ESP32. Is it worth going down this path or should I be patient and order from further away!

    • @atomic14
      @atomic14  3 роки тому

      I would go ahead and use the SPH0645.

    • @kellyrummins3338
      @kellyrummins3338 3 роки тому

      @@atomic14 Thank you for your very fast response. I have been spending a fair bit of time searching. Frustrating when supply is the biggest issue! One board that is available in NZ is Pmod MIC3: MEMS Microphone with Adjustable Gain by Digilent. It appears to have what is needed but I cannot find anyone using it with an ESP32 just the Adruino. Worth a try? (I am newbie at this).

    • @atomic14
      @atomic14  3 роки тому

      @@kellyrummins3338 That should work - it has an SPI interface which the ESP32 supports. The code you see for Arduino should work on the ESP32 as well.

    • @kellyrummins3338
      @kellyrummins3338 3 роки тому

      @@atomic14 Fantastic. Thanks again so much. Your audio project videos have been immensely helpful.

    • @atomic14
      @atomic14  3 роки тому

      @@kellyrummins3338 You can also use the built-in ADCs they aren't really that bad for audio input provided you can give your microphones a good clean power supply.

  • @shodanxx
    @shodanxx 3 роки тому

    Is there a way to use an external wire microphone but retain the i2s interface ?
    I want to make a wifi wireless headset compatible with pulseaudio
    I want one esp32 to have two audio output channels and one audio input channel for the microphone.
    But what chip can take signal from a normal microphone and turn that into a i2s signal ?

    • @atomic14
      @atomic14  3 роки тому

      Hi there, In theory, this is definitely possible. there are a few I2S adc converter chips and if you google you will find some breakout boards. I have read a few forum posts with people struggling to get thingsto work consistently www.esp32.com/viewtopic.php?f=12&t=10749. There are also SPI based ADC converters which you could use instead of I2S. Depending on the board you find you will need a microphone pre-amp to boost the mic signal up to a sensible level.

    • @gauravpurohit1234
      @gauravpurohit1234 Рік тому

      any success, i want to INMp441 mic and stero out from esp32

  • @zidqih7081
    @zidqih7081 4 роки тому

    How far the distance between your mouth (as sound source) to the mic?

    • @atomic14
      @atomic14  4 роки тому +1

      Fairly close. One of the downsides with these mics is that they don't have a built in AGC. They do have great dynamic range - 24bits but using that full dynamic range comes with its own challenges. I've been looking at adding in a very simple AGC which hopefully I'll have a tutorial on soon.

  • @chaitanyadas1814
    @chaitanyadas1814 3 роки тому

    thanks sir for posting these videos. I am using SPH0645 with sampling rate = 16k , bits per sample = 32, and variable buffer lengths and counts. but no matter what i set buffer lenght and count by recorded audio is FASTER . if i speak for 5 second recorded one is kind of 2 second long. Any comments on that

    • @atomic14
      @atomic14  3 роки тому

      How are you loading the raw data? You could be importing it as stereo - which would cause it to double in speed.

    • @chaitanyadas1814
      @chaitanyadas1814 3 роки тому

      @@atomic14 thanks for replying. i am only using left channel and am selecting mono while loading raw in audacity. I think the culprit is size attribute in i2s_read() function , i.e the 3rd one. kindly put some light on it

    • @atomic14
      @atomic14  3 роки тому

      @@chaitanyadas1814 when you read the data in are you specifying 16 or 32 bits? In my code and convert the 32 bit data to 16 bits before using it.

    • @chaitanyadas1814
      @chaitanyadas1814 3 роки тому

      ((bits+8)/16)*SAMPLE_PER_CYCLE*4 , i mean this formula from the documentation . what are bits and sample_per_cycle variables in above formula

    • @atomic14
      @atomic14  3 роки тому

      @@chaitanyadas1814 If you look at the sample code attached to the video you can see that the 3rd argument is just the number of bytes you want to read from the I2S device. They are using that formula to try and make sure they read enough bytes to hold complete samples. To be honest I would ignore that formula as it's quite confusing and generally you want to read quite a few samples. If you are using 32 bits then each sample takes up 4 bytes.

  • @rajbirsingh4879
    @rajbirsingh4879 3 роки тому

    Thanx for the great video, I have an INMP441 mic, could you please how to record the sound the play after that

    • @rajbirsingh4879
      @rajbirsingh4879 3 роки тому

      Hello, please help me how to play the recorded sound.

    • @atomic14
      @atomic14  3 роки тому

      I don't currently have any sample code for recording and playback on device. The sample code I currently have sends the audio to a PC running a small server. The audio is saved to file as raw samples so you need to use a tool like Audacity to load the samples and play them.

    • @rajbirsingh4879
      @rajbirsingh4879 3 роки тому

      @@atomic14 i think the server you are talking about is your personal one.

    • @atomic14
      @atomic14  3 роки тому

      @@rajbirsingh4879 Yes, the code runs on your local machine. I think you want to record to the device and play back from there? You will be limited by the amount of memory so you will probably want to record to flash or SD card. Recording to flash is quite difficult as it's quite slow. If you have a device with PSRAM then you can record to memory without any problems. I don't have any code to show this at the moment though.

    • @rajbirsingh4879
      @rajbirsingh4879 3 роки тому

      @@atomic14 Yes, actually I want to record the voice and want to hear what I am recording.
      I have an SD card adaptor.
      Please let me know how i can do that

  • @edgull_tlt
    @edgull_tlt 3 роки тому

    Спасибо

  • @achmadarifmunaji3320
    @achmadarifmunaji3320 3 роки тому

    can i use INMP441 even if it's not soldered?

    • @atomic14
      @atomic14  3 роки тому

      Hi Achmad - I'm not sure what you mean - can you explain what you are trying to do in a bit more detail?