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 with PAM8403 module

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. LM386 with Gain=20

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.

  • 1
    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. – glen_geek Oct 7 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 Oct 7 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. – bharath Oct 8 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. – bharath Oct 8 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. – bharath Oct 11 at 12:19

I finally stumbled upon the issue. It is the wires. I used wires from a generic ribbonstrip of 40 wires (male-to-female, Dupont type)enter image description here. 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 4 ohm speaker through an additional resistance of 160 ohms. Replacing these with solid core wires (of ~1 ohm for similar length, ~10") got the volume to acceptable levels.

Of course, why in the world would a wire of 10" have a resistance of 80 ohms? I don't know. But this was a consistent measurement across several samples from that strip.

@glen_geek: But the motorboating did not end: After certain input volume increase the effect is recurring, though at a much higher volume. I remembered your suggestion about power supply weakness being a cause. I checked and again, I was using the same wires. I removed the wires from the amp and directly connected the amp to the power supply rail pins. Motorboating solved. Increase is now smooth all the way to maximum on the input signal. It is really wonderful to hear the same speaker sound so clear and loud, all because of a change of wires!

My thanks to you and jonk.

tldr: Check your wires. Power wires and audio wires should be low resistance. (<1 ohm per foot?)

  • Rock bottom pricing, rock bottom quality. Get a roll of wire from a reputable manufacturer and a crimping kit and make your own. – Passerby Oct 11 at 14:15

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.