My first audio amplifier (and it's really bad) - Page 1
Forum section: electronics / beginners

author: jtruc34
author_rank: Regular Contributor
timestamp: May 09, 2019, 07:51:31 pm
content: I'm requesting your help because I can't make it work very good. By very good, I'm mean relatively to what I expected from it, and by that I mean very poor quality but at least the sound gets louder without saturating at Vcc/5.Attached below is the schematic of it.As you can see, it works with a general purpose LM358P OpAmp (I don't expect it to be very great for audio), followed by an emitter follower based on a Darlington pair of two random BJTs I had on my bench.I won't discuss about the quality of it, the only big problem is that it saturates like crazy when the output is more than 2V peak-to-peak and I'm not quite sure why (it's a way to say that I haven't got any idea).The strange thing is that if I increase Vcc, it ceases to saturate for one second and then it saturates again. It's like the operating point of the transistor changes for a second while the capacitor charges or discharges itself.I tried several things. I'm not sure about what value to put for Re. All I've noticed is that under 100 Ohms, no significant improvement can be observed apart from the temperature of the room, and above 10 KOhms, the output signal amplitude decreases too much.The value of C doesn't seem to change anything, except that under 100nF, the low frequency are cut off too much.The whole point of the capacitor was to avoid biasing the transistor myself, but since its emitter is connected to -Vcc (in the beginning, it was connected to 0V), I'm not sure wether it is useful anymore. I tried to connect the loud speaker directly to the emitter of the transistor without any major improvement, or without any improvement at all.I tried to connect the other pin of the loudspeaker to -Vcc (it is a very cheap loudspeaker, under $1, I don't really mind if I destroy it accidentally), and it improved things a bit, but that's a very ugly "solution" since it can damage the loudspeaker. Actually, I don't really know why this improved the saturation.So, two questions : how do I reduce the saturation, and how do I choose Re and C?

author: MagicSmoker
author_rank: Super Contributor
timestamp: May 09, 2019, 08:29:53 pm
content: Erf... Re is typically a small value to provide a bit of local negative feedback (called "emitter degeneration"). You also need to insert a resistor in series with the collector and take your output from the collector.Finally, you'll also need to modify the circuit so that the transistors are biased into conduction with a current through the collector load resistor equal to the maximum current you wish to draw from the amplifier (Class A operation). Applying a constant positive voltage to the op-amp non-inverting input will get the ball rolling, but this will NOT be stable. I leave it to you to dig a little deeper into how to solve this problem (hint - diodes can help here).

author: HB9EVI
author_rank: Frequent Contributor
timestamp: May 09, 2019, 09:09:41 pm
content: also bare in mind, that the LM358/324 is not a good choice for Audio; it's an opamp for DC which can go close to negative/gnd rail, what makes it a good single supply opamp, but not for AC because of the crossover distortion.

author: Zero999
author_rank: Super Contributor
timestamp: May 09, 2019, 10:01:25 pm
content: The loop isn't closed at DC, so it won't work. The output will just clip at either extreme.Yes, people may complain about the LM358 having crossover distortion, but that's a non-issue for this circuit because it only sources, never sinks current, so no crossover distortion.

author: mikerj
author_rank: Super Contributor
timestamp: May 09, 2019, 10:10:06 pm
content: Don't vary the closed loop gain to change the output as you are currently doing. Fix the closed loop gain, and use the potentiometer to vary the input into the amplifier. You will need to bias the input at around half the supply voltage.What is the value of Rc and what is you speaker impedance? As someone else has mentioned this design is (or will be) a Class A amplifier since your output stage can only source current, you have to rely on Rc to sink it. With a suitable value of Rc, and correct biasing this can work but will be horribly inefficient, the output transistor and Rc will be burning lots of power even with little or no output, requiring a big heatsink.Consider adding a complementary PNP output stage so that your amplifier can "push" and "pull" current, you will then have a Class B output. It will sound bad with lots of crossover distortion, so then you can find out how to bias both output transistors into partial conduction to fix this, and end up with a Class AB, which is how the vast majority of linear amplifiers operate.The 10uF output capacitor is woefully undersized for a typical 4 or 8 ohm speaker, this will block all low to mid frequencies; for an 8 ohm speaker it will start rolling off below about 4kHz, (8kHz for a 4 ohm speaker!). Even for low fidelity you need at least 10 times the capacitance, and it you want to put music through it maybe 100 times.

