[Solved] Noise and low volume Issues with audio amplifier.

Hello and thanks for taking the time to read this,

I was looking to increase the audio volume and clarity in my project so I just swapped out:

1x - TPA2016 3w amplifier from Adafruit (Stereo 2.8W Class D Audio Amplifier - I2C Control AGC - TPA2016 : ID 1712 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits)
2x - 3" 4 Ohm 3 Watt speakers from Adafruit (Speaker - 3 Diameter - 4 Ohm 3 Watt : ID 1314 : $1.95 : Adafruit Industries, Unique & fun DIY electronics and kits)

in my project for:

1x MAX9744 20w amplifier from Adafruit(Stereo 20W Class D Audio Amplifier - MAX9744 : ID 1752 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits)
2x - 20W 4 Ohm Full Range Speakers from Adafruit (20W 4 Ohm Full Range Speaker [XS-GTF1027] : ID 1732 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits)

Nothing else in my project has changed other than to code to control the gain of the amplifier which is very simple. You just write what gain you want via i2c,

Strangely though, I'm now getting LESS volume out of the 20w speakers than I was from the 3w speakers with the gain set to max (60). I'm getting almost no volume at all until up around 30 or so too.

The audio signal is coming from a Musical instrument shield from Sparkfun. (SparkFun Music Instrument Shield - DEV-10587 - SparkFun Electronics) It's a shield but I'm not using it as one since it only uses 4 pins. I soldered headers only onto the pins that are actually used and tied those to where they belong on my micro controller (teensy3.1).

See attachment for how its all hooked up. It's pretty simple.

I'm also getting a fairly loud high pitched hum from the speakers. I assume this is a grounding or interference issue so I tried using the analog ground on the amp without any improvement. I'll post more info about what I've tried as I do more tests.

I tried removing the Musical Instrument Shield and just connecting an iPod via the headphone jack to the amp and it worked beautifully. No hum, uncomfortably loud. So it isn't a problem with the amp.

Does anyone have any ideas as to why I would be getting less sound and more noise out of this 20w amplifier then I did with a 3w amplifier? I'm pretty new to audio projects so even the most basic of advice would be very welcome. Thanks again for taking the time to read this. Your help will be much appreciated.

Also, let me know if any pictures I attach are difficult to read.

Thanks,
Nick

EDIT 7/14/2014:

Conclusion:

The use of the op amp in the circuit led me to believe that I could achieve a much greater volume than this amplifier can handle in a realistic application. With this hardware at least, single notes with a decent interval between them can be played, distortion free, at significantly higher apparent volumes then multiple notes in rapid succession. The best implementation of the devices I'm using is to simply connect the midi shield directly to the power amplifier. The individual notes, set to max volume, produces a ~2.7Vpk-pk signal which, when adding a little headroom, is just within the operating range of the power amp's input. Setting the gain of the power amp to a value which produces an output just below the operating range gives me the maximum volume I can achieve with this hardware. The result is a noise and distortion free sound with decent, though not what I was hoping for, volume.

Solutions to problems in this thread:

  • The initial noise I was experiencing was due to a ground loop caused by connecting both the midi shield (-) to the power amp input (-) and the power amp's GND to circuit GND.

  • The low volume was due to my misunderstanding of what the velocity value of a midi noteOn command meant (increasing this value increased the signal volume significantly) and my incorrect assumption that increasing system wattage would equal a directly proportional increase in apparent volume . Confounding factors included, no proper baseline for comparison, single notes vs rapid notes producing signal amplitude that was not directly proportional to apparent volume and different, and often not well controlled, input signals producing different apparent volumes at given signal amplitudes.

  • The "repeating" source of noise was caused by noise on the USB connection I was using that was greatly amplified by the op amp and power amp in the circuit. Removing the USB connection, reducing total gain and the use of decoupling capacitors mitigated this noise.

  • The "squeal" noise was caused by the Musical Instrument Shield introducing noise on the circuit GND and was greatly amplified by the op amp and power amp in the circuit. Reducing total gain and adding a large (1000uF) capacitor directly across the 5v/GND connection on the shield mitigated this noise.

  • The distortion, in the later portion of this thread, was caused by either the op amp, power amp input or power amp output clipping. Bringing the signal at all of these points within their operating range eliminated the distortion.

Results of original (3w) setup vs current (20w) setup:

  • Improved, though not stellar, volume.
  • Greatly improved sound quality.
  • Greatly improved bass response.

