What is this amplifier doing, exactly?

Next experiment:

Krupski: I would try this for fun: Remove the 2.2K resistor between the Arduino and the transistor base and replace it with a 1 uF (not critical) capacitor (positive side to the transistor base).

0.33 uF capacitor added in series with the 2.2K resistor:

0.33 uF capacitor added instead of the 2.2K resistor:

The sound is a bit thin with this one.

Erdin: So I would remove both 100k, and perhaps add a flyback diode over the speaker.

Back to original circuit, (no capacitor), however the 100K resistor from collector to base removed (flyback diode still in place):

Now both 100K resistors removed (looks much the same to me):

The DC bias on the speaker will push (or pull) the diaphragm well away from centre and thus can give strong even harmonics or worst-case damage the mechanical suspension - not good.

For a novelty speaker driver try a MOSFET driver chip like the MIC4422 which takes logic level in and can run from 5 to 18V and deliver up to 9A!! (at 18V). Definitely want to use an output capacitor to protect the chip and speaker, and check it doesn't overheat, but it is also plenty fast enough to run as a class-D amplifier very nicely - a fast PWM signal for instance will get you 8-bit audio of sorts.

This is a variation of what CrossRoads suggested:

I kept the transistor, put 100 ohm and a 0.33 uF in series with the signal to the base.

No resistor from collector to base, and 1K from base to emitter.

Sounds a bit thin still. Maybe I'm not doing it right.

Maybe depends on the speaker too. Mine definitely do not sound thin.

Wiring it like this (I think):

I get this output:

Change the 2.2K base resistor to 100 ohms (is that good for the output pin?) and I get:

That last one sounds pretty good (and loud!).

I was starting to doubt that the thing I had in my hand really was a capacitor (it was just sitting around on a breadboard) so I swapped it out for a 1 uF electrolytic. Got much the same results as with the other capacitor, with the last circuit above (with the 100 ohm resistor) and a 1 uF capacitor in series with that:

I just don't "get" the shape of the blue line. I obviously need to learn more about capacitors and the way they work in circuits like this.

throw this ckt away, use something better.

Bah. It attempts to be an audio amplifier, but the arduino isn't feeding it "audio" anyway, so there is little point. Throw it away and replace it with something simpler that ISN'T anything close to an audio amp. Like the traditional "higher power" transistor switch...

The circuit in reply #24 is close to that isn’t it, Westfw?

The cap is doing what caps do, it's trying to prevent a change in voltage by supplying a large amount of current when it first switches. Notice how the upper trace (yellow) pin voltage sags when it switches. I think the 100 ohm resistor performance shows that the transistor is too small since driving it so hard gets it to produce a much better looking wave.

Try a 10 or 22 uF cap, instead of 0.33 uF. Maybe also use a 100 ohm R from emitter to ground. This should greatly improve the low-frequency response. Those rapid decays in the waveforms are due to the input time-constant being way too small.

The large overshoot without the snubbing diode is the typical inductive kickback that occurs when you open the current to the speaker.

I found a 220 uF cap lying around and that gives this:

I presume I put the + side on the Arduino side? That's the more positive side of it, right?

As for the 100 ohm between emitter and ground, that made it much softer:

Did you mean to replace the 1K with 100 ohm between base and ground?

The 220 uF looks much better than 0.33 uF. The quick decay is gone, and you'll not have any dc-currents through the speaker.

I thought the 100R in the emitter would help improve the low-freq response, but it also kills the gain too much. So you might go back to tying the emitter to gnd, and use a 10K in series with the 220 uF cap on the base. I might also use a larger R on the base to gnd, eg go back to the 100K.

I'm not sure why you're getting the overshoot on the leading edge. Do you have the scope probe ground lead tied close to the same point as the speaker gnd, or right at the emitter?

The Arduino Gnd pin, so there was a bit of a cable run. I moved it to next to the emitter, but no real change on the display.

By a coincidence I got these in the mail today from eBay:

2 Channels 3W PAM8403 Class D Audio Amplifier Board 5V

$US 2.84 each.

Wired one up to my iPhone and those old speakers. Quite nice sound out of it.

oric_dan: So you might go back to tying the emitter to gnd, and use a 10K in series with the 220 uF cap on the base.

Nah, that just killed the sound altogether (the 10K resistor).

Your question on the 10 ohm resistor was good. It is exactly for current limiting. Remember the 6-8 ohm speaker is an impedance (Xl = 2*pi*f*l) usually measured at 1000 HZ. So with no ac signal, the dc value of that speaker is basically a short circuit.

oric_dan: Well, actually, not "quite" a Class A design. Class A is intended to bias the transistor into its linear region of operation, but you'll never get that with the ckt as shown.

It looks like the person who designed it had the intent of Class A, but you would need a resistor in the emitter lead, so the 100Ks on the base have something to bias in a stable fashion. As it is, they simply turn on the transistor, and whether or not the collector sits at Vcc/2 is strictly a factor of the hFE [beta] dc current-gain of the transistor.

Advice - throw this ckt away, use something better.

Sure it's Class A. Class A is defined as bias current flowing all the time. Class A doesn't HAVE to also be "linear".

And, given the choice of Class A, Class AB, Class B, Class C or Class D, what would YOU call it? :)

The emitter resistor isn't really needed because the bias-stabilizing negative feedback comes from the fact that the top base resistor is connected to the COLLECTOR and not to VCC.

I agree though, that circuit is better off in the trash can! :)

CrossRoads: This is the speaker. I am quite happy with them. http://www.mpja.com/4-Ohm-Mini-Speaker/productinfo/14618%20SP/

For a tiny speaker amp, why not an LM-386?


Here’s my 300 watts per channel Class-D power amplifier (300W into 4 ohms, 150W into 8 ohms and 50V output swing +50/-50). Bwahahaaa!!! :slight_smile:

Very nice - but will it give Tone outputs that nice warm Tube sound? 8)