I tried to swap the signal and ground pins, a tried to swap the spi pins but always the same.
On 0% and 100% the sound quality is perfect all other state has so bad quality ![]()
Your problem is probably with your circuit layout, and lack of decoupling between the analogue circuits and digital circuits.
You should use a star ground system. That is one where the ground lines are not chained but all connected to a single point.
Also short leads are important, and don't route analogue signals close to digital ones.
Let's see both your schematic and a photo of your realisation of the schematic.
Have you put an oscilloscope on the output to see where the distortion is coming from?
My schematic looks like this:
I am surprised that you have not got AC coupling. Are you sure that your audio signal is confined in the 0 to 5V range? If not it will distort, unless you connect Vss to a -5V supply.
Can you tell me this a little more expand?
All audio signals are AC signals, that is they have positive and negative peaks with respect to the signal ground.
The way you have your circuit assumes that your AC audio signal has a superimposed DC offset level of 2.5V on it. It is most unlikely that this is the case. So you have two choices:-
-
Make the signal have a 2.5V DC offset on it by taking the ground of your audio to a fixed 2.5V signal generated by two 1K resistors forming a potential divider between +5 and 0 on the arduino. This point will have to be the ground for all subsequent audio signals.
-
Make your circuit able to cope with the negative peaks of the audio circuit by supplying a -5V supply to the Vss pin of your chip.
I know it is a big wish but could you draw down what i should do. I am not an expert, but if you draw it down i can do it. :~
The simplest is just to connect an other 5V supply. With the +ve being connected to ground and the -ve to Vss.
Do you not want to do that solution?
So I do not get the 5v from arduino? Do I need an external 5V Dc supply? Thats all?
So I do not get the 5v from arduino?
Yes you do!!!
You need ANOTHER 5V supply that will act as a -5V supply for your chip.
Ok thank you. So enought a simply 220V - 5v Dc switching power converter and do i connect the "+" to the Vdd and the "-" to the Vss?
Do I need two independent power supply for this schematic??? The Vdd comes from arduino and the other supply 5v to Vss???
This way does the only? :~
The second supply is AC or DC?
Now the powered from an USB connector.
If you read the posts I told you how to connect the extra supply. The + to ground and the - to Vss.
It should be 5V DC.
Sorry Mike but I don't realy understand. Can you complete my schematic with your suggestion?
I would be really helpful.
Hello! I draw my second schematic, but now I can see you draw your own. Thank you.
I have only some question!
Do I need two independetn power supply or can I connect it to the supply what goes to the arduino?
Can't do any crashes on my arduino if I connect 5v to the ground?
can I connect it to the supply what goes to the arduino
No think about it. If you do you willbe putting a short circuit on your supply. You need a seprate power supply, like I have been telling you all along.
Grumpy_Mike:
Last chance to understand
Now my circuit looks like you draw it. Are you sure I don't make any crash with my other part's to connect to arduino if I connect +5v to the arduino gnd pin???
You obviously do not believe me so look at this link
http://www.kpsec.freeuk.com/powersup.htm
Under the Dual Supplies section.
It shows two supplies in this case 9V with the +ve of one connected to the -ve of the other. This point is zero volts and corresponds to your arduino's ground.
The free -ve output should be connected to the Vss pin, the free +ve end (if you have a 5v supply) should be connected to the 5V on your arduino.
I did it exactly what you suggested. Now when I connect the arduino to my pc and pluged the second supply into the ac line:
The sound quality is so bad, always stay on same level, I can't switch on/off with 0 and 255 like before, and my IC is fire hot.
What happens???
