Go Down

Topic: Need a simple audio amplifier (Read 76374 times) previous topic - next topic

outofoptions



The point at which the device comes closest to being cut off is not close to zero signal, so the problem of crossover distortion associated with class-AB and -B designs is avoided.

OK.  I think this is the part I was missing.  That and forgetting what the basic classes did.  Thanks for taking the time to answer this for me.

lemming

#16
May 06, 2013, 01:23 pm Last Edit: May 06, 2013, 02:14 pm by lemming Reason: 1
I use one of these:

http://adafruit.com/products/987

to drive a couple of speakers. Use only one channel if need be.
Being class D they are efficient too while having plenty of power for their size.

Another, less powerful, class D one here:

https://www.sparkfun.com/products/11382

RobvdVeer


If you just want to amplify tones generated by the Arduino, try the attached schematic. It will deliver about 0.3W into 8 ohms. If you need more volume than that provides and you want to run the amplifier from 5V, then I suggest this chip http://www.ti.com/lit/ds/symlink/lm4871.pdf or someting similar.

[EDIT: corrected transistor types]

I onow this is an old thread, sorry to bother you, but i was wondering: shouldn't there be a resistor between the arduino and the transistors here? And one between the 5v and the cap? I ask because i'm having troubles in my project . The speaker is causing short outs.

CrossRoads

#18
Jan 27, 2014, 10:25 pm Last Edit: Jan 28, 2014, 01:16 am by CrossRoads Reason: 1
I use this in my fencing scoring machines to make a loud 2-tone warble when a touch is scored.
The switch & resistors act as sort of a Hi/Lo volume control (wife says both are too loud).
The box has a bunch of holes drilled in front of it to act as guard against errant things that might be tossed that way.
You can make out the MOSFET and 68 ohm resistors at the lower right of the board.
http://crossroadsfencing.com/BobuinoRev17

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

RobvdVeer

Thank you. Can you explain how the capacitor functions to avoid a short?

By the way, the link does not work.

dc42


I onow this is an old thread, sorry to bother you, but i was wondering: shouldn't there be a resistor between the arduino and the transistors here? And one between the 5v and the cap? I ask because i'm having troubles in my project . The speaker is causing short outs.


There is no need for a resistor between the Arduino and the transistors, because the transistors are in the emitter follower configuration. The effective load resistance seen by the Arduino pin is the load resistance (8 ohm speaker) multiplied by the hfe of the transistors (at least 30, and probably much higher than that). I don't understand why you would want to add a resistor between 5V and the cap.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

CrossRoads

(fixed typo in link)

Capacitors only let changing signals thru - think of it like charging up, and once charged no more current flows.
http://en.wikipedia.org/wiki/Capacitive_coupling
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

RobvdVeer


I don't understand why you would want to add a resistor between 5V and the cap.

Because it'll create a short between +5 and ground? Even though the speaker is just 8ohm, too much current will flow, it basically fried my 328.

dc42



I don't understand why you would want to add a resistor between 5V and the cap.

Because it'll create a short between +5 and ground? Even though the speaker is just 8ohm, too much current will flow, it basically fried my 328.


No, something else fried  your Arduino. The peak current from the positive rail through the upper transistor will be no more than 500mA, and the maximum average current flow cannot exceed 100mA. You could add another capacitor between +5V and ground to help supply the peak current.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

RobvdVeer

I am not yet fully understanding all this, but thanks for trying to explain. I'll do some experimenting to try and comprehend this.

RobvdVeer

#25
Jan 28, 2014, 01:44 pm Last Edit: Jan 28, 2014, 01:47 pm by RobvdVeer Reason: 1
I'll try to explain my situation. I was using the attached circuit when i said this:
Quote from: RobvdVeer
it basically fried my 328.




Notice there's no capacitor in my circuit. When i put a PWM on the pin, the speaker pulled so much current that the whole project (running on batteries) was drained of power causing all sorts of bugs (cpu reset) and heat generation in the 7805, which would otherwise be stable. Using >100 ohm for R2 solved all problems, except the volume was way too low.

So when i saw your solution, with just a capacitor and no resistors, i was wondering why.

Edit: smaller image

RobvdVeer

I've given up on this part. I settled for a 50 ohm resistor R2 (next to the speaker) to stop my project from self destruction. I've tried a lot of thing to up the volume, including an 12v feed, and NPN/PNP pair AB class and even a TDA7052a amp ic, but all they did was suck too much current (the amp ic was LOUD btw before it took out the fuse). I've had enough frustration for now. I'll be stepping back for a few days/weeks to release the irritation and perhaps regain some enthousiasm.

Thank you all for assisting, even though it backfired on me.

polymorph

LM386. Can't get much simpler. No series resistor needed, just a volume control on the input and the other requisite parts. Low power draw.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

CrossRoads

LM386 is also low power output. P=V^2/R = 25/8 or 3W with 5V supply and 8 ohm speaker.
Transistor drops some voltage, so output will be less, say 2.4W if Vce of transistor is 0.6V.
Current draw will be 4.4/8 = .55A if transistor is allowed to turn on & stay on. That's what the capacitor provides - it only allows current flow until it charges up, and then it approaches looking like an open circuit. When it does, the speaker cone starts returning to initial position, and the current flow in the other direction moves the cone in the other direction.
So in my circuit, with the transistor off, the speaker gets driven in the positive direction while the cap charges up, then the transistor turns on and drains the cap allowing the speaker to return to neutral, and repeats the cap charging when the transistor turns on again.
With 12V and the speaker I used, it is loud!  Even with the two 68 ohm resistors in series it is loud.
Course, its a 4 ohm speaker, so ideal power would be 12V*12V/4ohm = 36W. I run from a wallwart, so it can  supply the current needed: 12/4 = 3A. The 68 ohm resistors help bring that down a lot - and wife says its still too loud!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

polymorph

He said he blew a fuse using a larger amplifier IC. So presumably he needs lower power, just more than he has now. An LM386 can be run from a higher voltage and has the advantage of being simple.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

Go Up