I am officially puzzled. I have been following this tutorial to add sound effects to my project:
Then amplified it using a single NPN resistor and 100-ohm resistor, as suggested by this site:
Thanks to those sites, I can play sound effects that sound, really, really good for a single PWM pin. I even hooked the speaker between the NPN collector and +5V to boost the output noticeably, as mentioned in the comments. It was audible in a quiet room, but I was hoping to get just a little bit louder. So I followed this instruction on an LM386 amp, thinking that it could do the trick:
But, oddly, it is not as loud as my simple NPN transistor! I can just barely hear the sound at 20 gain, then when I punch it up to 200 gain, it is still not as loud as the NPN and more distorted too. Even at quiescent levels, the LM386 is consuming around 40mA, which is about the same as the NPN. How can a single transistor do better than a full op amp?
I've tried this with and without capacitors on inputs and outputs. No help. I've tried multiple LM386's too. I am using a small 8-ohm speaker I got from Radio Shack. But it has a pretty strong magnet and I have heard it run louder using a GinSing board. Picture of my breadboard attached.
Do I need a DAC output? How would this help? Should I filter the input to the LM386 to give it sine waves instead of square waves? Would this allow the LM386 to actually amplify the signal like I expect? Why?