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

Thread: Problems with the Audio Shield.Is it broken?

  1. #1
    Junior Member
    Join Date
    Oct 2018
    Posts
    3

    Problems with the Audio Shield.Is it broken?

    Good Morning.

    I am a university student, and in business practices I am working with the Teensy 3.5 board and the Audio Shield, all in the Arduino IDE 1.8.7 environment.

    The problem is the following:

    I used to load this program (It's the example 1_02 of Audio> Tutorial) on my board and I heard a beep, as it should be.

    Code:
    // Advanced Microcontroller-based Audio Workshop
    //
    // http://www.pjrc.com/store/audio_tutorial_kit.html
    // https://hackaday.io/project/8292-microcontroller-audio-workshop-had-supercon-2015
    // 
    // Part 1-2: Test Hardware
    //
    // Simple beeping is pre-loaded on the Teensy, so
    // it will create sound and print info to the serial
    // monitor when plugged into a PC.
    //
    // This program is supposed to be pre-loaded before
    // the workshop, so Teensy+Audio will beep when
    // plugged in.
    
    #include <Audio.h>
    #include <Wire.h>
    #include <SD.h>
    #include <SPI.h>
    #include <SerialFlash.h>
    #include <Bounce.h>
    
    AudioSynthWaveform    waveform1;
    AudioOutputI2S        i2s1;
    AudioConnection       patchCord1(waveform1, 0, i2s1, 0);
    AudioConnection       patchCord2(waveform1, 0, i2s1, 1);
    AudioControlSGTL5000  sgtl5000_1;
    
    Bounce button0 = Bounce(0, 15);
    Bounce button1 = Bounce(1, 15);
    Bounce button2 = Bounce(2, 15);
    
    int count=1;
    int a1history=0, a2history=0, a3history=0;
    
    void setup() {
      AudioMemory(10);
      pinMode(0, INPUT_PULLUP);
      pinMode(1, INPUT_PULLUP);
      pinMode(2, INPUT_PULLUP);
      Serial.begin(115200);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.3);
      waveform1.begin(WAVEFORM_SINE);
      delay(1000);
      button0.update();
      button1.update();
      button2.update();
      a1history = analogRead(A1);
      a2history = analogRead(A2);
      a3history = analogRead(A3);
    }
    
    
    
    
    void loop() {
      Serial.print("Beep #");
      Serial.println(count);
      count = count + 1;
      waveform1.frequency(440);
      waveform1.amplitude(0.9);
      wait(250);
      waveform1.amplitude(0);
      wait(1750);
    }
    
    void wait(unsigned int milliseconds)
    {
      elapsedMillis msec=0;
    
      while (msec <= milliseconds) {
        button0.update();
        button1.update();
        button2.update();
        if (button0.fallingEdge()) Serial.println("Button (pin 0) Press");
        if (button1.fallingEdge()) Serial.println("Button (pin 1) Press");
        if (button2.fallingEdge()) Serial.println("Button (pin 2) Press");
        if (button0.risingEdge()) Serial.println("Button (pin 0) Release");
        if (button1.risingEdge()) Serial.println("Button (pin 1) Release");
        if (button2.risingEdge()) Serial.println("Button (pin 2) Release");
        int a1 = analogRead(A1);
        int a2 = analogRead(A2);
        int a3 = analogRead(A3);
        if (a1 > a1history + 50 || a1 < a1history - 50) {
          Serial.print("Knob (pin A1) = ");
          Serial.println(a1);
          a1history = a1;
        }
        if (a2 > a2history + 50 || a2 < a2history - 50) {
          Serial.print("Knob (pin A2) = ");
          Serial.println(a2);
          a2history = a2;
        }
        if (a3 > a3history + 50 || a3 < a3history - 50) {
          Serial.print("Knob (pin A3) = ");
          Serial.println(a3);
          a3history = a3;
        }
      }
    }
    However, one day I charge that program again and nothing is heard; instead, the serial monitor displays this message.

    Code:
    10: 05: 22.560 -> Knob (pin A2) = 111
    10: 05: 22.560 -> Knob (pin A3) = 43
    10: 05: 22.560 -> Knob (pin A2) = 45
    10: 05: 22.560 -> Knob (pin A3) = 98
    10: 05: 22.560 -> Knob (pin A2) = 134
    10: 05: 22.560 -> Knob (pin A3) = 165
    10: 05: 22.560 -> Knob (pin A3) = 105
    10: 05: 22.560 -> Knob (pin A2) = 83
    10: 05: 22.560 -> Knob (pin A3) = 185
    10: 05: 22.560 -> Knob (pin A2) = 163
    10: 05: 22.560 -> Knob (pin A3) = 131
    10: 05: 22.560 -> Knob (pin A2) = 95
    10: 05: 22.560 -> Knob (pin A3) = 73
    10: 05: 22.560 -> Knob (pin A2) = 33
    10: 05: 22.560 -> Knob (pin A3) = 13
    10: 05: 22.560 -> Knob (pin A2) = 174
    10: 05: 22.560 -> Knob (pin A3) = 75
    10: 05: 22.560 -> Knob (pin A3) = 157
    10: 05: 22.560 -> Knob (pin A3) = 216
    10: 05: 22.560 -> Knob (pin A3) = 132
    10: 05: 22.560 -> Knob (pin A2) = 96
    10: 05: 22.560 -> Knob (pin A3) = 52
    10: 05: 22.560 -> Knob (pin A2) = 191
    10: 05: 22.560 -> Knob (pin A3) = 156
    10: 05: 22.560 -> Knob (pin A2) = 68
    10: 05: 22.560 -> Knob (pin A3) = 70
    10: 05: 22.560 -> Knob (pin A2) = 145
    10: 05: 22.560 -> Knob (pin A3) = 122
    10: 05: 22.560 -> Knob (pin A2) = 211
    10: 05: 22.560 -> Knob (pin A3) = 175
    10: 05: 22.560 -> Knob (pin A3) = 82
    10: 05: 22.560 -> Knob (pin A2) = 134
    10: 05: 22.560 -> Knob (pin A3) = 150
    10: 05: 22.560 -> Knob (pin A2) = 83
    10: 05: 22.560 -> Knob (pin A2) = 173
    10: 05: 22.560 -> Knob (pin A3) = 91
    10: 05: 22.560 -> Knob (pin A2) = 101
    The Teensy board and the Audio Shield are connected in this way:

    Click image for larger version. 

