Can't get audio signal from mic on Audio Board (w/ Teensy 3.2)

Status
Not open for further replies.

dbaylies

Active member
Hey everyone! I'm new to using PJRC products, and honestly new to seriously meddling with electronics as well. I'll try to keep this post as detailed and informative as possible.

I've recently purchased a Teensy 3.2 and Audio Shield for use with a project I'm working on. I'd like to sample audio with a microphone and convert that audio to MIDI signals for use with a softsynth. The mic will eventually be placed in a trumpet mouthpiece to allow trumpet players to control various sounds using their hard-earned trumpet chops.

The roadblock I'm at right now is getting any sort of audio signal from my mic. Here's a picture of my setup:

Optimized-IMG_20160712_235152.jpg

I'm running the "Part_2_04_Microphone_Check" code provided by the audio library tutorial, which I've attached at the bottom. The Teensy Loader is working, as I've gotten the various blinking LED Hex files to work. However, with the code loaded, I hear nothing from my headphones. I've tried the electret mic shown in the image above, as well as a few of these. None change the result!

As I'm new to soldering, one suspicion I have is that I burnt the board or have an incomplete connection somewhere. Here's a picture of my soldering job connecting the audio shield to the Teensy 3.2:

Optimized-IMG_20160712_234519.jpg


My plan is to meticulously check voltages all across the signal path, confirm that my mics work, and try to get the line in connection to feed audio to the 3.5mm jack. I may also try resoldering some of the connections, although I've been told they should be okay.

If I can't eventually figure this out, I may just buy the full audio tutorial kit, as everything is already assembled, and I don't have much time left on this project! Hopefully, though, it won't come to that.

If anyone has suggestions, or knows of any known bugs I should be aware of, please let me know!

Additional info:
Arduino 1.6.9
Teensyduino 1.29-beta3
Mac OSX 10.9.5

Code:
// Advanced Microcontroller-based Audio Workshop
//
// https://github.com/PaulStoffregen/AudioWorkshop2015/raw/master/workshop.pdf
// https://hackaday.io/project/8292-microcontroller-audio-workshop-had-supercon-2015
// 
// Part 2-4: Using The Microphone


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

// GUItool: begin automatically generated code
AudioInputI2S            i2s1;           //xy=163,119
AudioOutputI2S           i2s2;           //xy=389,119
AudioConnection          patchCord1(i2s1, 0, i2s2, 0);
AudioConnection          patchCord2(i2s1, 0, i2s2, 1);
AudioControlSGTL5000     sgtl5000_1;     //xy=341,230
// GUItool: end automatically generated code



void setup() {
  Serial.begin(9600);
  AudioMemory(8);
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.5);
  sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
  sgtl5000_1.micGain(60);
  delay(1000);
}

void loop() {
  // do nothing
}
 
I've spent the day looking into this issue, to no avail. Unfortunately I've been unable to check voltages along the signal path or check if my mics work as I've spent my time learning fundamental electronics and coding!

While I'd love to continue learning these things, I was wondering if someone might point me in the right direction with regards to which pins I should check for confirming that the signal is making its way to the headphone jack. Ideally, I'd like to send a simple sine wave from my computer to the headphone jack, but I've been so far unsuccessful in figuring out how to write a code for that! Could anyone provide such a code?

Thanks in advance - in the meantime, I'll keep teaching myself how to do these things.
 
Do the other examples work ? Did you try output-only (for example with playing sound from SD-Card) ?
and I don't have much time left on this project!
That's bad. Converting "Micro to MIDI" is very challanging.. do you have some experience or at least a plan ?
 
No example gives an audio output at the headphone jack, and I don't have an SD card on hand, although I suppose I could purchase/find one.

I do have an outline for the project, although the specifics are not well-defined. I'd like to take an FFT of the audio, and convert various parameters of the FFT to MIDI signals, which will control a software synth. I may have exaggerated a bit with the time constraint - I have about five weeks, although I'm sure I'll continue afterwards of my own free will.
 
Last edited:
PIN6 does not look ..healthy... make sure that you don't connect the pins with the trances between them..
Re-check the other pins, too.
 
Last edited:
I've cleaned up my soldering job:

Optimized-IMG_20160715_161132.jpg

But nothing changed!

So I've tried a few things:

1. Passed a 440 Hz sine wave into the line in of the audio board. The voltage certainly made it to the line in, but I got nothing from either line out or the headphone jack.

