I am building a microcontroller based circuit that generates some sound out of a loudspeaker.
Basic problem: Not enough volume out of loudspeaker
Strange stuff: Volume is louder if I use a LM386 amp (with a max output of 1W) instead of the PAM8403 amp module (with a max output of 2.5W), but sound gets distorted with the LM386.
What I did so far:
So, to help debugging, I removed the microcontroller part of it and just fed input from PC or phone via headphone jack, wired it into the amp module and ran it to the loudspeaker. When initially speaker made only noise, I added resistors to reduce signal amplitude, so I could hear something out of the speaker.
Circuit components
Speakers: A. 4 Ohm, 10W (mostly tested with this)(reasonably known manufacturer) B. 4 Ohm, 3W (unknown origin)
Amplifier:
1. PAM8403 module ordered on the net. PAM8403 datasheet
2. LM386N datasheet
Observations:
Observation #1. I get some sound from the speaker at a low volume, and when I increase the input volume from the phone or PC, it gets into clipping/motorcycle noise.
Still, not very acceptable volume before the clipping starts.
Then I went and did some calcs:
PAM Gain: 24dB
=> Ratio of 24db => Vo = 15*Vin
If I want 3W, out of 4Ohms, the Voltage should be: V^2/R = P
=> V^2 = 3*4 = 12 => V = SQRT(12)=3.46
Now, if output (Vo) should be 3.5V, then input should be 3.5/15 = 0.23V.
Suppose 2V (line level??) then, we must see this as approximately 2V/10.
So, I got to fiddling with the resistors to get this kind of 1/10 reduction. Then I was fiddling with resistors of all values for a while before the input to the PAM, to bring down the input signal voltage.
Observation #2. At one point, I was able to reach all the way to the highest volume on the phone without clipping, but the loudspeaker volume is still not going higher.
Change of amplifier
I then switched out the amplifier and tried out an LM386 datasheet using the circuit below.
Observation #3. Clear difference in sound level output: Speaker has an ability to make decent amount of sound. But, it gets muddier and loses clarity at higher volumes (attributable to LM386??)
So, went and did some reading about gain, and modifying input signal. But, no clarity, yet.
What help am I expecting:
a. Please suggest potential next steps I could try, including some reading.
b. Is what I am seeing normal or should I just throw out the speakers and try fresh (did this with two units of speaker A already, results not changing, but one unit of B shows substantial improvement in sound even with PAM8403, but for extraneous reasons, would prefer to get speaker A working "louder").
c. I have a gut feel that the thing I am missing is not the ratio of the resistors, but the size of the resistors used. Valid?
Thanks for your patient reading.