Name:	photo5891198983005646353.jpg 
Views:	4 
Size:	91.4 KB 
ID:	14892

    As I said, you do not hear that beep that should be heard. I know the problem is not the Teensy board, because it responds well to other programs, such as the Blink. Therefore, I suspect that the problem is in the Audio Sield.

    My question is: is there any way to check my Audio Shield plate? It is to know if something is broken or if a short circuit has occurred. If you could indicate or proportional any program or example that indicates to me if the Audio Shield is broken, I would appreciate it very much.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,357
    You are running the proper program to test the hardware!

    First, this output is perfectly normal if you do not have pots connected to A2 & A3, as is done with the tutorial hardware.

    Code:
    10: 05: 22.560 -> Knob (pin A2) = 111
    10: 05: 22.560 -> Knob (pin A3) = 43
    10: 05: 22.560 -> Knob (pin A2) = 45
    10: 05: 22.560 -> Knob (pin A3) = 98
    10: 05: 22.560 -> Knob (pin A2) = 134
    10: 05: 22.560 -> Knob (pin A3) = 165
    10: 05: 22.560 -> Knob (pin A3) = 105
    When the analog pins are "floating" (not connected to anything) they are very sensitive and will read randomly changing values. If you connect pots to those pins, like the tutorial hardware, you should see these remain steady and change when you turn the pots.

    Regarding the sound, lack of the beeping output is a problem.

    As a first step, I'd suggest connecting headphones for listening. In the photo, I see a cable that looks like the type used with PCs to connect a sound card to speakers or a stereo system. For the sake of testing, use ordinary headphones. When you connect to some other system, you're adding all sorts of possible connection issues. For example, the volume setting for this example is only 0.3, which is low (since a beep is easy to head and very unpleasant at higher volume). But sending to another system, 0.3 might be too low. Use stand-alone normal headphones for testing.

  3. #3
    Junior Member
    Join Date
    Oct 2018
    Posts
    3
    Click image for larger version. 

Name:	photo5891198983005646374.jpg 
Views:	4 
Size:	54.8 KB 
ID:	14893

    Thank you very much. I have connected normal headphones and I have increased the volume. However, no beep sounds yet. What else should I do?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,357
    I'm afraid things are not looking good. Odds are strong your hardware has been damaged.

    Maybe unplug the boards from each other and visually inspect the pins and sockets, or look for other physical damage.

    If you have a voltmeter, can you try measure the DC voltage on the output signals relative to the GND pin on Teensy. If you're just powered the board and haven't run any tests, the pins should be close to zero volts, because the hardware defaults to a low power state. When you run the test program (or any program that enables the SGTL5000 chip), those output pins should come up to ~1.5V DC. If they stay near zero, that's a sure sign the hardware isn't working.

  5. #5
    Junior Member
    Join Date
    Oct 2018
    Posts
    3
    Good morning. As I expected, the voltage is close to zero; I shoud buy another Audio Shield. Thank you for your help, friend!

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,357
    The problem could be one or more signals not connecting between the boards. Maybe try visually inspecting with a magnifier and bright light.

    Otherwise, yes, it's time to replace the audio board. If the connections are all ok and the audio board isn't powering up, then it's probably damaged and needs to be replaced.

Posting Permissions

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