Preferred Audio Amplifiers for Propeller
Darcy
Posts: 31
I'm trying to figure out which audio amp will best meet my needs for my propeller project. I have a LM386, but I read that it will not function at 3.3v, and the sound quality is low. I've read about the TDA7052 and the LM4876, and the LM383, but i'm not sure how to discern which will be best.
So what is your preference for audio amplifiers? I'd like to know what your experience is with different amplifiers and which ones do you prefer.
Thanks in advance for your input.
So what is your preference for audio amplifiers? I'd like to know what your experience is with different amplifiers and which ones do you prefer.
Thanks in advance for your input.
Comments
There was a thread some time ago that discussed the various chips and the preferred ones. Try searching LM386 because that was in the mix.
Now to write a cookbook for IC's that work best for microcontrollers would require a lot more effort than a CMOS cookbook plus it would be out of date by the time it's released. Have you had a look at the book "Programming and Customizing the Multicore Propeller Microcontroller"? If you like cookbooks you should like this one.
Often, I only need mono, but I want at least 5 watts of audio so that I can hear the quality or lack of it. Counter-based PWM should be fine with it.
Regarding impedance matching for audio, it isn't very critical (which is is with RF stages). Generally a low impedance output going into a high impedance input will work fine. It you need a higher impedance input, an audio quality op amp or two can create a nice little preamp with anything from near zero to 12db gain.
But the other use for amplifiers is for headphones and I did some research this morning and have got very confused by the whole thing. Headphones are 32 ohms and only need 60-80mW so maybe an op amp can do the job? A 386 might blow one's eardrums.
The http://elmicro.com/files/parallax/propdemod_schematic.pdf uses a max4411 which looks a neat chip, but it is $3.50 from futurlec and that seems a little high considering it is nearly half the price of a propeller. Plus it is TSSOP and I am not sure I can solder those.
Futurlec have a large range of amplifiers, though not many that are dedicated to just headphones. I'm thinking of DIP parts, stereo and a good price (some speaker amps are only 50c).
Addit - like Invent-O-Doc above I also have had some feedback problems with the 386. Reading through the detailed spec sheets for some headphone amps, it appears one of the things they add inside the chip is filtering at RF frequencies, so that AM radio stations that are picked up by wires (even by PCB traces) are not demodulated as well. Feedback at RF frequencies is one of those things that can be hard to fix, and maybe that is what you are getting with these more expensive chips. I'd like a DIP part though if they exist.
I have a little audio op amp mixer board from ESP (Elliot Sound Productions) that will do just about anything you want with excellent audio quality. It is stereo, but the two inputs can be mixed together into a mono output quite easily. He also explains how to configure op amps as mixers to avoid noise and hums.
It does get a bit dizzy with 4 ohm, 8 ohm, 16 ohm speakers and 32 ohm earphones at your final load. As I tried to mention before, matched impedances are really for tuned RF stages - not for the rather wide audio bandwidth. Generally a low impedance output into a high impedance input is fine.
But at the end of the whole line we seem to contradict ourselves with a 4 ohm to 32 ohm load. That stage is NOT an op amp with pure voltage gain, it is a power amp that combines voltage gain and current gain in order to optimize power to a speaker load. And in truth, there is nothing wrong with just using a transistor or MOSfet to provide this stage. One TIP120 is likely to work quite nicely for most Propeller wave projects. It is just not very elegant from a audiophile point of view.
The only reason a power amp stage gets problematic is that you want 'perfect linearity', no harmonic distortion, AND more than 25 watts of power output. It seems we are not even close to any of those parameters. In other words, even one 2N2222 might be adequate for 1-2 watts output. But the real problem is that the final stage may best be driven by 9 volts or greater into that speaker or ear phone load. I suspect most of us are really just trying to get an audio amp that uses the same 3.3 volts or 5.0 volts that everything else is using. (And that is the reason for often poor results! Just ponder that most of us turn to MAX232 chips to get RS-232 signals, but Parallax saves a heap of cash by using a few transistors that require less support components.)
Of course op amps can be used for driving headphones. I've used a TS922 for instance; it's not too expensive, can drive the necessary current and it's available in quite a few package types. One problem one encounters when driving (stereo) headphones is that you have a shared ground line for left and right so bridge amplifiers are not an option.
With a non-bridge amplifier and single supply power you have to ac-couple the signal with high value capacitors or create a vcc/2 supply for the ground line. Another way is used by the MAX4411 which creates it's own negative power supply with a charge pump, so the amplifier output swings positive and negative and the headphone ground line can be connected to system ground.
I've had my own share of problems with the LM386 and the TDA2822M (which is also a possible choice). Both produced quite high amounts of noise (static) in my headphones. This won't be audible on a loudspeaker but earphones need much less power for the same loudness.
Also both the LM386 and the TDA2822M are by default configured for a high amount of (voltage) gain which wasn't needed in my application.
Yes, I was also thinking that bridge amplifiers are not going to work with a shared ground.
With op amps, many times I have used a quad op amp package and used one of the op amps as a voltage buffer with an input biased to half volts with two 10k resistors. The output of that becomes a low impedance virtual ground for all other op amps in the circuit.
If you do that then couple the output via a large capacitor (100uF ?) to the headphone would that work?
Thinking about this more, 80mW at 3.3V is 24mA. Some headphone amps quote 60mW which is 18mA. That is around the output of many typical op amps. But isn't that also within a ballpark figure for output current on a propeller pin as well?
If so, would it be possible to drive a headphone speaker directly off a propeller pin doing PWM? I think you would need the large capacitor still, but what would the R/C low pass filter look like?
And ok, if that is not possible, would a RC low pass filter and then an op amp voltage follower and then a large capacitor work?
The reason for removing the dc content of a signal is that the speakers/headphones probably won't like it (get damaged or create distortion) and if it was kept in place it would also raises the overall current consumption.
I haven't done/looked much into that myself but the following things come to my mind:
If you use circuit ground as speaker ground, you'll still need the coupling capacitor.
On the point of maximum output power the 3.3V supply is your biggest concern (this applies to the op amp solution too). If you could create a sine wave which uses the whole supply range 0 - 3.3V peak-peak using an ideal voltage source to connect this to an ac coupled 32Ohm load, this would only be 42mW (3.3V p-p == 1.2V rms). In terms of current this is 103mA p-p (37mA rms) - in other words on the most positive peak of the sine wave you would have to source 52mA and on the lowest point sink 52mA. This is the theoretical limit for this supply voltage and that load.
This is quite a bit out of the allowable current range for a single propeller pin and even if you managed to source this much current there would be an appreciable voltage drop so you wouldn't get 3.3V p-p.
Now if you're willing to accept a lower power output - let's say reduce this to 4.2mW (rule of thumb: one tenth the power is perceived half as loud). Now the propeller would have to source/sink +/- 16mA and the voltage on our 32Ohm load would have to be 1.0V p-p (32mA * 32Ohm).
Let's say we use the DC characteristics from the propeller datasheet which specifies for 10mA: Voh 2.85V and Vol 0.4V which is a voltage swing of 2.45V (peak-peak). Now if you put a resistor in series with your earphones (propeller pin -> coupling capacitor -> series resitor -> earphones -> gnd) it's a simple voltage divider.
A 47Ohm resistor leaves us ~1V p-p for the earphones.
What's left is now the capacitor of the R/C low pass filter. Now that we've chosen a series resistor that's not difficult anymore. The "R" in R/C is the series resistor (47Ohm) and your load (32Ohm) in parallel - that's 19Ohm. Assuming an upper cut off frequency of 15kHz that should be about 560nF.
That's the way it's done on the demoboard - minus the fact that the MAX4411 is "better" than an op amp for this application, meaning it won't need the fat coupling capacitors and for the same 3V supply and 32Ohm load it will get you a bit (~ factor 3) higher output power than e.g. the TS922.
This is all just a back of the envelope calculation, so your results may vary.
I especially don't know much about PWM and. how I have to imagine the resulting signal in the frequency domain - maybe an expert chime in if there's anything I've missed.
Nonetheless, the TS922 looks like a very good choice if you must use +5 or +3.3. But take a look at the charts in the PDF with an eye toward what this does to performance.