DAC & LM386

Gang,
I am making card to drive a single channel of audio into a little 8 ohm hobby speaker.
Using the adafruit wave shield DAC, but going into an 5V powered LM386 instead of some TL072's.
Got a lowpass filter to take out swithing noise, got that AC coupled into the LM386. And then AC coupled again out to the speaker.
Do I need to DC bias the signal into the LM386 so its output can sit at 2.5V & swing +/-2.5V from there?
If so, what are good resistor values? 5K? 20K? 100K?

If not, do I put R5 in series with C21 so I can let the DAC go 0/5V and reduce the level into the LM386 with its built in gain of 20?

12-bit DAC datasheet

LM386 datasheet

bump

(Second attempt because I'm still green and misunderstood some things the first time. :P)

Why DC-block between the DAC and op-amp, then reconstruct the DC offset with a voltage divider? Is it because the DAC will idle at 0v when you're not playing audio? (EDIT: Datasheet quote from next post says idle is centered, but that could be overridden depending on the idle data stream, if there is one.)

(EDIT: Made some changes here.. I didn't calculate all the filters right.)

OK... the R8/C18 filter cutoff is 318Hz? Is that right? Seems awful low. If you chose 100nF for C21 and 100k for R5/R6, you'll end up with a 15Hz cutoff on the highpass (DC block). I wouldn't use this on an audio circuit for full-bandwidth -- not enough margin to avoid touching sub-bass frequencies -- but for a project board, that's probably cool.

(EDIT 2: Missed some of the subtleties with the feedback loop.)

If I'm calculating this right, it looks like C15/R7 form a 318KHz lowpass. You're not using feedback at all. I'm still learning all the ins and outs of op-amps, but I think that turns the op-amp into a comparator. My simulator shows mere microvolts on the output with the inverting input grounded and no feedback.

If you connect R7 to the inverting input instead, you get close to a voltage follower, which basically turns the 386 into a current amplifier capable of driving the signal level into 8 ohms. I think you'll still have to tweak the filters though.

If this were me, I'd look into removing the DC-blocking on the input, fix the filters, buffer with an opamp to simplify any possible interactions, and just use a simple feedback loop with a resistor to set gain on the 386.

I've never seen bias resistors like that on an LM386. I'd leave the input AC-coupled, and eliminate R5 and R6. Datasheet says:

The inputs are ground referenced while the output automatically
biases to one-half the supply voltage.

Thanks guys.

Nick, there is no feedback loop, I have it wired for a gain of 20 device like the datasheet shows with the values called out for stable operation.
I want to mimic the output here but into a speaker instead of headphones.


Jack, I was looking for the justification to not bias the input, guess I missed that part about the output being autobiased.
I have room on the card for R5/R6. If I connect the top of R5 to C21 instead of +5, I can put a trim pot across there to play with volume control, find settings that work well and then put fixed values in. Or use an external pot.

Oh, it has an internal feedback loop. That makes a lot more sense now. I was treating it like a normal op-amp, like many of the TI/National power op-amps are. (I've used an LM3886 50W chip-amp.)

So, the filter on the output is an RF filter for stability -- hence the high cutoff frequency. Makes sense.

The input filter still looks wrong to me, but I could be miscalculating it. Did you mean to low-pass at 318Hz? The waveshield link you posted is filtering at 10kHz. Still low for my standards, but I don't think the DAC is quite up to CD-quality output anyway.

IME, speaker and headphone output isn't much different except that you expect the load impedance to be much lower for speakers. Headphones are usually 64 ohms or higher. (Some are 32, and they're considered difficult loads.) In other words, since the 386 can handle a low-impedance load, you look OK to me.

Thanks Nick.
The Lowpass filter was just a couple components as placeholders, hadn't selected an actual cutoff frequncy yet.