Go Down

Topic: [Solved] Noise and low volume Issues with audio amplifier. (Read 30491 times) previous topic - next topic

Snowman815901

Jun 22, 2014, 02:45 am Last Edit: Jul 14, 2014, 08:41 pm by Snowman815901 Reason: 1
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 (https://www.adafruit.com/products/1712)
2x - 3" 4 Ohm 3 Watt speakers from Adafruit (https://www.adafruit.com/product/1314)

in my project for:

1x MAX9744 20w amplifier from Adafruit(https://www.adafruit.com/products/1752)
2x - 20W 4 Ohm Full Range Speakers from Adafruit (https://www.adafruit.com/product/1732)

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. (https://www.sparkfun.com/products/10587) 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.

Snowman815901

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!

knut_ny

#2
Jun 22, 2014, 03:55 am Last Edit: Jun 22, 2014, 03:59 am by knut_ny Reason: 1
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
Ny

raschemmel

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.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Snowman815901

" 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.

knut_ny

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)
Ny

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)
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

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)
Ny

Snowman815901


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.


..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.

raschemmel

#9
Jun 22, 2014, 04:16 pm Last Edit: Jun 22, 2014, 06:15 pm by raschemmel Reason: 1
[EDIT]
(previous comment deleted. see below)

Quote
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!   


Quote
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 ?
Quote
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.   
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Jiggy-Ninja

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.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

raschemmel

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)
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Snowman815901

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?


raschemmel

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.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Snowman815901

"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.

Go Up