Shop OBEX P1 Docs P2 Docs Learn Events
Preferred Audio Amplifiers for Propeller — Parallax Forums

Preferred Audio Amplifiers for Propeller

DarcyDarcy Posts: 31
edited 2011-10-08 09:46 in Propeller 1
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.

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2011-09-29 22:20
    I used the LM386 years ago. These days, there are better chips that require less passive parts.

    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.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-09-29 22:51
    As Cluso said, there are much better chips these days. The 386 required huge caps to be effective whereas the bridge-tied-load (BTL) amps are so compact and easy to use. Also the BTL amps deliver full power at 5V unlike the 386 which requires higher voltages. So the two BTL devices you mentioned are more than fine. Just to throw a spanner in the works there are also Class D amps as well but usually only if you need higher power such as the SSM2305 that delivers 2.8W @5V in an MSOP8 package.
  • DarcyDarcy Posts: 31
    edited 2011-10-01 17:19
    has anyone written a ic cookbook for ic's that work best with microcontrollers? That would be a nice reference to have, since there's so many options for different ic's, it'd be nice to have their data compiled in one place for reference. i used to use the cmos cookbook before I got into micorcontrollers and loved it.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-10-02 07:57
    CMOS is fairly basic logic which except for process improvements etc hasn't really changed that much for decades. A 7400 quad Nand may be available in many different logic families and packages but it's still a quad Nand.

    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.
  • Mark_TMark_T Posts: 1,981
    edited 2011-10-02 17:35
    You can directly drive a class D output stage using counter-based PWM...
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-10-03 01:10
    Frankly, there are so many stereo speakers for computers these days with built in amps that can do the job that I wonder why bother with a chip that outputs so little power and requires locating tiny speakers that are hard to hear.

    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.
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2011-10-06 15:31
    I really like the TDA7052. Im not sure about it at 3.3V because I usually have 5-6V and 3.3 on my projects. It has a low (no) component count and is pretty foolproof. (Otherwise i use LM386-3s but they have the problems you mentioned like large component count and they tend to have feedback problems.)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-06 19:06
    I've done what Loopy has and bought some amplified computer speakers. Very cheap on ebay. Powered by the 5V on USB and it is tempting to put a USB socket on a PCB with just the 5V and 0V to provide power to things (or would it not be a good idea to have a 'fake' USB socket?)

    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.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-10-06 21:46
    I have a portable set of speakers that have an internal battery and charge via a miniUSB connector. Input is via 3.5mm stereo plug. It is good quality and is ~4.2"x1.9"x1" and I often use it on my laptop because it is way better than my laptop speakers. It is called an iSpeaker and IIRC I paid $14.50 duty free in Singapore. Specs say 2@ 2W 4ohm.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-10-06 23:55
    If an amp is too loud for ear phones, just install a volume control. At least, that used to be the solution.

    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.)
  • Christoph_HChristoph_H Posts: 31
    edited 2011-10-07 13:41
    Dr_Acula wrote: »
    Headphones are 32 ohms and only need 60-80mW so maybe an op amp can do the job?

    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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-07 16:44
    Christoph_H, that is very useful advice.

    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?
  • Christoph_HChristoph_H Posts: 31
    edited 2011-10-08 03:21
    Dr_Acula wrote: »
    If you do that then couple the output via a large capacitor (100uF ?) to the headphone would that work?
    Yes. The capacitor between the amplifier output and the headphones acts as a high-pass filter. If you set the cutoff frequency somewhere around 20 Hz you'll need 220µF for a nominal 32 Ohm Load. "Phone Quality" lower frequency cutoff is around 300 Hz so if it's going in that direction you can use a much smaller capacitor.
    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.
    Dr_Acula wrote: »
    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?
    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.
    Dr_Acula wrote: »
    would a RC low pass filter and then an op amp voltage follower and then a large capacitor work
    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.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-10-08 04:00
    Good points there Christoph_H. I've been reading about the TS922 - that looks a good choice. Now to find a local supplier.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-10-08 07:37
    I keep coming back to the problem that audio generally wants more than +5 or +3.3 volts for the power supply. Op amps ideally want a positive and negative rail for true audio option. And then, they benefit greatly from +15/-15. Once you try to hang on to a single rail supply, all sorts of problems are presented.

    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.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2011-10-08 09:46
    I like the TDA2822M - here is a video I made with input from my PC audio card output...
Sign In or Register to comment.