Noise on audio amplifier for Arduino (suspected to be related to digital circuit)

Thread Starter

Fede Raimondo 1

Joined Jul 23, 2018
3
Hi everyone!

I am currently developing a prototype for a device based on an Arduino Due. My background is in computer sciences, so my knowledge on electronics is quite limited. And currently I am facing a blocking problem in this development.

I have designed and printed a PCB that includes a stereo analog amplifier (LM4808) and a MicroSD Shield mounted on top of an Arduino Due board (the schematic for the amplifier circuit part of the PCB is attached). The idea is to be able to play WAV files from a MicroSD card. After I finally assembled the amp and SD shield in the PCB, I tested the sound and found that there was a significant amount of noise.

First I checked for software issues, and I can assure that it's not a problem, as the whole playing procedure is adapted from a previous version working with an Arduino Zero and a LM386 amplifier (mono).

I also checked generating a sinusoidal wave (thus not using the SD card): the noise disappears and the oscilloscope shows a perfectly well synchronised wave at the various testing frequencies.

The problem arises when I do use the SD card. I suspect that it's some kind of isolation problem between the digital circuit (SPI for SD card reader) and the analog circuit (amp). When I touch with my hand the CLK (clock) signal of the SPI bus, the noise is somehow modulated. In a non-pcb version that I tested before printing, when the SPI wires were close to the AMP, there was more noise. In a previous design (Arduino Zero and LM386), this noise disappeared when I printed the PCB, but it's not the case in this situation.

I am currently out of clues on how to proceed. My fear is that I will continue to print different PCBs with no significant changes to try to isolate this noise by changing the routing, positions and adding ground planes. Can someone suggest me the proper way to proceed in this case?

I am attaching the parts of the schematic related to the amplifier, the part of the eagle board design and an image on the circuits mounted on the PCB. The PCB includes several other components, but there are mostly TTL lines to control input and output. Currently, no other component is mounted on the PCB but the ones in the image.

Any help will be greatly appreciated.

Thanks!


sch_amp.pngpcb_des.pngpcb.jpg
 

Attachments

crutschow

Joined Mar 14, 2008
23,724
You are experiencing a common problem -- digital noise loves to get into analog circuits.
To minimize that, the circuit needs isolation of grounds and power supplies, and routing of all digital signals away from the analog circuits.

The analog and digital grounds (separate ground planes preferred) should be completely separate and connected at only one spot (single-point ground).
The best place for that single point is likely where the digital signals are connected to the analog circuit.

Also the digital and analog power supplies should be separate.
If there is only one supply, then the analog and digital sides should be isolated with a large electrolytic capacitor on each side, and a 100nF ceramic capacitor across each analog and digital IC, along with a ferrite bead inductance in series with each side supply output.

Any digital signal lines with active signals, should be keep well away from the analog input lines.
If the signals must cross, do so at right angles. Avoid parallel runs.

Doing all that is no guarantee that the digital noise won't get into the analog, but it should help.
 

Thread Starter

Fede Raimondo 1

Joined Jul 23, 2018
3
First of all, thank you very much for your help.

You are experiencing a common problem -- digital noise loves to get into analog circuits.
To minimize that, the circuit needs isolation of grounds and power supplies, and routing of all digital signals away from the analog circuits.

The analog and digital grounds (separate ground planes preferred) should be completely separate and connected at only one spot (single-point ground).
The best place for that single point is likely where the digital signals are connected to the analog circuit.
I have an issue with that, since the amplifier is on the DAC outputs of the Arduino Due. The device is powered by an external battery with a regulator connected to two pins on the PCB (the yellow circle on the attached image). I have only one VCC option to power the Arduino, but there are 4 ground connections (purple circles). The question is where to connect the ground planes. With my little knowledge, but from what I read, I would make two planes, on that covers the entire Arduino area and connects both 4 grounds pins, and another plane covering the amplifier circuit area, that connects to the GND pin next to the Vin pin. Will you recommend this?

grounds.png

Also the digital and analog power supplies should be separate.
If there is only one supply, then the analog and digital sides should be isolated with a large electrolytic capacitor on each side, and a 100nF ceramic capacitor across each analog and digital IC, along with a ferrite bead inductance in series with each side supply output.
Indeed I only have one supply. I placed a 100nf capacitor for the amp (CS, bottom right of the image) but I ended up soldering an electrolytic one instead of ceramic. The microsd board uses a 3.3V logic and has a 10uF decoupling capacitor on the 3.3v line. The VCC (+5V) of the microsd board is not connected as all the logic is done using 3.3v and the voltage regulator of the microsd board is bypassed.

So in the new version of the PCB (attached schematic), I am placing a large electrolytic in parallel to the 100nf ceramic one, and duplicating the circuit for the analog (amplifier) and digital (Arduino) planes. My questions now are: how large the capacitors CA and CD? 100uf? and which value for the inductance (L1).

isolated.png

Any digital signal lines with active signals, should be keep well away from the analog input lines.
If the signals must cross, do so at right angles. Avoid parallel runs.

Doing all that is no guarantee that the digital noise won't get into the analog, but it should help.
I did try to not have any analog and digital lines close to each other. I think that part is covered.

Thanks again for your help!
 

danadak

Joined Mar 10, 2018
3,682
Also pay particular attention to Capacitor technology being used for
bypass applications. Read datasheets, not all "like" parts perform
the same.

upload_2018-7-24_6-57-46.jpeg

And then PCB layout as mentioned prior, very important.

http://www.cypress.com/documentation/application-notes/an57821-psoc-3-psoc-4-and-psoc-5lp-mixed-signal-circuit-board-layout

http://www.analog.com/en/analog-dialogue/articles/high-speed-printed-circuit-board-layout.html

http://www.analog.com/en/education/education-library/webcasts/fun-pcb-layout.html


Regards, Dana.
 

Thread Starter

Fede Raimondo 1

Joined Jul 23, 2018
3
Thanks Dana!

I went through those links. Although I did not get everything, I got an idea on how to do it, and what are the good practices when routing the amp analog circuits.

So now I added a ground plane and modified the circuit. I am adding a 0.1uF ceramic capacitor and 10uF tantalum capacitor for decoupling both analog and digital VCC. In between, a ferrite bead. You can see the image attached. Is this the correct way of placing the ground planes and connecting them?

new_route.png

Now my problem arises on which ferrite bead to choose. The SPI clock of the Arduino operates at 50 Mhz. The Arduino operates at 84 Mhz, and the analog circuit is playing audio at 44.1 Khz.

I guess what I need to suppress is the digital frequencies. I found two ferrite beads that might fulfil this purposes:

https://www.mouser.fr/datasheet/2/445/7427502-217965.pdf
https://www.mouser.fr/datasheet/2/445/74275223-710056.pdf

I'm more inclined for the second one. Any suggestion?
 
Top