Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Teensy Audio Adapter Rev D, D2: Examples, Pinouts, and Specs

Image of Teensy Audio Adapter Rev D, D2Design with Teensy Audio Adapter Rev D, D2 in Cirkit Designer

Introduction

The Teensy Audio Adapter Rev D, D2 is a high-quality audio processing module designed to work seamlessly with Teensy microcontrollers. It enables advanced audio input, output, and processing capabilities, making it ideal for projects involving sound synthesis, audio effects, and digital signal processing (DSP). The adapter is equipped with a powerful SGTL5000 audio codec, which provides stereo audio input and output with excellent sound quality.

Explore Projects Built with Teensy Audio Adapter Rev D, D2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Teensy 4.0 Audio Visualizer with Temperature Sensing: A project utilizing Teensy Audio Adapter Rev D, D2 in a practical application
Teensy 4.0 Audio Visualizer with Temperature Sensing

This circuit features a Teensy 4.0 microcontroller connected to a Teensy audio shield for audio processing capabilities. An RGB LED is included, with each color channel connected through a 220-ohm resistor for current limiting. Additionally, an NTC thermistor is interfaced with the Teensy 4.0 for temperature sensing, with a 1k-ohm resistor forming a voltage divider for analog input.

Open Project in Cirkit Designer
Image of Arduino-Controlled Audio Player with Real-Time Clock and Amplification: A project utilizing Teensy Audio Adapter Rev D, D2 in a practical application
Arduino-Controlled Audio Player with Real-Time Clock and Amplification

This circuit features an Arduino Uno R3 as the central microcontroller, interfaced with an RTC DS3231 for real-time clock functionality, and a DFPlayer MINI for audio playback. The audio output from the DFPlayer MINI is amplified by two LM386 audio amplifier modules, each driving a loudspeaker, and a 3.5mm audio jack provides additional audio output options. An LCD I2C Display is included for user interface, and a 9V battery with an LM2596 step-down module supplies regulated power to the system.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

The Teensy Audio Adapter Rev D, D2 connects to the Teensy microcontroller via specific pins. Below is the pin configuration:

Pin Name Description Teensy Pin
MCLK Master Clock for I2S audio Pin 11
BCLK Bit Clock for I2S audio Pin 9
LRCLK Left/Right Clock for I2S audio Pin 23
DOUT Data Output (I2S audio data) Pin 22
DIN Data Input (I2S audio data) Pin 13
SDA I2C Data Line (control interface) Pin 18
SCL I2C Clock Line (control interface) Pin 19
GND Ground GND
VIN Power Supply (3.3V from Teensy) 3.3V

Audio Input/Output Ports

Usage Instructions

How to Use the Component in a Circuit

  1. Hardware Setup:

    • Mount the Teensy Audio Adapter onto the Teensy microcontroller using header pins.
    • Connect the audio input/output devices (e.g., headphones, speakers, microphones) to the appropriate 3.5mm jacks on the adapter.
    • Ensure the Teensy board is powered via USB or an external power source.
  2. Software Setup:

    • Install the Teensyduino add-on for the Arduino IDE.
    • Include the Audio library in your Arduino sketch. This library provides tools for configuring and processing audio signals.
  3. Basic Example Code: Below is an example of initializing the Teensy Audio Adapter and playing a sine wave tone:

    // Include the Teensy Audio library
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    
    // Create audio objects
    AudioSynthWaveformSine sineWave; // Sine wave generator
    AudioOutputI2S i2sOutput;        // I2S audio output
    AudioControlSGTL5000 sgtl5000;   // SGTL5000 codec control
    
    // Connect audio objects
    AudioConnection patchCord1(sineWave, 0, i2sOutput, 0);
    AudioConnection patchCord2(sineWave, 0, i2sOutput, 1);
    
    void setup() {
      // Initialize the audio system
      AudioMemory(10); // Allocate memory for audio processing
    
      // Configure the SGTL5000 codec
      sgtl5000.enable();
      sgtl5000.volume(0.5); // Set volume to 50%
    
      // Configure the sine wave generator
      sineWave.frequency(440); // Set frequency to 440 Hz (A4 note)
      sineWave.amplitude(0.75); // Set amplitude to 75%
    }
    
    void loop() {
      // The sine wave will play continuously
    }
    

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Audio Output:

    • Verify that the Teensy board and Audio Adapter are properly connected.
    • Check the volume settings in the code (sgtl5000.volume()).
    • Ensure the audio output device (e.g., headphones or speakers) is functional.
  2. Distorted Audio:

    • Reduce the amplitude of the audio signal in the code (e.g., sineWave.amplitude()).
    • Check for loose or poor-quality audio cables.
  3. Microphone Input Not Working:

    • Ensure the microphone is an electret type and is properly connected.
    • Verify that the microphone bias voltage is enabled in the code.
  4. I2C Communication Errors:

    • Check the connections for the SDA and SCL pins.
    • Ensure no other devices on the I2C bus are causing conflicts.

FAQs

Q: Can I use the Teensy Audio Adapter with other microcontrollers?
A: The adapter is specifically designed for Teensy boards. Using it with other microcontrollers may require significant modifications and is not officially supported.

Q: What is the maximum sampling rate supported?
A: The default sampling rate is 44.1 kHz, but other rates can be configured with advanced settings in the Teensy Audio library.

Q: Can I use both the line-in and microphone inputs simultaneously?
A: No, the SGTL5000 codec allows only one input source at a time. You can switch between inputs in the code.

Q: Is it possible to record audio to an SD card?
A: Yes, the Teensy Audio Adapter includes an SD card slot for audio recording and playback. Use the SD library in conjunction with the Audio library for this purpose.