[Resolved] Problem with audio hum when powering from arduino

Hello all, I hope you can mitigate my ignorance.

I am building a project which I need sound. To achieve this, I bought an off brand mp3 player and removed its battery and connected straight to the 3V output from an Nano. However I am having a problem with a buzzing sound coming out of the speaker (from my research it seems I have a ground loop).

EDIT
I attached the three circuits that I have tried:

Circuit 1 has a buzz, circuit 2 has a hiss, and circuit 3 sounds perfect.
Here is a soundcloud playlist where you can hear it for yourself - goo.gl/dz8RHK

Now I'd rather use only one power source if possible.

The MP3 player only draws about 15mA.

Any thoughts?

Thanks a lot!!

I'm not really following your setup, but one advice i would give you...is it possible to make out a pattern of the noise. If it is, see if it is correlated to something you're running on the arduino (the code etc). Working with high gain stuff, the operation of the chip might affect the output.

My two cents.

Then I have the mp3 player getting power from the 3.3V port on the nano,

What current is being drawn by your MP3 player. The current from the Arduino's 3v3 output is normally only about 50mA.

I also tried powering the mp3 player form it's own regulator connected to the same 9V battery, but the music doesn't play and all I hear is a buzz.

That sounds like you haven't got the grounds connected together. This would be the best way to power things yo minimise interference.

However I doubt it is a ground loop, it is probably direct pickup on the input to the amplifier.

Hey guys, thanks for the answers!

To simplify things I unplugged all the non-essentials from the arduino and uploaded a blank code.
I also updated the original post with circuit diagrams and links to soundcloud so you can hear the problem.

Thanks for the help!

This is a classic example of you needing decoupling capacitors to remove the noise from the power supply.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

In your case you need something big like a 47uF capacitor across power and ground on your MP3 player. You might even need the last circuit on that page with an inductor.

Thanks a lot Grumpy_Mike. I'm heading to my local electronics store to buy some goodies and see if it works!
Would you go with circuit 1 or 2? Bear in mind I will also add a servo, which will have it's own regulator connected directly to the battery.

I would go with circuit 2.

Ok so I tried adding a 47uF capacitor across the power and ground for the mp3 player for circuit 2, and it sort of works without noise.....the caveat is that it only plays if I do not connect the power input of the amp to ground.....if I do all I hear is a clicking noise....

I also discovered that the mp3 player can take 5V, so I connected to the same regulator as everything else, and put the 47uf across its the power output....and I got the same results as above....no noise, but it only workd when the amp is not grounded.

I also tried adding a 10mH inductor as per the diagram in the website you sent me, but then nothing worked...

I'm so confused!!!

and it sort of works without noise.....the caveat is that it only plays if I do not connect the power input of the amp to ground.

Try AC coupling the audio into the amplifier. That is use a series capacitor to connect the amp and reconnect the ground.

Grumpy_Mike:
Try AC coupling the audio into the amplifier. That is use a series capacitor to connect the amp and reconnect the ground.

I use the 47uF, and although I can now it works with ground connected, the audio became extremely low.
I also tried with a 0.1uF capacitor, but it made no difference and I still couldn't connect ground :confused:

You rearly need to do some measurements to see what is actually happening with your signal. I suppose you have not got access to an oscilloscope have you?
Not sure what to suggest without.

Unfortunately not :frowning:
Let's take a step back though....the circuit design in theory is sound right? I'm not doing something stupid?

If you have got what you put as a block diagram then you are not doing anything silly. I am assuming that your regulators have capacitors on both input and output. Maybe you could post a picture of your circuit.

HI,
what are your 3.3V and 5V regulators?
What is your AMP.
I assume you are using circuit 2.

Tom.... :slight_smile:

Grumpy_Mike:
If you have got what you put as a block diagram then you are not doing anything silly.

That is what I have....I think....I'm mostly sure.

Grumpy_Mike:
I am assuming that your regulators have capacitors on both input and output.

Do you mean when I tried de-coupling or in general? Should I add them in series or across power and ground?

Grumpy_Mike:
Maybe you could post a picture of your circuit.

I'll tidy it up as much as possible and upload a picture soon.

TomGeorge:
what are your 3.3V and 5V regulators?

http://goo.gl/l7PzMa

TomGeorge:
What is your AMP.

http://goo.gl/n0JgBd

TomGeorge:
I assume you are using circuit 2.

Yes, but I also tried with only one regulator inputting 5V to the MP3 player.

Thanks again for the help guys!

Ok, so I have attached my setup of what I thing circuit 2 is....without any capacitors.

Also, there is a video of it kinda working but not really - - YouTube

It is worth to note, that without the capacitors, if the amp ground is connected,the mp3 player goes into some sort of short and keeps restarting. If I put the capacitors, the mp3 player works regardless, but the amp still only works when ground is not connected.

Hi,
Can I suggest you get rid of the transistor 9V battery and use a decent power supply.
Can you measure the voltage of that battery when you have everything turned on and running.
They are not designed for this sort of work.
Where is the NANO?

Tom..... :slight_smile:

You see it is all down to words. You said you had a regulator but you did not say it was a regulator board. Most people here would assume you had a regulator chip.
Can you post a link to the regulators, amp and MP3 player.

It is worth to note, that without the capacitors, ......

Which capacitors are you talking about, you have two different ones, the decoupling capacitors on the supply and the AC coupling capacitors on the audio.

Yes Tom is quite right a 9V battery like that is not much good for you.

TomGeorge:
Hi,
Can I suggest you get rid of the transistor 9V battery and use a decent power supply.
Can you measure the voltage of that battery when you have everything turned on and running.
They are not designed for this sort of work.
Where is the NANO?

Tom..... :slight_smile:

So the "9V" battery I'm using has an output of 7.8V when everything is off and 7.7V when the circuit is on.

I changed that to a breadboard power supply (http://goo.gl/cgP2mf) connected to a 12V wall wart, but I get the same problem :confused:

And I removed the NANO for now, because it did not seem to be the problem and I wanted to try to simplify things as much as possible.

As I seem be be slightly over my head, I'll just describe the whole setup and maybe I can get some advice.
I am trying to build a dancing baby Groot. I need to move a servo in time with music as well as playing the music, so I will also connect a servo and then use the NANO to convert the audio input from the mp3 to an output to the servo (basically using the volume level of the music). I do not have much space in the flower pot I got for a lot of batteries, so do you think 4 AA can do the job, or should I try to get my hands on a LiPo?

Thanks again!

Sorry for my ignorance, I'm learning slowly :wink:

Grumpy_Mike:
Can you post a link to the regulators, amp and MP3 player.

Regulator - http://goo.gl/l7PzMa
Amp - http://goo.gl/n0JgBd
MP3 player - http://goo.gl/jGRVAm

Grumpy_Mike:
Which capacitors are you talking about, you have two different ones, the decoupling capacitors on the supply and the AC coupling capacitors on the audio.

I was talking about the decoupling ones (47uF)...I'll try again with both decoupling and AC coupling one (I assume 47uF is also a good value?)

Grumpy_Mike:
Yes Tom is quite right a 9V battery like that is not much good for you.

For now I'm using this connected to a 12V wall wart, and skipping the regulators altogether. I'll put decoupling capacitors before the amp and mp3 player as well as the ac coupling capacitor and report my results.