I'm stepping up my Teensy carrier board game, and adding a header to output the DAC0/DAC1 signals. I haven't done analog anything for about 25 years, but here goes :-) This circuit goes on a carrier board for the Teensy that also interfaces with the rest of my system (robot.) I'd love some feedback from anyone who does audio/analog more regularly than me.

Teensy Stereo Output Circuit

The header conveniently also pulls 5V and 12V from the board for powering a small amplifier.

The areas of consideration I have are:

1) Teensy DAC is 12 bit, and there's no anti-aliasing filter internally, so there will be some stair-stepping crunchiness. I need a bit of anti-aliasing filtering; it's more important to get somewhat smooth output up to 5 kHz than to get the highest sample rate entirely un-attenuated. That being said, this is for piping to two-inch speakers for robot speech and effect music, not for a Hi-Fi sound system, so an expensive (and big) brick wall filter isn't warranted. The 47 Ohm / 1 uF RC filter has a corner frequency of 3.4 kHz, which gives me about 18 dB attenuation at 20 kHz, which seems reasonable. I know that DC blocking is a high-pass filter, and I'm prepared to accept a high-pass filter with a corner frequency at 340 Hz from the 47 Ohm / 10 uF series pair. But how do these two filters interact?

2) The 5V rail is driven by a MuRata OKI-78SR05, which has some ripple at 400 kHz. Other than that, it's a great, reliable part. The 12V rail is driven by batteries or DC in, but also drives a number of motors, so there will be switching/EMI noise on that rail. In order to be nice to the amplifiers (who are cost-optimized, not quality-optimized,) I'm adding a bit of filtering on the power rails. I expect to draw 1A or less from either rail. Is this overkill, not enough, or about right? I'm using 6.3mm electrolytics for the 47 uF capacitors, and my main concern there is size -- anything significantly bigger would be a problem. The inductor is rated for 1.2A. An online calculator puts the Q of a 400 mOhm, 10 uH inductor, and 47 uF capacitor, at 1.15 and the corner frequency at 7.3 kHz, and a resonant frequency of 6.6 kHz. How should I think about this, if at all?

3) The amp will be right next to this board, so I don't worry about shielded connectors or balanced/differential signals or anything like that. But, isolating ground might be valuable in routing. So, what's the best ground pin on the Teensy to return the signals to? AGND or one of the GND pins, and if so, which? (I need to separate the signal ground and the power ground on the connector.)

4) How do surface mount X5R capacitors perform, audio-wise? Are they noisy? Do they pick up vibrations as microphones? Do I need to worry about mylar film capacitors and so forth? (Both 1 uF and 10 uF caps are X5R MLCC)

5) What else am I missing, or should think about? Any and all feedback happily accepted! (And thanks in advance)

  • 1
    \$\begingroup\$ 2-inch speakers in what size enclosure? Bare speakers will sound very "tinny" emitting little bass. Such small speakers can't handle much power - 10 W is too much. \$\endgroup\$
    – glen_geek
    Jul 8 '17 at 1:08
  • \$\begingroup\$ Thanks for the question! That's why I'm going to try both 5V and 12V drivers. However, because of cost and time constraints, I don't know which one will work best for me, so I design both 5V and 12V into the output port. At 12V, and stereo, it will be at most 5W per speaker, but likely less on average. Enclosure is equivalent to (or perhaps literally) a styrofoam cup :-) \$\endgroup\$
    – Jon Watte
    Jul 8 '17 at 3:17
  • \$\begingroup\$ Evaluate sound expectations from speakers plugged into our desktop PCs - some are well-done to enhance low-frequency audio in a very small volume. Likely still too big & heavy for a robot. The other links in your audio chain suggest you're after decent sound. "Small & light" are not consistent with good bass. \$\endgroup\$
    – glen_geek
    Jul 8 '17 at 13:33
  • \$\begingroup\$ While I appreciate the attention to speaker performance, my immeadiate questions are more about the circuit design and assumptions/parameters for the electrical interface from the MCU to the amplifier. I only get one shot at building this board, and don't have the right components for prototyping ahead of time. Speakers can be swapped later :-) \$\endgroup\$
    – Jon Watte
    Jul 8 '17 at 16:12

Am guessing that Teensy 12-bit DAC output is from the processor directly. Spec sheet says that DAC output Z is 250 ohms, tested with a light load of 3K ohm. So your anti-alias filter has a flaw - those 47 ohm resistors are in series with 250 ohm DAC output Z (I'm assuming that processor's DAC outputs are not externally buffered).

The anti-alias response of your low-pass filter rolls off audio above 536 Hz., not the 5000 Hz that you expect. I would suggest increasing R901 & R902, and decreasing C901 & C902.
The 10 uF coupling capacitor is likely large enough to drive an audio power amplifier input, which is usually many kilo-ohms. Since you're driving little speakers, the high-pass corner frequency should be adequate. Ensure that your power amp does have relatively high (>10K) input Z. Power-amp input resistance is in parallel with C901 & C902. Power amp input resistance combines with (ADC output Z + R901) to form a voltage-divider, attenuating audio in the pass-band, so don't make R901 too large.

  • \$\begingroup\$ Also, a 6V cap on a 5V rail? Not in the world I live in.... My instinct is an LPF consisting of maybe 2k2 and maybe 10nF or so, seems a reasonable compromise, and all the harmonic and alias products will be out of band anyway if you are sampling at a sane audio rate, you only need enough suppression to avoid IMD products from the amp ending up back in band. The ceramic caps will probably not be the weak point in this thing, but if they are, it is the filter caps that are the ones to sweat, the coupling caps should not have significant signal voltage developed across them. \$\endgroup\$
    – Dan Mills
    Jul 8 '17 at 18:01
  • \$\begingroup\$ @DanMills Yes, your filter components are in the right ballpark. In the end, the ground path is often the big problem source, with large motor currents, large speaker audio currents possibly finding their way back to DAC return, or DAC-reference voltage return, or Analog-Gnd (if its separate from Digital-Gnd). \$\endgroup\$
    – glen_geek
    Jul 9 '17 at 12:33
  • 1
    \$\begingroup\$ Yep, which is why sane people use differential signalling for small signal analogue, much less annoying. Still, end of the day, the thing is a pony little adaptor for a toy Atmel processor, no point in gilding the lilly. \$\endgroup\$
    – Dan Mills
    Jul 9 '17 at 20:15
  • \$\begingroup\$ @Dan Mills The Teensy does have a separate AGND, and it has a ferrite inductor to digital GND. As I suggested in the initial post, I already plan to split the two GNDs and feed signal back to AGND. Also, the Teensy3.x is a Freescale Cortex M4, not an Atmel/AVR processor. I bet many car stereos from the last few years has one of them driving their (sluggish) GUIs. \$\endgroup\$
    – Jon Watte
    Jul 10 '17 at 19:42
  • \$\begingroup\$ Thanks for the comment on the source impedance. I've already decided I need at least 470 Ohm to keep the output current at reasonable levels. I may in fact need to re-buffer this. Here's looking for small, cheap, unity gain opamps... \$\endgroup\$
    – Jon Watte
    Jul 10 '17 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.