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

Thread: Selecting microphone input produces static/noise/etc.

  1. #1
    Junior Member
    Join Date
    Jun 2021
    Posts
    4

    Selecting microphone input produces static/noise/etc.

    Hello,

    I soldered up an electret condenser mic that I had laying around to the mic and gnd pins. Red to mic, black to gnd.

    However, I don't hear any audio when doing a passthrough test with my headphones. As i raise the mic gain, i hear more and more noise. Touching my fingers on the pin, I am able to generate some noise as well, but absolutely no audio. I've even tried smacking the small mic on the table -- not even a pop.

    Any idea what the problem could be?

    Here is a link to the mic I am using:

    https://www.digikey.com/en/products/...-L120/10253440

    Hardware:

    Audio Board Rev D
    Teensy 4.1

    Here is the code I am using:

    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioInputI2S            i2s2;           //xy=222,170
    AudioOutputI2S           i2s1;           //xy=578,170
    AudioConnection          patchCord1(i2s2, 0, i2s1, 0);
    
    AudioControlSGTL5000     sgtl5000_1;     //xy=156,296
    // GUItool: end automatically generated code
    
    const int myInput = AUDIO_INPUT_MIC;
    
    void setup() {
      // put your setup code here, to run once:
      AudioMemory(8);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.8);
      sgtl5000_1.inputSelect(myInput);
      sgtl5000_1.micGain(63);
    
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
    
    }

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,687
    A condenser mic needs power. The circuit diagram at the bottom of page 3 of the datasheet shows how to wire the power and a capacitor to the red lead. The specifications on page 1 give the typical supply voltage as 2V and a maximum of 10V. The Teensy 3V3 is well within this so you should have no trouble with it.

    Pete

  3. #3
    Junior Member
    Join Date
    Jun 2021
    Posts
    4
    Quote Originally Posted by el_supremo View Post
    A condenser mic needs power. The circuit diagram at the bottom of page 3 of the datasheet shows how to wire the power and a capacitor to the red lead. The specifications on page 1 give the typical supply voltage as 2V and a maximum of 10V. The Teensy 3V3 is well within this so you should have no trouble with it.

    Pete
    According to the Audio adapter board schematic, bias voltage is already provided for condenser mics:

    Click image for larger version. 

Name:	Screen Shot 2021-06-07 at 6.43.46 PM.png 
Views:	12 
Size:	106.2 KB 
ID:	25001

    Is this not actually on the board?

  4. #4
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,687
    You are correct. Sorry.
    Your code should give you some audio.

    Pete

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,454
    From everything you've described, it really should work.

    As you can see in the audio library tutorial (and video demo) this does work.


    Quote Originally Posted by rainnw View Post
    Any idea what the problem could be?
    Kinda feels like a defective mic or wire between the mic and Teensy.

  6. #6
    Junior Member
    Join Date
    Jun 2021
    Posts
    4
    Thanks Paul and el_supermo for helping me troubleshoot this. I will order another mic off arrow and see if that helps.

  7. #7
    Junior Member
    Join Date
    Jun 2021
    Posts
    4
    UPDATE: The new microphone i ordered (a slight variant) still provides the same old static: https://www.arrow.com/en/products/cm...82/cui-devices

    I have verified my headphones are working, as the tone examples work great.

    Is the hardware indeed bad?

  8. #8
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,101
    If you connect a capacitor between mic and gnd inputs, do you still get static?

Posting Permissions

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