Crackling sound from speaker connected to arduino

hello there,

Except for the audio file, there is a sizzling and high-pitched sound from the speaker I connected to the arduino through the amplifier. how can i solve this problem

the materials i use :
arduino mega
pam8610 amplifier
10W 4ohm speaker

audio file properties:
16Khz, 8 Bit, Mono Wav file

waiting for your help. Thanks!

Since it is a two channel amplifier, what do you have the second channel connected to? Have you shorted the input to ground to see if the sound comes from the Arduino or from the amp, itself? Do you have all the input connections far away form the power connections and the speaker connections?
Paul

Please tell us which Arduino board you use and show the sketch and tell us how it is connected. Can you make a recording of the sound ?

The Arduino Uno is not the right board for audio. There are libraries that are able to make sound and music, but they can have high-pitched glitches.
Are you connecting a 5V square wave to a sensitive line input of a amplifier ?
What kind of speaker is it ? Maybe the speaker is overpowered.

Hi,
1- There are two speakers connected to the amp circuit
2- No, but I connected the amp circuit to the phone and computer and tested it, the sound came out smoothly.
3- there is no idle connection. I should also mention that the speaker and arduino are fed from separate sources and the gnd lines are not combined, is it a problem?

thanks!

Try it, I have to wonder why you connected the source grounds for your other tests, but not for the Arduino.
Paul

Hi,

1- i am using arduino mega in my project
2- Unfortunately, I can't record the sound right now, but there is a high-pitched scream-like sound and sizzling.
3- I'm connecting a 12V 2A adapter to the amplifier (PAM8610). But I don't know about wavelength. ((my first arduino project with sound))

I had previously combined the TDA2030 amplifier circuit with gnd lines and tried again. There was still a sizzle

I think it is necessary to filter the arduino pwm pin before the amplifier circuit. so how do i do this

I will try again. Short the two input lines to ground and power the amplifier. Does the noise go away?
Paul

No, unfortunately it doesn't. also for the project the more i increase the speaker power the louder the noise

Ok, now, do you have the required capacitor between the Arduino pin and the amplifier input?
So, the bad sound is coming exclusively from the amplifier? With the input shorted, there is no signal from that connection. What are you using for powering the amplifier?
Paul

1- arduino directly connected to amplifier
2- no, when i connect the amplifier to phone or computer i get good sound. i only get bad sound when i connect it to arduino
3- i only get bad sound when i connect it to arduino (12V 2A)

  1. The Arduino can ONLY produce a square wave on it's pins. You are hearing all the noise from that wave form.

  2. The Arduino is not a power supply. Your amplifier likely needs more than 2A to operate properly.
    I think number 1 is the source of the problem.
    Paul

2- In the specifications of the PAM8610 Amplifier circuit, it is said that max 2A is required.

1- what will be the solution

Its likely digital noise on the 5V supply I reckon. Use better supply filtering to the amplifier module, or a separate 5V regulator for it if you have a higher voltage rail to power it. Make sure you use star-grounding layout with audio, you don't normally get away with haphazard wire routing.

The 8 bit source will also be producing spurious noise (quantization noise) that you may be able to hear and which can only be dealt with by moving to higher bit-depth.