# Loudspeaker volume issue

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.

See circuit here:

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?

• clipping/motorcycle noise? This is perhaps audio motorboating. Your circuits show no power supply capacitors. A large value (greater than 100uF) should be added very close to the chip, from DC supply (Vcc) to Gnd. Commented Oct 7, 2018 at 15:18
• What is the input source and why isn't there any DC blocking at the input side? If it is the MCU, don't you imagine there is a DC bias to it? (I have NO IDEA what you are actually doing from the MCU side. But perhaps I missged something you wrote, in skimming quickly. Easier to just ask.)
– jonk
Commented Oct 7, 2018 at 21:29
• @glen_geek: Hi, Thanks for responding! the module may have caps on it to do this, but I will do it and report back. Commented Oct 8, 2018 at 6:35
• @jonk: Hi, Thanks for responding! Probably hidden away in the detail of the question, but the input source is no longer the micro-controller, but a headphone out from my phone/laptop. DC blocking: I was assuming the module already had caps on it for this, but will re-check this again. Commented Oct 8, 2018 at 6:37
• @glen_geek: I finally found the issue. It is the wires. I used wires from a generic ribbonstrip of 40 wires (male-to-female, Dupont type). I would cut off one end and solder them on to the speaker and use the other end to connect to the amp. For some unknown serendipitous reason, I measured the resistance of a wire, from speaker to amp with my multimeter. The resistance was 80 ohms. The other wire was also roughly the same. So, I was running the sound for a 4Ohm speaker through an additional resistance of 160 Ohms. Replacing these with solid core wires got the volume to acceptable levels. Commented Oct 11, 2018 at 12:19