What I've learned throughout the course of this thread:

  • Increasing amplifier/speaker wattage does NOT equal a directly proportional increase in apparent volume.
  • The "velocity" value in a noteOn midi command, at least in this midi shield, controls the volume of that individual note. Not the speed at which the note reaches it's maximum volume.
  • The difference between the AC and DC portions of an audio signal.
  • How to use an op amp to amplify the voltage range of a signal.
  • How to configure an op amp's gain and offset.
  • The use of high-pass and low-pass RC filters.
  • A tone control method.
  • Noise reduction techniques and troubleshooting.
  • The basic usage of an oscilloscope.
  • Using an oscilloscope to identify certain values of an audio signal. Namely the DC bias and Vpk-pk values.
  • General electronics troubleshooting techniques.

Thank you everyone that was willing to help me work through this issue and improve my understanding of audio systems, especially Jiggy-Ninja. Frankly, I'm shocked that you stuck with me all the way through this thread. You sir, are a gentleman and a scholar (literally) and I can't thank you enough for your invaluable help.

If at some point I decide that this hardware is insufficient for this project, I'll create a new thread asking for hardware suggestions. For now though, I can resume work on other aspects of the project. I'll also post the finished results (or a link to them) here when it's done. It should be pretty cool.

Thanks again.

I just noticed there was an Audio specific sub forum.

If a moderator sees this could you please move this topic there or delete this one (can't delete it myself) so I can repost?

Thanks!

power increase..(3W->20W) sound a lot, but it's much less than "twice the sound".
(to compare. I run a PA-systen in a school, 33 classroms, with 8 x LM386-4, delivering max 1W each)
I guess your 'new' system needs more voltage to perform..
The other important point is to balance the load to the output stage.
The optimum is that theese impedances are equal.
.............
hum and noise is often due to lack of shielding

The datasheet for your amplifier states it accepts 1V pk t o pk line level signal. You should not have a problem .You should post on the Adafruit Tech Support forum. An Adafruit Tech Support rep will answer your post in a couple of days.

adafruit-20w-stereo-audio-amplifier-class-d-max9744.pdf (3.29 MB)

" I guess your 'new' system needs noew voltage to perform.."

That's something I forgot to mention. The new amp is being powered by a dedicated 60w 12v supply. The old amp only took up to 5v.

"The other spect is to balance the load to the output stage.
The optimum is that theese impedances are equal."

I'm sorry but I don't understand the statements above. I don't know how one would go about balancing the load to the output stage or what impedances you're referencing. More information would be much appreciated.

load .. output stage impedance..

To get the optimum power output, the speakers impedance should be the same as output stage impedane.
(Ohms low can proof this)

When 'mismatch' : the power is used to heat your amplifier rather than making sound from your skeaker(s)

Silly question but did you unplug the midi shield and plug in an mp3 player or ipod or cell phone or other device to test your amplifier isolated from the Midi shield ? (You can use a Line out from your PC to the Line In of the amp)

..is that 12V backed by a charger?
I've notised that many 'intelligent' chargers use PWM at 2.5 kHz to charge batteries. That freq often tend to end up as an irritating sound. (It did for me)

raschemmel:
Silly question but did you unplug the midi shield and plug in an mp3 player or ipod or cell phone or other device to test your amplifier isolated from the Midi shield ? (You can use a Line out from your PC to the Line In of the amp)

I did. It's detailed in the OP. In short, I removed the "shield" and used an iPod instead. It worked great.

knut_ny:
..is that 12V backed by a charger?
I've notised that many 'intelligent' chargers use PWM at 2.5 kHz to charge batteries. That freq often tend to end up as an irritating sound. (It did for me)

It's a 12v 5a "laptop brick" style switching power supply. If there is any sort of "intelligent charger" within, I'm not aware of it.

Using an Ipod instead of the "Musical Instrument Shield" as the audio source gives perfect results, so that seems to me at least to rule out the power source as the issue.

[EDIT]
(previous comment deleted. see below)

Simply connect a speaker/stereo/pair of headphones to the 1/8" stereo jack on the shied and pass the proper serial commands to the IC and you’ll be playing music in no time!

plug stereo line level into the 3.5mm stereo headphone jack

Have you tried Analog Mode ?
Did you read the instructions on how to use that ?

Above the pinouts there are three solder jumpers (Analog / AD1 / AD2) and then on the left, a 3-pin breakout called Pot. Vol - these are used in analog mode, the solder jumpers are closed to tell the chip we'll be using a potentiometer to set the volume. The Pot Vol connection is how we wire up the 1K potentiometer. This is covered in more detail in the Analog Wiring section.

Couple of things I noticed.

Both of the Class D amps have feedback networks in them and a high Power Supply Rejection Ratio (PSRR). This means that just bumping up the supply voltage will NOT make the sound any louder, it will only give you more headroom.

Second, the maximum gain for both amps is about the same, 30 dB. With the same line inputs, hooked up to the same speaker, will give about the same sound output at maximum volume. Hook your small speaker up to the 20W board and see how it compares to the big speaker.

If there is still a significant and noticeable difference between the speaker volumes when hooked up to the same amp, the only thing I can think of that may be the culprit is the sensitivity of the speakers. Different speakers produce different levels of volume, even when supplied with the same power. I noticed this myself on my project when I changed from a cheap 0.5W speaker to a better BMR speaker for Parts Express. The BMR speaker was louder, even though it was driven by the same amp with the same signal.

Your only solution to making a louder sound come out of your speaker is probably to use an op amp as a preamp to amplify the line signal.

Since the OP verified there is nothing wrong with the amp using an ipod or some other test signal it would seem there is some impedance mismatch between the Midi shield and the amp. It's too bad the OP doesn't have a scope to look at the signal.

@OP,
Can you measure the audio out of the Midi Shield with a meter on AC mode ? (with the amp disconnected)

Thank you for all the responses. I really appreciate the help.

raschemmel :
"Have you tried Analog Mode ?
Did you read the instructions on how to use that ?"

  • I did read how to set it up for analog control but my project demands that it's controlled digitally so I haven't tried it. Do you think it might be helpful to try?

"Since the OP verified there is nothing wrong with the amp using an ipod or some other test signal it would seem there is some impedance mismatch between the Midi shield and the amp. It's too bad the OP doesn't have a scope to look at the signal."

  • I think this might be the last straw on needing a scope for this project but not having one. I was looking at getting a Rigol ds1102e. It seems to be the most popular hobby price/quality scope. Do you have any recommendations?

"@OP,
Can you measure the audio out of the Midi Shield with a meter on AC mode ? (with the amp disconnected)"

  • I set the midi shield to play a single note at max volume every 20 milliseconds then measured the AC voltage on the shields output at around 200 mV. I tried reading DC voltage (just because) and got around 200 mV as well.

Jiggy-Ninja:
"Second, the maximum gain for both amps is about the same, 30 dB. With the same line inputs, hooked up to the same speaker, will give about the same sound output at maximum volume. Hook your small speaker up to the 20W board and see how it compares to the big speaker.

If there is still a significant and noticeable difference between the speaker volumes when hooked up to the same amp, the only thing I can think of that may be the culprit is the sensitivity of the speakers. Different speakers produce different levels of volume, even when supplied with the same power. I noticed this myself on my project when I changed from a cheap 0.5W speaker to a better BMR speaker for Parts Express. The BMR speaker was louder, even though it was driven by the same amp with the same signal. "

  • So I hooked up the 3w speakers to the 20w amp. The 3w speakers were slightly louder than the 20w. They also still work and they didn't sound like they were over driven at all so I guess that confirms the amp is not putting out much more than 3w.

"Your only solution to making a louder sound come out of your speaker is probably to use an op amp as a preamp to amplify the line signal."

  • Op amps are something I'm not at all familiar with using. I guess it's time for some research. After a quick look, there seems to be a wide variety of different types of op amp out there. Judging by the name, the LM386 "Low Voltage Audio Power Amplifier" seems to fit the bill. Is there something specific that you would recommend?

Wrong.
The LM386 is just another power amp. You already have a much better one. Op amps are easy to use. Once you've used one you'll get hooked and use them for everything. They are so versatile. I'll post a link for you later.

"Wrong.
The LM386 is just another power amp. You already have a much better one. Op amps are easy to use. Once you've used one you'll get hooked and use them for everything. They are so versatile. I'll post a link for you later."

  • Cool, thanks!

Also, I just solved the "noise" issue but I'm not sure why it works at all now. I removed the jumper from the ground pin of the amp going to the controller and the noise disappeared. I didn't think that I would still be able to communicate with the amp via i2c without a ground connection between the amp and the controller. Could it be that the negative terminal of the audio-in on the amp is serving as the ground connection and the jumper I removed was just redundant and created a ground loop?

Anyway, with the noise taken care of and a substantial lead on the volume issue, I think I'll have this problem solved shortly thanks to everyone's help.

It's plug and play so you don't have to worry about not knowing anything about op amps.
This is a mono amp so you need one for each channel but the best part is it has a potentiometer to allow you to adjust the gain.
It is set up as a gain of 100 but by turning the pot down you can adjust it to anything less than that. I would order one and if it works , get another one. Or just order 2. Heck , they're only $5 /each so you can't go wrong.

100x gain is rather excessive, I wouldn't bother using that board. Just get some 358s from Mouser/Digikey and some resistors to wire up your own amplifier. Sparkfun sells it too (Op-Amp - AS358P (Through-Hole) - COM-15946 - SparkFun Electronics) but it, like most components on SF, is way overpriced.

There's lots of information available about op amps. Your power gain is less than 10, so your voltage gain should be about 3 or slightly less to avoid overdriving your speaker.

You can reduce the gain as much as you want because the pot is an attenuator.

Reducing the gain from 100 to 3 is going to be quite touchy. Best to just choose your own resistors and wire up your own circuit.

Use this op amp