Noise/Interference through speaker?

I am wanting to learn more about how to correct or better design/plan to avoid this type of problem in the future..

so I'm posting about a project I'm playing with.. and the results, in hopes to get some feedback on not only the WHY.. but (hopefully) an easy fix for it as well. :slight_smile:

I have (more or less) an Arduino Uno and Waveshield as my 'base' unit.. (actually its a custom hybrid of the two into one board..if that is actually the root cause of this?)

When I hook up other components...or use PWM..

I can 'hear' the noise/vibe through the speaker.. (even if no audio is playing.... I can hear the 'pulse/steps' of PWM through the speaker...

I currently hooked up some MAX7219/7221 chips.. and 1 x 7-segement numeric display...

ran some default ledControl sketch that cycles through numbers/letters....

and every time the display changed... I could hear it through the speaker?

my plan is have some external PCB's made up, each with their own:

doide, regulator/decoupling caps, MAX chip (including is caps and Rset resistor)...

so they can be cascaded & ultimately controlled by the Uno/Waveshield board...

seeing as I get this interference.. how can it be 'curbed'? (blocked?) as to not have this feedback/interference/noise coming through the speaker?

Im hoping I can add something to these pcb's before I order them....

Here are the 2 boards I will be making.. and am hoping I can quickly add something to fix this problem when it comes time to put things together?

I heard 'about' things like optoisolators..etc.. (but no clue if they fit here? or anything about them) LOL

thanks!

Hello xl97, The noise is common as digital devices radiate noise over short distances. When I plug my Arduino in the Serial Port of my PC, the noise is greatly increased.

It is not recommended that you try to build a high quality audio playing device with the Arduino. For low noise, use professional gear. They have analog circuits or the digital sections use techniques as in the list of ten techniques, below.

1 The analog section will have a ground that is connected at a good place.
2 A good place will be marked as a node called GND near point 3.
3 Point 3 will be positioned according to rule 4, some modules will be distant from Due
4 Rule 4 is under study by a committee of 5 experienced consultants
5 Differential mode and common mode theory will rule the roost.
6 Optical isolation will be available
7 Decoupling capacitances will have two types, electrolytic and Polyester.
8 Metallic shield boxes will encompass some analog circuits
9 The metal will be Mu Metal
10 The simulations will include parasitic estimates and sensitivity studies.

The things that help most: Keep the analog and digital sections as isolated as possible. No parallel traces, separate PSU (at least separate in that they are isolated via ferrite beads or inductors), separate ground runs back to a common point, decouple the PSU vigorously. Keep the digital lines short, avoid 90deg turns, and run them over and/or next to ground traces or fills.

thanks for the replies..

however,.. the MAIN board is already done/completed and in use..etc...

its only the MAX7219/7221 'boards' that I'm about to get made.. that I'm asking if anything can be done to help stop this..

I have the board pretty heavily decoupled (main board)

so far I gathered:

  • user ferrite beads or inductors.. (possibly include these on the board?.. not sure what they are yet)
  • optical isolation?

not really sure how to implement either of these currently..

so I guess I cant really 'separate' analog from digital lines? (not really sure what that entails as far as design in Eagle schematic/board?)

Analog is tricky, since any fluctuation is a signal, and there's no way to distinguish noise from data. If your wave shield is done, there may be nothing you can do. Are you able to test without the MAX circuits attached? I.e., if you have just the AVR and audio circuit and no LED control, are you still getting tons of noise? If so, nothing you do on the LED board is going to fix that obviously...

I'll elaborate on some of my previous comments.

The audio portion needs to be kept as isolated from the digital parts as possible. I realize with a DAC, the delineation between digital and analog is fuzzy, so it takes some guesswork at first. Without seeing the wave shield schematic, I can only offer generalities. Most important is to maximize distance between the analog stuff and any digital traces or components, and put ground fills in between to try and couple that EMI through a return path instead of into other parts of your circuit. A ground plane on the opposite side of the board under digital traces helps too -- it lowers the inductance of the trace.

Decoupling all the digital stuff, and especially the high(er) current stuff like the LEDs, will keep those current loops short and reduce their ability to impose noise on the power rails. Having some bulk caps at the power inlet of each board, and in strategic "regions" of your circuit (near the higher-current stuff like LEDs) will provide local fulfillment of large current draws, and of course ceramic decoupling caps at each IC and near the LEDs keeps switching noise in the shortest loop possible.

Another thing you might need to do is create a high impedance to AC on the Vcc rail that feeds the audio section. An inductor does this of course, and you can put a cap behind it to create a 2nd-order filter. Really sensitive analog circuits may use 2 or more LC stages. You'll need to size the inductor according to your current demands since it will be in series with the Vcc of your analog parts. Try and keep your analog grounds from "mixing" with digital grounds, all the way back to the gnd connection if you can. If it's unavoidable, just make sure the grounds are as big, wide, and plentiful as possible.

I've never used a ferrite bead myself, so I can't say much about how you pick one. It's just a common recommendation for this type of thing. From what I've read it absorbs RF or something, probably through some form of sorcery. :expressionless:

Hi, I have to agree with SirNickity with regards to the earth layout.

separate ground runs back to a common point

If you have not done this then you will have earth currents looping around the PCB, bypassing will not completely cure the situation.
Because you are amplifying a low level signal and the noise is also low level you will have problems.
You may have to look at your PCB you have and try cutting earth loops and gathering earths to nodes.
Tom.

OK here some suggestions for careful layout to minimize issues when mixing analog and
digital.

Use separate ground planes for analog and digital, which only connect at one point(*), that point
being directly underneath your DAC (or ADC). Bring the ground line from the power supply
only to the digital side, make sure your supply is fully isolated.

The analog ground plane is connected to case ground at the analog input/output jacks only.

Keep high current and mains wiring well away from any analog areas.

The aim is to minimise currents through the analog groundplane, and to keep all digital
devices ground/supply currents well away from the analog.

Use separate linear regulators for both analog and digital supplies, probably split the digital supply
into two separate systems, one for microcontroller, one just for ADC/DAC components. Decouple
each supply to its correct ground only at the devices in question. never use a switch-mode supply
or DC-DC converter directly to an analog circuit, not even to the digital supply of the DAC/ADC components,
thats an easy way to get 100mV of noise into the system. Always a linear regulator with proper decoupling
for each supply.

And lastly use good quality components - no carbon resistors, only ADC/DACs with separate analog & digital
supply and ground.

(*) OK, this isn't possible if you have more than one ADC/DAC chip, and I don't have a clue what to do then
other than have them all close together with the ground common point.

To be more specific, metal film resistors are lower noise than carbon film. I don't think anyone is in any danger of finding any carbon composition resistors, if you do, you'll have to wipe the cobwebs off first.

hey gang-

thanks for everyones help/input..

seems to be 100% best practice would really mean a re-design of the MAIN board to include separate GND planes with 1 common point for the digital/analog lines.. (as well as all the other great suggestions on reducing noise and proper audio set-up/design)..

I suppose not much to do EXCEPT on the main board..adding other stuff to the 'daughter board' isnt going to provide much of a solution I gather. :slight_smile:

on the flip side:

a few NOOB notes when testing to eliminate false positives..

1.) when disconnecting from the FTDI cable/computer/USB hub.. it helps reduce alot of noise. (ie: dont expect true results when in a test set-up and connected to computer./FTDI/USB still

2.) SERIAL.print().... great for debugging.. (but have no place int he finished sketch)..

I didnt comment these out..and every time I printed to serial mon.... you could also hear that over the speaker.. taking these out helps reduce that noise/interference as well..

i'll probably plan on a re-design soon.. and might be posting/contacting some of you in the future. L:)

thanks

If you can, post your PCB layout while you're at it. I dunno about you guys, but when I have someone else look at my drafts (or even myself, later down the road) they always seem to spot some braindead routing decision where I should've known better. :roll_eyes:

oh I have no doubt there are mistakes-o-plenty! lol

this is a new to me.. and a 'hobby' so to speak.. I find some aspects very frustrating.. (like things you get with years of exposure & experience).. and very much enjoy other aspects, they are like puzzles. :slight_smile: lol..

my only real exposure has been Arduino based stuff..

I kind of find a goal/project.. and then work through learning different steps/skills along the way.. so the goal is really for 'learning as I work through things' so to speak.. haha..

I dont know of any or apply any design principles really.. kind of muddle my way through reading and asking.

Audio is really tough for me.. but with Adafruit Waveshield schematics and other things to peek at.. I manage along. just not as correct as they should be I guess. LOL

I'll dig it out.. but probably PM it to ya.. :slight_smile: