Mono Headphone Amplifier Module - LM386
Nov 14, 2019 22:27:44 GMT
admin, robertlanger, and 1 more like this
Post by young Protoboard on Nov 14, 2019 22:27:44 GMT
Hey, folks,
I'm tackling a few different DIY projects right now, and have to wait for a new batch of op-amps to ship before I can finish and post the really fun and interesting modules. So until then, enjoy this sloppy fellow!
My first or second component orders from Aliexpress included a fat packet of LM386 ICs; I distinctly recall trying to order LM358 ICs instead and being rather disappointed in my mistake. It was a fortunate mistake, however, as it allowed me to make a little 9V powered speaker. I followed this guide (great for beginners!) and read here and there on the Internet on power amplifiers, etc. Specifically, I built the following circuit, which utilizes variable gain of 20-200 and bass boost that the LM386 is capable of:
As a standalone, battery-powered speaker, it works just fine, although my output capacitor (C1) is a little small (100uF) and I lose a fair bit of bass as a result. My little speaker rode beside my AEM for awhile until I got tired of the less-than-ideal quality of the 4 Ohm 3 W hobby speaker and refined my design for use with AEM.
Observations about this circuit's performance:
- Gain control is unnecessary when using with AEM-- the modular signal is already so hot that it can drive my Monk earbuds (64 Ohm impedance? Not sure) directly from the Audio I/O ports on MASTER. Gain was set to minimum level at all times during use.
- Bass is bottlenecked out, likely due to output capacitor sizing
- This circuit runs single-supply at 5V, so it could be powered from
- This circuit could totally fit in a 1U footprint and doesn't need to clutter up my workspace by existing independently
Revisions to previous design:
- Get rid of the external gain circuitry and use the LM386 internally-set gain of 20 (it's a seriously cool, handy, easy IC to work with-- read the article for more articulate info on this)
- Get rid of the bass boost, too, as it works by sending low-frequency signal components back into the feedback/gain circuitry, and we just got rid of the gain circuitry
- Use a bigger output capacitor; ideally 1000uF
I personally don't have much stereo capability with my AEM, so I kept the design mono for now. Besides, this is likely not the final format of my module-- design is an iterative process and I fully expect to improve upon most or all of my designs and modules as time goes by.
These revisions leave us with the following circuit:
(You'll have to forgive the handwritten drawings; I spent about an hour trying to find/create an LM386 symbol in OrCAD before making this circuit, and then I realized that I'm a strong, independent hobbyist solderer who believes in themselves enough to jot the darn thing down on an index card and scribble completed parts off as I go.)
Observe the 220uF output capacitor above; this was used instead of a 1000uF cap because the 1000uF electrolytics I own are HUGE and would have been quite the task in fitting that big thing in my teeny footprint.
I soldered a rough draft (as I do with most projects) of this new circuit after breadboarding the original...
... which didn't work correctly. Correct operation was only observable through a VERY small range in volume settings that were close to zero volume, beyond which the signal simply cut off and lost all detail. This was true with both AEM signals as well as other signals, such as from my phone; weaker signals seemed to work better? I wasn't sure what was causing such strange behavior until I studied the changes between the two designs in more depth. AEM audio signals are centered at roughly 2.5V, and the LM386 amplifies with reference to ground. So my circuit amplifies the desired AC components, as well as the DC offset-- and amplifying the constant DC portion of the signal means that unless the amplitude of the input wave is veeeeery small, the output is completely dominated by that amplified 2.5V offset. In effect, the amplifier output is overwhelmed by this "useless" (carrying no useful information) portion of the signal. This explains my volume-based issues.
Why did the previous circuit work fine, but not this one? The best that I can tell is that the feedback path created by the gain circuitry between pins 1 and 8 filtered enough of the DC offset to work without issue. Without this series resistor somewhere in the signal path, the DC haunts us.
What's the solution? My first thought was to decouple the input signal via a small-value series capacitor on the input pin. There's one very small change in the diagram below, and it's on pin 3; a 10uF cap:
(Forgive my hilariously-sized images; I'm new to this forum thing and promise I'll do better next time.)
This solution was successfully tested on my rough draft before I soldered up, tested, and fitted the "final" version:
And I fashioned a temporary front panel from scavenged fiber board, blank labels, and lots of impatient cutting:
(Wait, this photo has the first paper front panel rough draft, not the sexy MDF. Oops.)
(You can see the real OG LM386 speaker in the background of this photo, which was taken during side-by-side comparisons of the two amp circuits.)
I have limited access to a laser cutter, so I fully expect to print off something sleek and serviceable once I get around to creating the .svg file, calipers in one hand, mouse in the other...
It works!
Thoughts, feelings, and observations:
-I launched into this design without really taking into account any specific requirements, parameters, etc. For example, I don't have the equipment to characterize frequency response, etc. so it seemed futile to design around precisely chosen values for this case.
-This module is to be used primarily with my Monk headphones (64 Ohm impedance), which are outside of the specified operating range of the LM386 (4-32 Ohms). Project-melting mistake? I'm not well-versed in speaker, microphone, amplifiers, etc., but based on my rudimentary understanding of speaker power and whatnot, I don't expect sparks or a house fire; rather, just a potentially weaker signal. If I'm wrong about this, though, somebody PLEASE tell me. I like my house and don't want it burned down.
-It would have been better to design with a few systems-oriented checks/requirements than I had done. For example, I didn't think much about the module's total current draw from this module before starting the design; rather, I retroactively checked the datasheet and verified that current draw is in the <5mA range and okay to add to my rack.
-There's likely a more optimal value for the input decoupling capacitor (10uF at pin 3), likely much smaller than what was used. I'm not entirely certain of the best way to calculate this value.
-I wonder if instead of using a capacitor to decouple the input, the amplification could be achieved by referencing the inverting input to 2.5V (the DC offset of the signal) rather than to ground. I haven't tried this. With a more "standard" op-amp, it should work fine, I think; but the LM386 is a power amplifier and may play by a few different rules-- I'm not experienced enough in the matter to be able say.
-As a nearly blind person, I really like the knob cap on this module and this module ONLY; it helps to easily and non-visually differentiate what is effectively my "master volume," and makes the pot easier to turn.
Thanks for reading! I should be posting some more interesting modules and designs soon.
yPb
I'm tackling a few different DIY projects right now, and have to wait for a new batch of op-amps to ship before I can finish and post the really fun and interesting modules. So until then, enjoy this sloppy fellow!
My first or second component orders from Aliexpress included a fat packet of LM386 ICs; I distinctly recall trying to order LM358 ICs instead and being rather disappointed in my mistake. It was a fortunate mistake, however, as it allowed me to make a little 9V powered speaker. I followed this guide (great for beginners!) and read here and there on the Internet on power amplifiers, etc. Specifically, I built the following circuit, which utilizes variable gain of 20-200 and bass boost that the LM386 is capable of:
As a standalone, battery-powered speaker, it works just fine, although my output capacitor (C1) is a little small (100uF) and I lose a fair bit of bass as a result. My little speaker rode beside my AEM for awhile until I got tired of the less-than-ideal quality of the 4 Ohm 3 W hobby speaker and refined my design for use with AEM.
Observations about this circuit's performance:
- Gain control is unnecessary when using with AEM-- the modular signal is already so hot that it can drive my Monk earbuds (64 Ohm impedance? Not sure) directly from the Audio I/O ports on MASTER. Gain was set to minimum level at all times during use.
- Bass is bottlenecked out, likely due to output capacitor sizing
- This circuit runs single-supply at 5V, so it could be powered from
- This circuit could totally fit in a 1U footprint and doesn't need to clutter up my workspace by existing independently
Revisions to previous design:
- Get rid of the external gain circuitry and use the LM386 internally-set gain of 20 (it's a seriously cool, handy, easy IC to work with-- read the article for more articulate info on this)
- Get rid of the bass boost, too, as it works by sending low-frequency signal components back into the feedback/gain circuitry, and we just got rid of the gain circuitry
- Use a bigger output capacitor; ideally 1000uF
I personally don't have much stereo capability with my AEM, so I kept the design mono for now. Besides, this is likely not the final format of my module-- design is an iterative process and I fully expect to improve upon most or all of my designs and modules as time goes by.
These revisions leave us with the following circuit:
(You'll have to forgive the handwritten drawings; I spent about an hour trying to find/create an LM386 symbol in OrCAD before making this circuit, and then I realized that I'm a strong, independent hobbyist solderer who believes in themselves enough to jot the darn thing down on an index card and scribble completed parts off as I go.)
Observe the 220uF output capacitor above; this was used instead of a 1000uF cap because the 1000uF electrolytics I own are HUGE and would have been quite the task in fitting that big thing in my teeny footprint.
I soldered a rough draft (as I do with most projects) of this new circuit after breadboarding the original...
... which didn't work correctly. Correct operation was only observable through a VERY small range in volume settings that were close to zero volume, beyond which the signal simply cut off and lost all detail. This was true with both AEM signals as well as other signals, such as from my phone; weaker signals seemed to work better? I wasn't sure what was causing such strange behavior until I studied the changes between the two designs in more depth. AEM audio signals are centered at roughly 2.5V, and the LM386 amplifies with reference to ground. So my circuit amplifies the desired AC components, as well as the DC offset-- and amplifying the constant DC portion of the signal means that unless the amplitude of the input wave is veeeeery small, the output is completely dominated by that amplified 2.5V offset. In effect, the amplifier output is overwhelmed by this "useless" (carrying no useful information) portion of the signal. This explains my volume-based issues.
Why did the previous circuit work fine, but not this one? The best that I can tell is that the feedback path created by the gain circuitry between pins 1 and 8 filtered enough of the DC offset to work without issue. Without this series resistor somewhere in the signal path, the DC haunts us.
What's the solution? My first thought was to decouple the input signal via a small-value series capacitor on the input pin. There's one very small change in the diagram below, and it's on pin 3; a 10uF cap:
(Forgive my hilariously-sized images; I'm new to this forum thing and promise I'll do better next time.)
This solution was successfully tested on my rough draft before I soldered up, tested, and fitted the "final" version:
And I fashioned a temporary front panel from scavenged fiber board, blank labels, and lots of impatient cutting:
(Wait, this photo has the first paper front panel rough draft, not the sexy MDF. Oops.)
(You can see the real OG LM386 speaker in the background of this photo, which was taken during side-by-side comparisons of the two amp circuits.)
I have limited access to a laser cutter, so I fully expect to print off something sleek and serviceable once I get around to creating the .svg file, calipers in one hand, mouse in the other...
It works!
Thoughts, feelings, and observations:
-I launched into this design without really taking into account any specific requirements, parameters, etc. For example, I don't have the equipment to characterize frequency response, etc. so it seemed futile to design around precisely chosen values for this case.
-This module is to be used primarily with my Monk headphones (64 Ohm impedance), which are outside of the specified operating range of the LM386 (4-32 Ohms). Project-melting mistake? I'm not well-versed in speaker, microphone, amplifiers, etc., but based on my rudimentary understanding of speaker power and whatnot, I don't expect sparks or a house fire; rather, just a potentially weaker signal. If I'm wrong about this, though, somebody PLEASE tell me. I like my house and don't want it burned down.
-It would have been better to design with a few systems-oriented checks/requirements than I had done. For example, I didn't think much about the module's total current draw from this module before starting the design; rather, I retroactively checked the datasheet and verified that current draw is in the <5mA range and okay to add to my rack.
-There's likely a more optimal value for the input decoupling capacitor (10uF at pin 3), likely much smaller than what was used. I'm not entirely certain of the best way to calculate this value.
-I wonder if instead of using a capacitor to decouple the input, the amplification could be achieved by referencing the inverting input to 2.5V (the DC offset of the signal) rather than to ground. I haven't tried this. With a more "standard" op-amp, it should work fine, I think; but the LM386 is a power amplifier and may play by a few different rules-- I'm not experienced enough in the matter to be able say.
-As a nearly blind person, I really like the knob cap on this module and this module ONLY; it helps to easily and non-visually differentiate what is effectively my "master volume," and makes the pot easier to turn.
Thanks for reading! I should be posting some more interesting modules and designs soon.
yPb