HOME     STORE     BLOG     SCHEMATICS     TUTORIALS     DOWNLOADS     CONTACT

LM386 Amplifiers
 
LM386 Amplifiers


 

LM386 Amplifiers

 


Many electronic projects require the use of a small audio amplifier. Be it a radio transceiver, a digital voice recorder, or an intercom, they all call for an audio amp that is small, cheap, and has enough power to provide adequate loudness to fill a room, without pretending to serve a disco! About one Watt RMS seems to be a convenient size, and this is also about the highest power that a simple amplifier fed from 12V can put into an 8 Ohm speaker. A very low saturation amplifier may go as high up as 2 Watt, but any higher power requires the use of a higher voltage power supply, lower speaker impedance, a bridge circuit, or a combination of those. During my many years building electronic things I have needed small audio amps many times, and have pretty much standardized on a few IC solutions, first and and foremost the LM386, which is small, cheap, and very easy to use. But it does not produce high quality audio... For many applications, the advantages weigh more than the distortion and noise of this chip, so that I used it anyway. In other cases I used different chips, which perform better but need more complex circuits. Often these chips were no longer available the next time I needed a small amplifier.


LM386 Amplifiers

When I last upgraded my computer, I replaced the old and trusty Soundblaster AWE 32 by a Soundblaster Audigy. The new card is better in many regards, but while the old one had an internal audio power amplifier, the new one doesn't! That's bad news, because I have some pretty decent speakers for the PC, which are fully passive. So, I built a little stereo amp using two LM386 chips and installed it inside the computer, fed by the 12V available internally.

But then I wasn't satisfied. The LM386 might be suitable for "communication quality" audio, which is roughly the fidelity you get over a telephone, but for music it's pretty poor! The distortion was awful. So, the day came when I decided to play a little more scientifically with small audio amps, looking for a way to get good performance with simple and inexpensive means.

I set up a test bench with a sine wave oscillator running at 1 kHz, an 8 Ohm speaker, 12V power supply, and the computer with the soundcard and Fast Fourier Transform software. One channel was connected to the oscillator together with the amplifier input, the other channel to the output and speaker. With this setup I measured the harmonic content of the audio signals. I did the tests at an output level of 0.1W, which is typical for moderately loud sound from a reasonably efficient speaker. Also, I used a music signal from a CD player to test the actual sound of each amplifier.

Below are the results.

As already said above, the main attraction of the LM386 is the extreme simplicity of its application circuit. You can even eliminate R1 if the signal source is DC-grounded. If the speaker leads are long, you should add an RC snubber across the output to aid stability. Additionally, if you need higher gain (not necessary if the input is at line level), you can connect a 10uF capacitor between pins 1 and 8. That's about all there is to it.

Now the bad news: This circuit produced a very high level of distortion! The second harmonic measured just -28dB from the main output. The third harmonic was at -35dB, while the noise level was at -82dB. There were assorted high harmonics at roughly -45dB. With music, the distortion was really disturbing, and also the noise level was uncomfortably high. The power supply rejection is poor, so that some hum and other supply noise gets through. In short, this was a lousy performance!

Since I had used so many LM386s in my projects, I had several different variations. In my material box I found a slightly newer LM386N-1. So I plugged it into my test amplifier. It was even worse! The second harmonic was at -24dB, the third harmonic at -31dB, while the noise was a tad better at -84dB. Folks, that's a total harmonic distortion of almost 7%! And the 0.1W output level at which this was measured is where such a circuit is about at its best... The distortion can be plainly seen on the oscilloscope, and a visibly distorted waveform is about the most offending thing an audio designer can ever see!

Looking through my projects, I found one where I had used a GL386 chip. This is just a 386 made by another company. I unsoldered it and put it in my test amplifier. Surprise! It was dramatically better, with the second harmonic at -45dB, and the third at -57dB! The noise floor was -84dB, just like the LM386N-1. But even this level of distortion was plainly audible when listening to music. That's roughly 0.6% THD. Some folks may consider it acceptable for music. I don't, but for communication equipment it's fine.

At this point, I decided to see if I could build a better amplifier, that doesn't become too complex nor expensive.


This was the first attempt. A low distortion, fast slew rate, but easy to find and rather inexpensive operational amplifier, driving a simple source follower made of two small transistors. These transistors are not biased, so they work at zero quiescent current, in full class B. The only mechanism that works against crossover distortion here is the high slew rate of the OpAmp, which is able to make the distortion bursts during crossover very short. To say the truth, I didn't expect to get usable performance from this circuit, and was really surprised when it worked much better than the 386! The second harmonic was at -77dB, the third at -79dB! Also there were many high harmonics at roughly -84dB. That means a THD of about 0.015%. The noise floor was down at the -120dB level! The power supply rejection was excellent, with no detectable feedtrough. Playing music, this amplifier sounded really good: No audible noise, and the distortion could be heard when paying attention to it, but I doubt that the average person would detect it! Not bad, for a bias-less design!

Just to see how important the slew rate of the OpAmp is, I pulled out the NE5534 and replaced it by a humble 741, which is many times slower. The result was dramatic: The second harmonic still good at -70dB, but the third harmonic was much worse, at -48dB. Also there were many high harmonics at the same -48dB level. Given that second harmonic distortion doesn't sound bad to most people, but third harmonic does, and high harmonics are even worse, it came as no surprise that the amplifier with the 741 sounded bad. At low volume it sounded particularly bad! So I returned to the oscillator and measurement setup, testing at lower output power, and found that while the second and third harmonics followed the output, the high harmonics stayed mostly constant! So, at very low output, the high harmonics became very strong relative to the output. All this is the effect of the slower slew rate of the 741, which makes it less effective correcting the crossover distortion of the unbiased transistors.

Interestingly, the noise floor of the 741 circuit wasn't bad: -118dB.

Just for fun, I tried this circuit with a third OpAmp: The TL071, which is good, but not as good as the 5534. The results: Second harmonic at -72dB, third and the high ones at -60dB, and the noise at -120dB. It's interesting that the second harmonic is much more suppressed than the third one. That must be a balancing effect of the symmetric output stage, and the better symmetry in the TL071 compared to other OpAmps.

It's worthwhile to note that this amplifier can be simplified a lot by using a split power supply. R1, R2, C1, C2 and C4 would be eliminated! But then you need the capacitor removed from C4 to bypass the negative supply line. The positive input of the chip goes to ground, while pin 4 and the collector of Q2 go to the negative supply. The rest stays the same.

If you use a +-15V supply, the available RMS output power grows to over 10 Watt! Of course, you then need larger transistors. And since larger transistors are slower, the distortion will rise somewhat.

An added benefit of a split supply is that the popping noise when switching on and off is eliminated.



As the next experiment, I decided to get rid of the crossover distortion. For this purpose, I added a traditional adjustable bias circuit with a transistor and a trimpot. Now I also had to add a current source, because with the bias circuit there is no single point into which the OpAmp could put its drive current into both bases! I adjusted the bias for the best distortion, and this was really a good one! The second harmonic was down right where the test oscillator delivered it, about -80dB, so I couldn't really measure it! The third harmonic was at -84dB, and the best improvement was that the higher harmonics had simply disappeared! They were all below the noise floor, which stayed at -120dB. Actually, this noise floor seems to come from the soundcard A/D converter, so that the actual noise of this and the above amplifier may even be better! With music, this amplifier sounded perfect - clean and smooth. And I'm pretty confident that the THD is well below the limits of my measurement setup, which is 0.01%.

The quiescent current was around 10mA. When lowering it to about 3mA, the high harmonics started to rise out of the noise floor. If you want to adjust the bias for the exact best quiescent current, there is a simple trick: Lift R4 from the output, and connect it to pin 6. Now the output stage has been left outside the feedback loop, and all its distortion will show up at the output. Watching the signal on an oscilloscope, or even better on a real time spectrum analyzer (soundcard and software), adjust the trimpot to the lowest distortion level. Have a current meter in the supply line and make sure that you don't exceed 30mA or so of quiescent current, in order to keep the small transistors cool. But most likely the best distortion will be at a current lower than that. Once the adjustment is complete, return R4 to its normal position. Now the full gain and slew rate of the operational amplifier is used to correct the small remaining cross-over distortion of the output stage, and the distortion will certainly disappear from the scope screen, from your ears, and possibly fall below the detection level of the spectrum analyzer!

This circuit can also be run from a split power supply, by exactly the same mods as for the previous circuit. And since the transistors are properly biased, there isn't any significant distortion increase when using larger transistors. Be sure to use some that have enough gain - you have only a few mA of driving available, and with a +-15V power supply and an 8 Ohm speaker, there can be almost 2A of output current! So, you need a gain of 300 at least. There are power transistors in the 4A class that provide such gain, and these are good candidates. The other option is using Darlington transistors, which far exceed the gain needed here. But they will again increase the distortion, not very much, but perhaps enough to make it audible again.



The conclusions, drawn from this day of applied science, are the following:

- Integrated circuits, even if they are of the same type, are not all born alike;
- One can easily outperform a simple IC by using a few discrete parts;
- It pays to measure how a circuit performs, and not just blindly trust a textbook;
- Simple, small, inexpensive amplifiers of high performance can be easily built;
- A computer is a great laboratory instrument!


LM386 Amplifiers






Accurate LC Meter Capacitance Inductance Meter with 16F628 and LCD
Volt Ampere Meter with 16F876 Microcontroller and LCD display
 
Accurate LC Meter

Build your own Accurate LC Meter (Capacitance Inductance Meter) and start making your own coils and inductors. This LC Meter allows to measure incredibly small inductances making it perfect tool for making all types of RF coils and inductors. LC Meter can measure inductances starting from 10nH - 1000nH, 1uH - 1000uH, 1mH - 100mH and capacitances from 0.1pF up to 900nF. The circuit includes an auto ranging as well as reset switch and produces very accurate and stable readings.
PIC Volt Ampere Meter

Volt Ampere Meter measures voltage of 0-70V or 0-500V with 100mV resolution and current consumption 0-10A or more with 10mA resolution. The meter is a perfect addition to any power supply, battery chargers and other electronic projects where voltage and current must be monitored. The meter uses PIC16F876A microcontroller with 16x2 backlighted LCD.

50MHz 60MHz Frequency Meter / Counter with 16F628 & LCD
1Hz - 2MHz XR2206 Function Generator
60MHz Frequency Meter / Counter

Frequency Meter / Counter measures frequency from 10Hz to 60MHz with 10Hz resolution. It is a very useful bench test equipment for testing and finding out the frequency of various devices with unknown frequency such as oscillators, radio receivers, transmitters, function generators, crystals, etc.
1Hz - 2MHz XR2206 Function Generator

1Hz - 2MHz XR2206 Function Generator produces high quality sine, square and triangle waveforms of high-stability and accuracy. The output waveforms can be both amplitude and frequency modulated. Output of 1Hz - 2MHz XR2206 Function Generator can be connected directly to 60MHz Counter for setting precise frequency output.

BA1404 HI-FI Stereo FM Transmitter
USB IO Board PIC18F2455 / PIC18F2550
BA1404 HI-FI Stereo FM Transmitter

Be "On Air" with your own radio station! BA1404 HI-FI Stereo FM Transmitter broadcasts high quality stereo signal in 88MHz - 108MHz FM band. It can be connected to any type of stereo audio source such as iPod, Computer, Laptop, CD Player, Walkman, Television, Satellite Receiver, Tape Deck or other stereo system to transmit stereo sound with excellent clarity throughout your home, office, yard or camp ground.
USB IO Board

USB IO Board is a tiny spectacular little development board / parallel port replacement featuring PIC18F2455/PIC18F2550 microcontroller. USB IO Board is compatible with Windows / Mac OSX / Linux computers. When attached to Windows IO board will show up as RS232 COM port. You can control 16 individual microcontroller I/O pins by sending simple serial commands. USB IO Board is self-powered by USB port and can provide up to 500mA for electronic projects. USB IO Board is breadboard compatible.

ESR Meter / Transistor Tester Kit
Audiophile Headphone Amplifier Kit
 
ESR Meter / Capacitance / Inductance / Transistor Tester Kit

ESR Meter kit is an amazing multimeter that measures ESR values, capacitance (100pF - 20,000uF), inductance, resistance (0.1 Ohm - 20 MOhm), tests many different types of transistors such as NPN, PNP, FETs, MOSFETs, Thyristors, SCRs, Triacs and many types of diodes. It also analyzes transistor's characteristics such as voltage and gain. It is an irreplaceable tool for troubleshooting and repairing electronic equipment by determining performance and health of electrolytic capacitors. Unlike other ESR Meters that only measure ESR value this one measures capacitor's ESR value as well as its capacitance all at the same time.
Audiophile Headphone Amplifier Kit

Audiophile headphone amplifier kit includes high quality audio grade components such as Burr Brown OPA2134 opamp, ALPS volume control potentiometer, Ti TLE2426 rail splitter, Ultra-Low ESR 220uF/25V Panasonic FM filtering capacitors, High quality WIMA input and decoupling capacitors and Vishay Dale resistors. 8-DIP machined IC socket allows to swap OPA2134 with many other dual opamp chips such as OPA2132, OPA2227, OPA2228, dual OPA132, OPA627, etc. Headphone amplifier is small enough to fit in Altoids tin box, and thanks to low power consumption may be supplied from a single 9V battery.
 

Arduino Prototype Kit
RF Remote Control 433MHz Four Channel
 
Arduino Prototype Kit

Arduino Prototype is a spectacular development board fully compatible with Arduino Pro. It's breadboard compatible so it can be plugged into a breadboard for quick prototyping, and it has VCC & GND power pins available on both sides of PCB. It's small, power efficient, yet customizable through onboard 2 x 7 perfboard that can be used for connecting various sensors and connectors. Arduino Prototype uses all standard through-hole components for easy construction, two of which are hidden underneath IC socket. Board features 28-PIN DIP IC socket, user replaceable ATmega328 microcontroller flashed with Arduino bootloader, 16MHz crystal resonator and a reset switch. It has 14 digital input/output pins (0-13) of which 6 can be used as PWM outputs and 6 analog inputs (A0-A5). Arduino sketches are uploaded through any USB-Serial adapter connected to 6-PIN ICSP female header. Board is supplied by 2-5V voltage and may be powered by a battery such as Lithium Ion cell, two AA cells, external power supply or USB power adapter.
200m 4-Channel 433MHz Wireless RF Remote Control

Having the ability to control various appliances inside or outside of your house wirelessly is a huge convenience, and can make your life much easier and fun. RF remote control provides long range of up to 200m / 650ft and can find many uses for controlling different devices, and it works even through the walls. You can control lights, fans, AC system, computer, printer, amplifier, robots, garage door, security systems, motor-driven curtains, motorized window blinds, door locks, sprinklers, motorized projection screens and anything else you can think of.
 

Electronics-DIY.com © 2002-2024. All Rights Reserved.