Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: Analog MEMS mic connected to Audio Shield only picks up noise.

  1. #1
    Junior Member
    Join Date
    Dec 2019
    Posts
    4

    Analog MEMS mic connected to Audio Shield only picks up noise.

    Hi,

    I have an analog mems mic connected to the mic input on the audio shield, transmitting data via the USB to Audacity. A 25uF cap is used on the mic input line.
    Whenever I click record on Audacity the same noise signal is recorded, I have tried changing the gain in the firmware and connecting to the line in pin instead but the result is always the same.
    Can anyone help please?

    Thanks!

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,310
    The info on the part in use would be needed to give a complete answer.

    The ones used by PJRC are on the website and are a Electret Condenser Microphone. Unless the MEMS mic in use presents the same signal levels and range getting noise would be the expected behavior.

  3. #3
    Junior Member
    Join Date
    Dec 2019
    Posts
    4
    Sorry! I'm using the ICS40300.

  4. #4
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    514
    It would be good, if you tested the following audio lib example: examples/HardwareTesting/PassThroughStereo.ino

    Uncomment the following:

    Code:
    const int myInput = AUDIO_INPUT_MIC;
    Connect headphones to the audio shield headphone jack.

    If you do not hear anything in the headphones, then you know that your mic or cap is faulty.

    If you hear the mic signal in the headphones, then your initially used USB/PC soundcard/audacity setup does not work.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,065
    This one, right?

    https://www.invensense.com/download-...300-datasheet/

    Looks like it should work. Can you show us photos of how you've actually connected everything? And the exact code you're running? If we can see what you're actually doing, maybe we'll be able to spot the problem.

    About 1 year ago someone used a similar mic (I2S, not analog). It's easy to get the wires connected backwards. Hopefully from this old thread you can see the value of sharing photos...

    https://forum.pjrc.com/threads/50534...ry-not-working

  6. #6
    Junior Member
    Join Date
    Dec 2019
    Posts
    4
    Hi,

    I've ran that tutorial as suggested and all I hear is noise which doesn't change if I make loud sounds (clapping etc.). Sorry I'm not able to provide pictures right now but I have a cap on the output line, connected to the Mic pin, the Vdd line is also connected to the Mic pin, and the ground is connected to the ground next to the mic pin. Sorry I can't be more helpful!

  7. #7
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Location
    Central Europe
    Posts
    514
    you most probably have wrong connections, because the mic has separate output and Vdd pads!!

    Have a look at the data sheet page 6.

    I am afraid nobody can be of more help unless you post pictures of your exact setup AND the code you are using.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,065
    Quote Originally Posted by jessr95 View Post
    the Vdd line is also connected to the Mic pin
    Oh that doesn't sound right. I'm pretty sure you need to connect VDD (pin 5) of the ICS40300 to 3.3V on the Teensy.

  9. #9
    Junior Member
    Join Date
    Dec 2019
    Posts
    4
    Okay so this is what I have so far:

    Vdd connected to 3.3V, ground connected to GND pin next to MIC pin, and output connected to MIC pin with 10uF capacitor (not 25uF I was mistaken).

    The code I'm using is the PassThroughStereo example (pasted below), and all I hear is a buzzing sound coming through the headphones.
    I've tried uploading pictures but everytime it says upload failed.

    /*
    * A simple hardware test which receives audio from the audio shield
    * Line-In pins and send it to the Line-Out pins and headphone jack.
    *
    * This example code is in the public domain.
    */

    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>

    // GUItool: begin automatically generated code
    AudioInputI2S i2s1; //xy=200,69
    AudioOutputI2S i2s2; //xy=365,94
    AudioConnection patchCord1(i2s1, 0, i2s2, 0);
    AudioConnection patchCord2(i2s1, 1, i2s2, 1);
    AudioControlSGTL5000 sgtl5000_1; //xy=302,184
    // GUItool: end automatically generated code


    //const int myInput = AUDIO_INPUT_LINEIN;
    const int myInput = AUDIO_INPUT_MIC;


    void setup() {
    // Audio connections require memory to work. For more
    // detailed information, see the MemoryAndCpuUsage example
    AudioMemory(60);

    // Enable the audio shield, select input, and enable output
    sgtl5000_1.enable();
    sgtl5000_1.inputSelect(myInput);
    sgtl5000_1.volume(0.5);
    sgtl5000_1.micGain(63);

    }

    elapsedMillis volmsec=0;

    void loop() {
    // // every 50 ms, adjust the volume
    // if (volmsec > 50) {
    // float vol = analogRead(15);
    // vol = vol / 1023.0;
    // //audioShield.volume(vol); // <-- uncomment if you have the optional
    // volmsec = 0; // volume pot on your audio shield
    // }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •