Author Topic: MCU: How to deal with common mode noise on input pin?  (Read 9785 times)

0 Members and 1 Guest are viewing this topic.

Offline Christe4nM

  • Supporter
  • ****
  • Posts: 252
  • Country: nl
Re: MCU: How to deal with common mode noise on input pin?
« Reply #25 on: March 01, 2017, 06:42:14 pm »
For interference to happen you need 1) a source 2) a coupling path and 3) a receptor/victim. To mitigate the problem: Make sure the source becomes quiet/silent. Eliminate possible coupling paths. Immunise the victim circuit.

Here are some thoughts that came up. I don’t pretend to know how or what exactly, but this is where I’d start:

1) The source in this case is very likely the switch-mode power supply. In any case, it completely lacks any kind of filtering:
- There is no common mode (CM) choke or better capacitor-CM choke-capacitor filter on the mains side. This means all kinds of unwanted RF easily enters the mains cables, which in turn are quite good at becoming an antenna for this kind of signals. This is your first likely source of conducted and radiated noise.
- There is no proper output filter on the DC side; there is only the L-C circuit of the converter. That alone will not do at all. Again, you need at least an C-L-C filter, but rather a C-CM choke-C filter. This filter on the DC output should prevent conducted noise to enter your wires, which in turn prevents conducted noise to become radiated noise.
- That the noise is measured at about 10MHz and maybe the switching frequency of the supply is way below that doesn’t say anything. The noise generated by the supply if probably broadband from 10’s of kHz into the GHz. It just so happens that you pick up this frequency content. Then again, also look around the lab for possible sources.
- You could try to put ferrite clamps around the input and output wires of the supply. Alternatively try looping them a few turns through a toroid ferrite core. However, this is often done as last resort.

2) Coupling path(s)
There are multiple possible coupling paths in this case:
- The wires between your supply and your (bread)board, as well as your scope probes. They are relatively long, and thereby great for picking up radiated noise.
- The lack of grounding of your board: it should either be completely floating OR board ground connected to mains earth through as low impedance connection as possible. Instead you have a bit of both: your USB cable to your laptop/pc provides a path to mains earth, albeit one with quite some impedance. Any unwanted, coupled-in, noise currents returning over this path and thereby create a noise voltage. The rest of the circuit is floating, but becomes referenced to mains earth when you touch it. It is then that you are providing another path to mains earth, and again a bad one, so the existing noise starts to appear as a noise voltage.
- I’d recommend to connect only two wires between your supply and your (bread)board: DC positive and DC negative/gnd. Twist those together so they become coupled to each other and in turn a bad antenna/receptor. Then on your board place a good filter (C-L-C for example) and make sure you only take power from that ‘new’ supply point, which should be clean(er). I’d also recommend to connect your circuit’s DC ground to mains earth. (Do remember that you DC circuit is now no longer floating, but mains earth referenced.)

3) A receptor/victim
The Arduino board is quite badly laid out when it comes to proper grounding IMHO. The best way to connect a GPIO to any input is with the signal running right next to its return conductor. On a PCB this means running right over an unbroken ground plane. With wires you’d do best to twist the ground connector together with the signal wire. Ground loops are no problem if everything is properly grounded. Noise currents will then be able to take the shortest route home, and not go through parts of your circuit where they turn into interference.
- Every wire going off your board needs to be filtered for RF, every single one. This to make sure outside noise stays out, and inside noise stays in. Start with a small value capacitor between signal and circuit ground right at every off-board connector.
 
The following users thanked this post: ranger81

Offline ranger81Topic starter

  • Contributor
  • Posts: 16
  • Country: de
Re: MCU: How to deal with common mode noise on input pin?
« Reply #26 on: March 02, 2017, 05:50:01 am »
I'm going to create a small pcb which is attached between the Sonoff board and the sensor with the attached circuit for protecting my MCU input. Is there anything to change?

I moved the series resistor 1k in front of the clamping Schottky diodes. Initially I had it after the diodes but the scope was still showing spikes up to 4.6v, so I moved the resistor in front of the clamping diodes and now the "spikes" are within the supply voltage. I guess this is correct?

Thank you all for your support!

 

Offline S13

  • Contributor
  • Posts: 45
  • Country: nl
Re: MCU: How to deal with common mode noise on input pin?
« Reply #27 on: March 02, 2017, 08:27:44 am »
Moving the resistor in front of the clamping diodes does make the clamping more efficient as you have noticed. Nice to see you have a low pass filter in there as well. Its always good practice to filter out any unnecessary frequency components, especially higher frequencies since they cause the most trouble and interference.

Just a fyi, there are so many variations on input protection, but this is a good starting point. There are other options like ferrite beads / chokes, tvs diodes etc which can also provide filtering and protection (also at higher frequencies) but since your application is a very low frequency interface what you have now should be a nice setup.
 
The following users thanked this post: ranger81


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf