umisguy
Posts: 6
Joined: Sat Dec 24, 2016 5:01 pm

1+1 watt amplifier attached to 3.5mm line out interference

Sat Dec 24, 2016 5:17 pm

I am working on a project with a GPIO 10 button board , a 2.4 inch SPI TFT, and a 1+1 watt (stereo, 1 watt per channel) amplifier, powered by a 37 watt hour 2.1amp battery pack. I have all of this attached to a raspberry pi 2 , but I am getting interference in the amplified audio , which sounds like I'm hearing RF interference from the power input of the amplifier which is based on CPU / RAM / SD access / Graphics / etc activity on the pi2.
I know that the interference basically goes away when the amplifier is powered by a separate supply than the rest of the system, but that's not possible as I am not in the market to run a dual power supply portable system.
I've done research on amplifiers on the web and almost everything I've seen suggest using some circuitry to separate the amplifier from the power supply. I'm not 100% sure on this, but I'm using a 14 ohm resistor to limit the current to a 1 farad 5volt capacitor I have wired parallel to the V+ and V- inputs for the amp, so I'm not pulling ~1.13amps just to charge the capacitor , as that would max out the power supply output with everything else.

My question is, as I'm still getting interference from the power supply (I'm assuming it's due to 'dirtiness' in the common negative from being used by everything else. ) , should the resistor go on the positive or negative side between the supply voltage of the capacitor, and would using a zener (or other) diode on the negative and positive help?

if I'm entirely wrong, what would be the solution with the least amount of parts be? and how best can I build a power supply line filter to go between the 5 volt output of the battery pack to the amplifier? (at max volume the amplifier is using 400 mw of power for both left and right channels)

james-at-lo-tech
Posts: 45
Joined: Sat Oct 04, 2014 1:07 pm

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Sat Dec 24, 2016 7:56 pm

Try changing the USB supply. Apple charges have very good noise performance.

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Sat Dec 24, 2016 10:20 pm

Your 14 ohm resistor is not appropriate. The maximum dc power you can get into the amp through that from a 5 volt supply is 2.5 volts into 14 ohms which is 6.25/14 ie less than half a watt.Your amp has less than 100% efficiency so the audio power will be well under a quarter watt per channel. And are you sure you have a 1 Farad capacitor?

Ground of RPi and of amplifier need to be connected so any series decoupling must be placed in the +5 volt side.

Take the audio amp supply directly from the power pack, not from the 5 volt pins on the RPi GPIO header..

umisguy
Posts: 6
Joined: Sat Dec 24, 2016 5:01 pm

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Sat Dec 24, 2016 11:24 pm

it's not coming off the GPIO , it's coming from the main leads from the power bank , and the reason for the capacitor and resistor is the power bank could not supply the 5 volts ~1.13 amp power to charge the capacitor on top of everything else running on the pi , including the LCD panel and usb wifi adaptor ...

That's not the problem anyway, I don't need more than 400 miliamps to the amplifier. The problem is that if the amplifier is attached to the same power pack (battery pack USB charger ) , I get humongous amounts of noise (hums and frequency shifts in hums etc that sound like RF / electronic interference , possibly on the common negative 5v throughout the system) and it's often louder than the sound of whatever is coming out of the Raspberry Pi line out. I'm asking what I need in order to seperate the amplifier from the interference coming from the raspberry pi.

Edit: I will try soldering the resistor to the +5v side instead of the -5v side, and I'll thank you a ton if that solves the problem, but I can't help but feel like , on its own, this won't solve the problem. That said, I'm trying anyway, because any chance it solves the problem is better than nothing , and I'll be happy with any solution that would work , and as to the other person suggesting an apple charger : I'm running on a battery bank.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Sun Dec 25, 2016 2:30 am

umisguy wrote:it's not coming off the GPIO , it's coming from the main leads from the power bank , and the reason for the capacitor and resistor is the power bank could not supply the 5 volts ~1.13 amp power to charge the capacitor on top of everything else running on the pi , including the LCD panel and usb wifi adaptor ...

That's not the problem anyway, I don't need more than 400 miliamps to the amplifier. The problem is that if the amplifier is attached to the same power pack (battery pack USB charger ) , I get humongous amounts of noise (hums and frequency shifts in hums etc that sound like RF / electronic interference , possibly on the common negative 5v throughout the system)
First off you need to determine where the noise is coming from. The best way is likely to be starting off with the bare minimum connected (power pack and amplifier) and then add components (Pi, then wifi, screen etc.) and determine when the noise occurs. Some alternate tests to prove the noise source may be useful (if you get noise with PSU, Amp and Pi also try with a different PSU ideally mains PSU with linear regulator rather than a switching regulator).

Using a resistor and large capacitor seems like you're trying to fix the wrong problem. You would likely do better with a smaller capacitor and no resistor. If nothing else the resistor is converting a fair chunk of your battery packs energy into heat without doing anything useful with it.

In terms of dealing with the noise you probably want an inductive component in there rather than a pure resistor. Capacitors will pass high frequency AC and block DC, Inductors will do the opposite by blocking high frequency AC and passing DC. With a suitable LC circuit you can block the AC components from passing the filter (the ferrite beads you often see on signal cables are then to add inductance blocking unwanted high frequency on parts of the conductor).