author: jtruc34
author_rank: Regular Contributor
timestamp: May 09, 2019, 10:46:21 pm
content: Quote from: MagicSmoker on May 09, 2019, 08:29:53 pmYou seem to think that I want a common emitter mounting, but what I want is an emitter follower aka common collector, to buffer the output of the op-amp.Quote from: MagicSmoker on May 09, 2019, 08:29:53 pmI don't really understand what you're talking about.Quote from: HB9EVI on May 09, 2019, 09:09:41 pmYes, as I said, I don't expect anything great of it, but I don't think such a big saturation may be explained by a bad op-amp for audio.Quote from: Zero999 on May 09, 2019, 10:01:25 pmThat's what I thought first, but then I tried to remove the capacitor to close the loop at DC, but that didn't really make things better. Also remind that the input hasn't got any DC component, so that shouldn't matter. I tried to offset the input to put a DC component, and of course, it didn't work anymore.And, yes, I probably expect that it is a bad design, since I haven't got any experience nor really understand what I'm doing nor really checked on the internet to find a better basis, but I really would like to understand why it is bad before looking at something that works better.Thank you very much for your help.

author: jtruc34
author_rank: Regular Contributor
timestamp: May 09, 2019, 11:06:07 pm
content: Quote from: mikerj on May 09, 2019, 10:10:06 pmI think you probably misread my bad handwriting, I wrote Re but it looks like Rc, sorry for that.As I said, I let Re be between 100 to 10k, with no major differences, so I let it at 1k. And, yes, I know class A are terribly I inefficient, like less than 10%, but I just wanted to quickly try it, and now I'm stuck because it doesn't work.The impedance of the loud speaker is 150 +/- 20 according to the datasheet, so it is not that loud of a speaker. Its frequency response is awful so I don't really mind losing a lot of low frequencies, and I won't use it anyway, I just want to make it work before moving on to a better circuit.

author: Zero999
author_rank: Super Contributor
timestamp: May 10, 2019, 10:51:58 am
content: There are a few things I missed when in my previous post.Where's the input coming from?The output needn't be AC coupled. You have a bipolar power supply, so you might as well make use of it.There was no limit to the maximum gain. With the potentiometer set to full, the op-amp will be in open loop so will saturate at either rail. As mentioned above, fix the gain and use the potentiometer to attenuate the input. I've AC coupled the 4k7 resistor to the negative rail so it doesn't have a high DC gain, which would amplify the op-amp's offset voltage and pass it through the speaker. The total gain of the circuit is now 0 to just over 200.The potentiometer shouldn't have any DC in it, so AC coupling it is a a good idea.This circuit is class A and very inefficient. It will dissipate 20W and only give 1W RMS into an 8 Ohm load! Re should be rated for over 10W and the BD439 must be n a good heatsink.

author: dzseki
author_rank: Frequent Contributor
timestamp: May 10, 2019, 11:11:04 am
content: An NJM4556 opamp would drive your speaker right away.

author: MagicSmoker
author_rank: Super Contributor
timestamp: May 10, 2019, 11:39:15 am
content: Quote from: jtruc34 on May 09, 2019, 10:46:21 pmSorry, yes, I quickly looked at your sketched circuit then wrote my post and made some poor assumptions/conclusions from such. Regardless, similar advice applies in that the emitter resistor in a Class-A single-ended emitter follower needs to be lower in value than the expected load impedance and the standing current flowing through both (ie - when no signal is being amplified) needs to exceed the maximum load current. That is the definition of Class-A operation after all, and its your only choice of operating mode for a single-ended audio amplifier.Quote from: jtruc34 on May 09, 2019, 10:46:21 pmIt no longer applies, but basically, if the emitter resistor is connected to a negative supply and the feedback (to the op-amp (-) input) is taken from junction of emitter and emitter resistor (not after the DC blocking capacitor, which shouldn't be needed now, anyway) then the op-amp will automatically force the transistor to operate in Class-A as it tries to maintain the output at 0V (with no signal input, that is). If the transistor wasn't biased on enough then the output would be a negative voltage, after all.EDIT - well I see that Zero999 handed you the solution on a silver platter!EDIT 2 - fixed quoting

author: jtruc34
author_rank: Regular Contributor
timestamp: May 10, 2019, 11:49:16 am
content: Until now, the signal was coming from my function gen. I just output a sine wave between 50 and 100 mVpp, and adjusted the gain until I saw saturation.So, I will try your modification as soon as I can and will say if it works better.But why do Re have to be so small ? In my (very small) experience, it works even with bigger values.And finally, so, what was the reason the output saturated only at about 2Vpp when then rail is at 5 times the voltage? From what I read of what you wrote, is that because my configuration amplified the offset of the Opamp? I'm not quite sure since the capacitor was precisely removing this DC component. Also, I'm not quite sure why the feedback is connected to -Vcc and not to ground through the divider.Thank you for your help.EDIT:Quote from: MagicSmoker on May 10, 2019, 11:39:15 amYes, indeed, and that's very kind of him. In general, I see that people on this forum are very kind and helpful. By the way, I should emphasise that my point is more to understand why it works or doesn't work than to make it work and use it, because, as everyone said, it will be awfully inefficient anyway.

author: Zero999
author_rank: Super Contributor
timestamp: May 10, 2019, 12:21:21 pm
content: Quote from: jtruc34 on May 10, 2019, 11:49:16 amRe forms a potential divider with the output load. The transistor can only pull the voltage across the load, towards the positive rail. It's the job of Re to pull the load voltage towards negative. Lowering Re will increase the possible negative output swing, at the expense of greater power dissipation. Increasing it will have the reverse effect. If you don't have adequate heatsinking, then no doubt it will work better, if Re is high, but you won't get so much voltage swing.Re could be replaced with a constant current sink, but that would require another transistor, which would be better employed converting it to class AB operation.The feedback potential divider is AC coupled to -V and has a DC gain of 1. It theoretically makes no difference whether it goes to 0V, -V or +V, since it has the same effect at AC, as the power supply rails should be properly decoupled i.e. have capacitors in parallel with them. The reason was to provide DC bias across the coupling capacitor.

author: jtruc34
author_rank: Regular Contributor
timestamp: May 10, 2019, 12:40:05 pm
content: OK, thank you very much. But since my loud speaker has about 150 Ohms impedance, Re probably doesn't need to be that low, does it?And I still don't understand why my amplifier was saturating at only Vcc/5 output.

author: Zero999
author_rank: Super Contributor
timestamp: May 10, 2019, 01:47:14 pm
content: Quote from: jtruc34 on May 10, 2019, 12:40:05 pmYou should have stated the impedance of the speaker, otherwise people assume 8Ohms which is the most common one. I agree, for 150Ohms, Re can be higher, try 100R to start with.The output was saturating because Re drops a significant voltage.

author: jtruc34
author_rank: Regular Contributor
timestamp: May 10, 2019, 03:33:53 pm
content: I already stated it in another answer, according to what someone else asked me, sorry that you didn't see it. Yes, 100R is about what I have.So, if it is because of Re, changing its value would have made things better, but it didn't... I'm lost

author: MagicSmoker
author_rank: Super Contributor
timestamp: May 10, 2019, 04:13:18 pm
content: Quote from: jtruc34 on May 10, 2019, 03:33:53 pmThe feedback resistance ratio given by Zero999 above might be asking too much of a sloppy op-amp like the LM358. As a first-pass I'd limit the voltage gain to around 10x and avoid the use of very large resistance values in general. Try 100k for the feedback resistor and 10k for the shunt resistor.As for the value of the emitter resistor, that really depends on how much (reasonably linear) negative output swing you need. Consider if it was 100R and the speaker impedance is 100R, then the positive half of the waveform can swing nearly to the positive supply on account of the transistor providing it, but for the negative half of the waveform the best the transistor can do is turn completely off, allowing all of the output to come from the emitter resistor, which being equal to the speaker impedance in this example means you get a maximum of 1/2 the negative supply. This will make for a most unpleasant listening experience even if high fidelity, per se, isn't the goal. With a 10R emitter resistor the negative swing can approach 90% of the rail but standing current increases to around 1A (a 0V output the effective collector-emitter resistance of the transistor will be 10R).Hopefully that is enough of an explanation to set you on the right path without doing all the thinking for you.

author: Zero999
author_rank: Super Contributor
timestamp: May 10, 2019, 10:27:21 pm
content: Yes, the LM358 doesn't have sufficient bandwidth for a gain of 200, at audio frequencies, perhaps it will be fine for voice, but not much else. It would be better to split the gain between two stages.Quote from: jtruc34 on May 10, 2019, 03:33:53 pmForgive me for not reading everything in the minutest detail. In future please put important details like that either in the first post or even better, the schematic. Few people will have time to read everything.As mentioned above the Re drops voltage. The lower its value, the less voltage it will drop, for a given current, as per Ohm's law. Unfortunately, because the DC voltage across it is 10V, irrespective of its value, the DC current, will also increase, as the value is reduced.Here's a simulation showing a 100R load with the amplifier set for a gain of 101. The clipping doesn't go away until R3 is lowered to 20R. Increasing it only makes it worse.