2. Ran the ToneSweep teensyduino example. I noticed that a signal was passed to pin 22 (Tx), but still got nothing from either line out or the headphone jack. No voltage change, no audio.

So is my SGTL5000 just dead? I'm really running out of things to check here...
 
Last edited:
For lineout, you'll need to unmute it:
Code:
  sgtl5000_1.unmuteLineout();

but the headphones should work.

Pete
 
Still nothing!

With this code, I should be able to send audio through linein and hear audio through lineout and headphones, right? I'm asking you to check because I still haven't developed the confidence to parse teensyduino code myself.

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

// GUItool: begin automatically generated code
AudioInputI2S            i2s1;           //xy=163,119
AudioOutputI2S           i2s2;           //xy=389,119
AudioConnection          patchCord1(i2s1, 0, i2s2, 0);
AudioConnection          patchCord2(i2s1, 0, i2s2, 1);
AudioControlSGTL5000     sgtl5000_1;     //xy=296,189
// GUItool: end automatically generated code



void setup() {
  Serial.begin(9600);
  AudioMemory(8);
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.5);
  sgtl5000_1.inputSelect(AUDIO_INPUT_LINEIN);
  sgtl5000_1.unmuteLineout();
  sgtl5000_1.micGain(36);
  delay(1000);
}

void loop() {
  // do nothing
}
 
Can you put a couple println in the setup routine to see if the code is making it through the entire setup via the serial monitor?
 
O.K. This time. I can get microphone to play through to headphones but only if I put it through a mixer first.
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputI2S            i2s1;           //xy=163,119

AudioMixer4              mixer;
AudioConnection          patchCord1(i2s1, 0, mixer, 0);
AudioConnection          patchCord2(i2s1, 0, mixer, 1);

AudioOutputI2S           i2s2;           //xy=389,119
AudioConnection          patchCord3(mixer, 0, i2s2, 0);
AudioConnection          patchCord4(mixer, 0, i2s2, 1);
AudioControlSGTL5000     sgtl5000_1;     //xy=296,189
// GUItool: end automatically generated code



void setup() {
  Serial.begin(9600);
  AudioMemory(8);
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.5);
  sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
  sgtl5000_1.unmuteLineout();
  sgtl5000_1.micGain(36);
  mixer.gain(0, 0.5);
  mixer.gain(1, 0.5);
  delay(1000);
}

In theory, if you change MIC to LINEIN this should work.
Note that the i2s2 object is instantiated immediately before it is used in the connections. If there are any other declarations between the two, strange things will happen.

Pete
 
That looks good. One thing you can try. Put the AudioMemory block after the codec enable block. This doesnt make sense, but for one of my apps I had to do this in order for it to work. But then again I believe mine was hanging in the setup. I never figured out why, it only works in that order.
 
Neither of these suggestions seemed to work, unfortunately! But thanks for helping out.

I'm certainly reading voltage directly from the mic when it's plugged in - around 2-3 mV AC when I yell "Hey" at it.

Should I be reading the same thing between GND and Pin 13 (RX)? Because all I'm getting from it is a 4mV DC voltage, and no AC voltage! Neither fluctuates when I talk into the mic.

There's gotta be something wrong with my board!
 
If you're facing a tight deadline, I can suggest a quick & easy but expensive solution. We recently started selling a complete kit for the audio tutorial. It has the microphone already installed and everything is already built on the breadboard. Every one of these is tested with the 2-4 mic test example (to verify the mic works), and the 1-4 wav file player example (to verify the SD card works), and the 1-2 hardware test example (to verify the buttons and knobs work). The kit is expensive, because it has all the parts, and because there's significant labor to solder the parts and construct the breadboard and do the 3 tests.

http://www.pjrc.com/store/audio_tutorial_kit.html
 
I'm having my EE friend look over my setup today, but if he can find no error, I think I'll do just that!

Luckily I have a grant for this project so money isn't a huge problem.

I have to ask though - is it easy to replace the mic on the kit with one of my own? I assume it'd simply require desoldering the electret and soldering on my own. I'd like to replace it with one of these.

Thanks again everyone for the help.
 
Last edited:
That mic looks like it ought to work.

The soldering might not be easy, since the 2 boards are permanently joined together. The mic is near the edge, but still it'll require putting your iron between the 2 boards.

Definitely recommend working with the known-good mic first, before you touch the boards with your soldering iron!
 
Makes sense!

Just bought the kit, I'll report back if necessary.

Hopefully the issue was with the hardware and not the software. I guess it was a bad chip?
 
Status
Not open for further replies.
Back
Top