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

Thread: Interfacing Line in (audio in) and line out (audio out) on Teensy 4.0

  1. #1
    Junior Member
    Join Date
    Aug 2019
    Posts
    6

    Interfacing Line in (audio in) and line out (audio out) on Teensy 4.0

    Any idea how can I interface a line in and a line out on a Teensy 4.0? I want to use jacks both for line in and line out in order to connect a microphone and ear headphones.

  2. #2
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,384
    Do you know about the audio board?

    https://www.pjrc.com/store/teensy3_audio.html

  3. #3
    Senior Member
    Join Date
    Jul 2020
    Posts
    548
    Microphones are not normally line-level. You'd need a preamp to drive line-in.

  4. #4
    Junior Member
    Join Date
    Aug 2019
    Posts
    6
    Quote Originally Posted by MarkT View Post
    Microphones are not normally line-level. You'd need a preamp to drive line-in.
    What's the difference between audio line in and mic in?

  5. #5
    Senior Member
    Join Date
    Jul 2020
    Posts
    548
    Quote Originally Posted by mike123 View Post
    What's the difference between audio line in and mic in?
    Line level is around 0.1 to 0.4V, mic level is a few mV. So perhaps 50dB?

  6. #6
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,384
    what they said
    Last edited by oddson; 11-01-2020 at 02:32 PM. Reason: oh so wrong...

  7. #7
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    817
    Note that the mic input on the teensy audio board is much *lower* impedance than the line-in. But follow these rules and all will be fine:

    1) match the input gain to the voltage of the source - low voltage (most microphones) needs high gain
    2) use an input impedance at least several times higher than the output impedance of the source

  8. #8
    Senior Member
    Join Date
    Jul 2020
    Posts
    548
    Quote Originally Posted by oddson View Post
    Microphones are high impedance
    Dynamic are 200 to 600 ohms or so, electret mics are typically a few k due to the FET buffer load.
    I wouldn't call that high impedance - in audio 47k is the standard load for line signals for instance.

    Most line-outs are ~100 ohms or so due to the resistor on their outputs which serves to prevent
    oscillation driving capacitive loads. However most opamps driving line outs aren't able to handle
    heavier than 1k loads without overload distortion appearing at higher signal levels, so its wise
    not to load a line-level signal heavier than about 2k if you care about SQ.

    Driving a headphone from lineout will create quite significant distortion at higher volume levels as
    the opamp's output current limiter operates, unless its a high-current opamp designed for the purpose,
    or a very high impedance set of 'phones.

  9. #9
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,384
    ...yeah... I should have stayed quite.

  10. #10
    Junior Member
    Join Date
    Aug 2019
    Posts
    6
    If I use this: https://www.pjrc.com/store/teensy3_audio.html am I ok as far as distortion and the rest of the problems that you have described is concerned?
    (Preferably I will use 2 of them on one Teensy 4.0)

  11. #11
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    168
    If you're using the T4.0, make sure to order the Rev D boards.

  12. #12
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,384
    I think it's tricky to use two audio boards... why two?

  13. #13
    Junior Member
    Join Date
    Aug 2019
    Posts
    6
    I want to have 2 different audio sources and two different outputs. Can it work?

    Also does this https://www.pjrc.com/store/teensy3_audio.html support handsfree, like the ones on smartphones? I mean can I have in the jack connected mic + earphones simultaneously like in mobile phones? Thank you...
    Last edited by mike123; 11-01-2020 at 09:17 PM.

  14. #14
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,384
    It does stereo in and out but only one MIC level input. With a two-channel preamp you could address the gain issue and use both line-level inputs... but listen to experts on how and not me.

    Also, the ADC on the audio board is OK quality but not very impressive specs. There are third-party audio boards with better specs.
    Last edited by oddson; 11-01-2020 at 09:49 PM.

Posting Permissions

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