Shop OBEX P1 Docs P2 Docs Learn Events
Audio amplification — Parallax Forums

Audio amplification

KyeKye Posts: 2,200
edited 2009-06-22 22:15 in Propeller 1
Hey guys,

Is audio amplification needed very much for using headphones with the propeller chip?

I just want to use the simple low pass filter plus dc isolator cap for simplicity. Any know how that sounds when its un-amplified through headphones?

Or, if I need an amplifier, what would be the best and most widely avialable choice to buy? Or is there a simple ciruit I could make using some transistors·that provides 0 - 22050 Hz resoltuion? I'm trying to build a very inexpensive system so I don't really want exotic items.

Thanks,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-19 02:02
    The LM386 is an excellent cheap and simple headphone amplifier. RadioShack sells it for $1.49. It requires two capacitors and a resistor and runs off anything from about 5V up to 18V. Look at the datasheet for the device.
  • GolahGolah Posts: 4
    edited 2009-06-19 02:11
    Hey Kye,
    I would be concerned about the current draw with a straight headphone attachment. You could try an emitter follower using a transistor, resistor, and an input and output cap.
    The ideal would be a purpose made amp like what Mike has suggested.
  • KyeKye Posts: 2,200
    edited 2009-06-19 03:46
    Yeah, I just did the math for the simple rc circuit and while it produces a line level output voltage it cannot drive anything because it will supply no ampage.

    Audio parts are going to add alot more cost that I would like...

    ... Okay, what would be better.

    Line level input and output - No recording from mic and no playback on headphones - less cost.

    Preamp input and power amp output - Recording from mic and playback on headphones - more cost.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,

    Post Edited (Kye) : 6/19/2009 4:24:35 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-19 04:19
    Kye,

    I completed a Propeller board design awhile back and came to the same conclusion: line level inputs and outputs are the most economical way to go. There are plenty of external amp and preamp solutions available for cheap, cheap, cheap, so 'no need to include them onboard. We can't hope to duplicate what the Chinese can do en masse for pennies on the dollar!

    -Phil
  • KyeKye Posts: 2,200
    edited 2009-06-19 04:26
    Yeah, I guess I'll try going with that for a while. Currently the board I'm making will cost about $35 dollars in componets priced at units of one. Adding in mass production I may be able to bring down the price alot more. Maybe then I'll add in audio amplification.

    The thing is, my product is aimed at the educational sector. I'm not sure they would understand why line level doesn't work with their headphones and microphones. I kinda need to make my product idiot proof.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • kevin101kevin101 Posts: 55
    edited 2009-06-19 07:27
    This may not sound like a very good Idea, but i just tie the outputs on the propeller to some headphones through a resistor and capacitor in series. I made a little plug in board with an audio taper flat potentiometer on board with 2 100uf electrolytic caps and a salvaged stereo connector. It gets amazing audio quality on a good pair of headphones and gets pretty loud if you turn the pot all the way up. It may not be good for the prop, but nothing has burned out yet... I think cheap ipod headphones are rated for 100 mw max, so at 3.3, that would be 30ma. Is that right? Ive tested it with more powerful headphones and it still works.
  • BradCBradC Posts: 2,601
    edited 2009-06-19 07:27
    Kye said...
    I kinda need to make my product idiot proof.

    Not possible. Just when you think you are there, someone breeds a better idiot. Procreation favours the stupid [noparse]:([/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Missed it by ->" "<- that much!
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-06-19 08:13
    For background levels into headphones a couple of resistors and caps would do.·The problem is that there is no standard·for headphones, the cheap, in ear sort, are usually around about 32 Ohms and 1mW (at·this level it·shouldn't cause any health issues) would be acheived with about 330-470 Ohms, or so, and would protect the Prop. The audio output on early computer CD drives either had a small amp or just used some op-amps with limit resistors.· The rest of the headphones that are around vary from low Ohms to low K Ohms and so would present you with an indeterminate load, which makes the choice of filter cap impossible. The only way past that is for an amplifier to give a known input impedance to allow filter component selection, and a known low output impedance so that various loads can be acounted for. The LM386 is a good choice.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • TubularTubular Posts: 4,728
    edited 2009-06-19 09:48
    I was told iPod headphones had noticeably better sensitivity than standard types, when using with crystal sets. Maybe thats worth a try
  • LeonLeon Posts: 7,620
    edited 2009-06-19 12:44
    The TDA7052 is a much better amplifier chip than the obsolete LM386: fewer components, less current and better audio quality

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-06-19 13:13
    Ah Leon, I was wondering when somebody would get around to something other than the archaic 386 amps (no offence Mike). The caps you have to use with the 386 are bigger than the chip whereas a bridge-tied load (BTL) doesn't require caps. I think Radio Shack must have bought a ship load of the 386 chips back in the late 70's and are still trying to flog them off to unsuspecting users.

    However, even the TDA7052 is getting a bit long in the tooth but it is a good choice for anything that has to drive speakers or a mono earphone. The TPA6211 is also a good choice as it offers 3W output at 5V in a tiny 8-pin pack in a BTL configuration.

    Of course the other option is simply use an opamp, even the LM358 which is very general purpose and cheap and the level is sufficient for sensitive earphones or just plain handy for buffering line outputs.

    *Peter*
  • LeonLeon Posts: 7,620
    edited 2009-06-19 13:40
    When I worked for Racal on the Bowman military comms system we used an op amp for headphone output. It could actually cause hearing damage when set to maximum output, according to my calculations at the time.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 6/19/2009 1:48:16 PM GMT
  • KyeKye Posts: 2,200
    edited 2009-06-21 18:38
    I like the 386, I would only need it and maybe a 10uf, 1uf, and 470 ohm resistor to do what I want.

    Very cheap.

    However, here's the thing. I've been trying to make my platform with completely replaceable parts. That said, what other ICs·are an exact replacement·for the lm386? This way I can make sure my product can be easily updated for newer parts or parts that have gone out of stock.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • LeonLeon Posts: 7,620
    edited 2009-06-21 18:57
    The TDA7052 doesn't need any external components, apart from a decoupling capacitor.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • KyeKye Posts: 2,200
    edited 2009-06-21 22:53
    Yes, but can you find the TDA7052 everywhere with multiple replacement parts from various manufactures?

    Like the max232... Maxim makes it, TI makes it and SPEX makes it. All with enough various flavours to never run out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • LeonLeon Posts: 7,620
    edited 2009-06-21 22:55
    Nat Semi is the only company making the LM386!

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-06-21 23:19
    I hope this is not a debate about which amp is best. However for clarity I have included a quick comparison of the three amps that have been discussed. Also note that the 386 requires a larger output capacitor than 10uf unless you are only concerned with mid to high tones. I really don't have a personal preference as I always weigh up cost, availability, performance, and simplicity.

    *Peter*
    609 x 100 - 27K
  • KyeKye Posts: 2,200
    edited 2009-06-22 14:29
    Argh, which one to choose!

    Guess I'll just go with line in and out for now and then upgrade.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • KyeKye Posts: 2,200
    edited 2009-06-22 17:35
    Okay, I've found a nice cheap solution for no extra cost.
    -----[noparse][[/noparse]240]----------[noparse][[/noparse]10uf]----- 
                  |
                  |
                _____
                _1uF_
                  |
                  |
                 GND 
    

    The circuit will act as a low pass filter with a cutoff of arround 600Hz that will squash the 40mhz dutycycle frequency created by the propeller chip into an analog voltage that I can adjust as needed.

    However, since the line resistance is arround 240 ohms the circuit can provide well over 10 mW of power.

    I think that it will be enough to drive a tiny pair of headphones. Considering the fact that headphones don't need much power anyway.

    I also have a feature built into my software that can boost the volume by about 2^16, so it may work out. I'll have to fall back on the lm386 if this circuit doesn't work out however.

    ... The thing is, would this circuit have the possibilty of browning out the propeller chip if too heavy a load is put on it... That shouldn't happen... but...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,

    Post Edited (Kye) : 6/22/2009 5:42:25 PM GMT
  • jazzedjazzed Posts: 11,803
    edited 2009-06-22 17:40
    I was wondering when you would get to that [noparse]:)[/noparse] I've done this and I really wish I had added a digital resistor to adjust the output ... proto2 item. Whatever you do, don't attach it the audio to the EEPROM SDA pin [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve


    Propalyzer: Propeller PC Logic Analyzer
    http://forums.parallax.com/showthread.php?p=788230

    Post Edited (jazzed) : 6/22/2009 5:47:31 PM GMT
  • KyeKye Posts: 2,200
    edited 2009-06-22 17:48
    Now, To accomodate line in and mic in I think I need two input jacks as seen on most computers with the green(line out) and blue(lin in) and pink(mic in) connectors.

    But, I don't want a connector for line in and mic in. I think mic in only will cut it.

    Anyone think a line in would ever be useful if your not targeting your product for commercial audio? I'm designing this for students and hobbyist as an educational platform so... I'm not sure if that feature would be missed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • RaymanRayman Posts: 15,246
    edited 2009-06-22 19:57
    Audio is one of those things the Prop does well, in an easy to understand way...
    So, I'd defininitely include line-in. I'd also add a built-in mic, like the demo board...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • PraxisPraxis Posts: 333
    edited 2009-06-22 22:09
    If you want cheap you could always use a 4069 hex inverter biased for analogue operation plus you get a few spare inverters to use.

    Cheers

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Caelum videre iussit, et erectos ad sidera tollere vultus

    Certe, toto, sentio nos in kansate non iam adesse
  • KyeKye Posts: 2,200
    edited 2009-06-22 22:15
    Thanks for the help guys.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
Sign In or Register to comment.