umisguy
Posts: 6
Joined: Sat Dec 24, 2016 5:01 pm

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Sun Dec 25, 2016 4:04 am

mfa298 wrote:
umisguy wrote:it's not coming off the GPIO , it's coming from the main leads from the power bank , and the reason for the capacitor and resistor is the power bank could not supply the 5 volts ~1.13 amp power to charge the capacitor on top of everything else running on the pi , including the LCD panel and usb wifi adaptor ...

That's not the problem anyway, I don't need more than 400 miliamps to the amplifier. The problem is that if the amplifier is attached to the same power pack (battery pack USB charger ) , I get humongous amounts of noise (hums and frequency shifts in hums etc that sound like RF / electronic interference , possibly on the common negative 5v throughout the system)
First off you need to determine where the noise is coming from. The best way is likely to be starting off with the bare minimum connected (power pack and amplifier) and then add components (Pi, then wifi, screen etc.) and determine when the noise occurs. Some alternate tests to prove the noise source may be useful (if you get noise with PSU, Amp and Pi also try with a different PSU ideally mains PSU with linear regulator rather than a switching regulator).

Using a resistor and large capacitor seems like you're trying to fix the wrong problem. You would likely do better with a smaller capacitor and no resistor. If nothing else the resistor is converting a fair chunk of your battery packs energy into heat without doing anything useful with it.

In terms of dealing with the noise you probably want an inductive component in there rather than a pure resistor. Capacitors will pass high frequency AC and block DC, Inductors will do the opposite by blocking high frequency AC and passing DC. With a suitable LC circuit you can block the AC components from passing the filter (the ferrite beads you often see on signal cables are then to add inductance blocking unwanted high frequency on parts of the conductor).
using the amp without the pi powered, using the amp on the same power pack but nothing else powered on --- 0 or near 0 noise.
using the amp with the pi powered , but the audio input wires not attached yielded 0 or near 0 noise.
using the amp without the resistor or the capacitor , but attached to either the 1amp or 2.1 amp USB 5v leads on the power pack still produces noise with the pi on, but not with the pi off. The nature of the sound of the noise is most likely the typical noise people on youtube talk about when "attaching power to the pi and amplifier on the same rail" --- I'm just uncertain how to seperate the 2 while still using the same power pack as it is meant to be portable (think pocket size)
I have also run the amp on a wall plug with 5 volt output and it produces near 0 or 0 noise, even with the pi on (with seperate power source) , and I have run the amp powered by one 5 volt power source and connected it to the line out from my laptop , yielding ideal results.

The Screen is not something I want to disconnect from the pi as it attaches to ~12 GPIO pins and is powered via GPIO 3V3, an it seems like all I need to do is somehow separate the pi's power from the amp's power, but I don't know how to do that while having only a single power switch and within a reasonably small form factor casing. I suppose I could use a small-medium cellphone lithium ion pack and piggyback it off the main pack to keep it from discharging without recharge... I'm not precisely sure how I'd be able to do anything with that though. It sounds like it'd take more space and possibly not be any better solution than building a small power supply separation circuit --- I just have not as yet found enough data on how to properly make one with minimal expenses (I'm trying to limit my parts sourcing to desoldered diodes, resistors, capacitors , and whatnot from a dead stereo system, and whatever I have laying around)
I hope I've answered your questions. All assistance is appreciated so thank you for even asking the questions you've asked. Same goes to everyone else so far.

User avatar
davidcoton
Posts: 4909
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Mon Dec 26, 2016 10:49 pm

Read mfa298's answer again, especially the second paragraph.

You may be able to suppress the noise with small capacitors (10nF or 100nF) across the supply at either the Pi end of its supply cable, or at the amplifier itself, or both. It needs experimentation to find the right values and places. It is not a case of "bigger is better" because the secondary characteristics of the capacitors are relevant. If that fails you need an LC filter (series inductor, parallel capacitor) in the power lead close to the amplifier. They are a bit tricky to design (especially if you don't know the frequency of the interference), and guesswork may make things worse.
Signature retired

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Tue Dec 27, 2016 12:54 am

umisguy wrote:using the amp without the pi powered, using the amp on the same power pack but nothing else powered on --- 0 or near 0 noise.
using the amp with the pi powered , but the audio input wires not attached yielded 0 or near 0 noise.
using the amp without the resistor or the capacitor , but attached to either the 1amp or 2.1 amp USB 5v leads on the power pack still produces noise with the pi on, but not with the pi off.
In terms of determining where the noise comes from with a single supply those are really the only useful tests.

The other test that would be useful (although I'm not sure you can do it) would be running the Pi and amplifier from a linear power supply (rather than a switching power supply).

The significance is that a switching regulator uses high frequency switching as part of the process of providing a regulated output. This gives a small and efficient PSU but the switching could be part of the source of the noise.

More detail of the parts you've used may also be of use, alternately trying different parts may yield different results (in particular a different class of amplifier).

umisguy
Posts: 6
Joined: Sat Dec 24, 2016 5:01 pm

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Tue Dec 27, 2016 7:44 am

mfa298 wrote:
umisguy wrote:using the amp without the pi powered, using the amp on the same power pack but nothing else powered on --- 0 or near 0 noise.
using the amp with the pi powered , but the audio input wires not attached yielded 0 or near 0 noise.
using the amp without the resistor or the capacitor , but attached to either the 1amp or 2.1 amp USB 5v leads on the power pack still produces noise with the pi on, but not with the pi off.
In terms of determining where the noise comes from with a single supply those are really the only useful tests.

The other test that would be useful (although I'm not sure you can do it) would be running the Pi and amplifier from a linear power supply (rather than a switching power supply).

The significance is that a switching regulator uses high frequency switching as part of the process of providing a regulated output. This gives a small and efficient PSU but the switching could be part of the source of the noise.

More detail of the parts you've used may also be of use, alternately trying different parts may yield different results (in particular a different class of amplifier).
I have an old variable voltage DC supply that I can set to 5 volts, but the problem is that if I cannot resolve the situation while running on a battery pack, it's absolutely useless as a solution --- I appreciate any knowledge and solutions, but what I mean is that it would not apply to my goals. I'm powering from a 10 amp hour 3.7 volt Lithium ion polymer pack wired into a PCB that handles charging and voltage step up to 5 volts at 2.1 amps on one port and 5 volts at 1.0 amps on the other port.

while that may help , about ruling out a switching regulator as the culprit , the problem is that most , if not all of the noise I'm hearing is directly indicative of the noise that is reported as what happens when you amplify the audio coming out of the raspberry pi's stereo line out 1/8 inch / 3.5mm jack running on the same positive and negative 5 volts that the rest of the raspberry pi is running on. It's a varying frequency hum / buzz noise that sounds "activated" by CPU activity, a secondary hum is likely the MicroSDHC reader, another sound in the noise is likely the wifi upload and download circuitry ... I may be wrong as to the cause or source of the noise, but it seems to be more active when the pi is active and less active when the Raspberry Pi is not heavily active. Still more sound than when the Pi is off, but I think I'd be ok with minimal noise when it's at it's maximum noise level, but none of it sounds like 60hz or anything you might get from a wall jack ac/dc supply , this is definitely being generated by the Pi's board.

IF I am successful at running both the pi and the amp from the variable output power supply I have , and make low to no noise, I'll either update this , or add another reply. BUT I doubt I can go do that right this second. Again, thanks everyone for all the help so far.

umisguy
Posts: 6
Joined: Sat Dec 24, 2016 5:01 pm

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Tue Dec 27, 2016 7:51 am

davidcoton wrote:Read mfa298's answer again, especially the second paragraph.

You may be able to suppress the noise with small capacitors (10nF or 100nF) across the supply at either the Pi end of its supply cable, or at the amplifier itself, or both. It needs experimentation to find the right values and places. It is not a case of "bigger is better" because the secondary characteristics of the capacitors are relevant. If that fails you need an LC filter (series inductor, parallel capacitor) in the power lead close to the amplifier. They are a bit tricky to design (especially if you don't know the frequency of the interference), and guesswork may make things worse.
Yeah, I did pay attention to the talk about smaller capacitors , which I'm willing to try out, but I'd have to find nano farad caps first--- but that's not the bigger issue here, I mean, if that's what it needs, I'll see if I can acquire some. @ LC filter , the frequency of interference is.... multiple frequencies at varying fluctuations in the 100hz to 7khz (or so) range. The sounds of the noise seems to be active most when the Raspberry Pi is more active. In fact sudden frequency shifts in the primary noise are in tune and beat with the most notable spikes in system activity...

umisguy
Posts: 6
Joined: Sat Dec 24, 2016 5:01 pm

Re: 1+1 watt amplifier attached to 3.5mm line out interferen

Tue Dec 27, 2016 8:06 am

mfa298 wrote:
umisguy wrote:using the amp without the pi powered, using the amp on the same power pack but nothing else powered on --- 0 or near 0 noise.
using the amp with the pi powered , but the audio input wires not attached yielded 0 or near 0 noise.
using the amp without the resistor or the capacitor , but attached to either the 1amp or 2.1 amp USB 5v leads on the power pack still produces noise with the pi on, but not with the pi off.
In terms of determining where the noise comes from with a single supply those are really the only useful tests.

The other test that would be useful (although I'm not sure you can do it) would be running the Pi and amplifier from a linear power supply (rather than a switching power supply).

The significance is that a switching regulator uses high frequency switching as part of the process of providing a regulated output. This gives a small and efficient PSU but the switching could be part of the source of the noise.

More detail of the parts you've used may also be of use, alternately trying different parts may yield different results (in particular a different class of amplifier).
This is the Amplifier: http://www.amazon.com/TDA2822M-2X1W-Ste ... _3?ie=UTF8
and this is the LCD screen: http://www.amazon.com/Wrisky-240x320-Se ... _1?ie=UTF8
The screen's page says its driven by an ili9341, but I believe it's an ili9340.
I don't know (off hand) what chips / board the battery pack is wired to.

Return to “Troubleshooting”