Author Topic: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?  (Read 11106 times)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
There are at least a couple documented cases where conducted EMI appears to reduce the RSSI of an RFM69 Moteino:
https://lowpowerlab.com/forum/index.php/topic,1008.msg6492.html#msg6492
https://lowpowerlab.com/forum/index.php/topic,1516.msg10695.html#msg10695

It's possible that other Moteino users are being affected by it but just aren't aware of it.  The first case is a Pi being interfaced to a Moteino (as in, for instance, a Pi Gateway).  The second case shows that the EMI could be coming in over AC ground from a random device that you may not have even thought about.  So, for those who might care, what's the best way to isolate an RFM69 Moteino from the issue?

The RFM69 on my Moteino is set at the 902-928Mhz frequency.  I don't know if other frequencies may be playing a role in affecting the RSSI on my Moteino, but  my current hypothesis is to mitigate conducted EMI at that frequency.  I did some hunting for a common mode choke, and the following seemed the best that I could find that was in-stock at quantity 1:
http://www.digikey.com/product-detail/en/CM0805A371R-10/240-2571-1-ND/1236451
It's surface mount and just 99 cents for quantity 1 on Digikey.  Attached is the impedence vs frequency plot.  C is the common mode curve.  N is the normal mode curve.  If you find or know of something better, please post.

I haven't attempted anything like this before, but my tentative plan is to use one of the above common mode choke on the power and ground line feeding the Moteino, and then use optoisolators for Tx, Rx, and DST if the Moteino is interfaced to another device, like a Pi Gateway or whatever.  I'm unsure, but maybe an alternative would be to use 4 of the chokes, with GND being the return line on all of them (?).  Some chokes can accommodate more than 2 lines, but I didn't get far with finding one that had good parameters.
« Last Edit: January 13, 2016, 03:42:30 PM by WhiteHare »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #1 on: January 14, 2016, 04:36:59 AM »
I stumbled across the following thread, which describes what *might* be another instance:  https://lowpowerlab.com/forum/index.php/topic,1207.msg7949.html#msg7949
In his case, he found that connecting Moteino ground to Earth ground made the problem go away.

If it works, connecting Moteino ground to Earth ground may well be the simplest and easiest remedy.  Therefore, assuming it works, are there any good reasons *not* to do that?

joelucid

  • Hero Member
  • *****
  • Posts: 867
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #2 on: January 14, 2016, 05:54:29 AM »
Interesting. When I tested the low pass filter I didn't really get any quality results so I didn't post yet. I do get the periodic Rssi reduction when the moteino is in the Pi enclosure. When I moved it out on a breadboard to add the filter at first nothing seemed to improve. I connected a scope and the problem was gone. For a time I could reproduce the issue going away exactly when scope ground was connected.

However in the end the issue was gone even without scope. But immediately reappeared when I put the Moteino in the enclosure again.

As I said too confusing to even talk about by itself - but given the ground connection I thought I'd mention it. Unfortunately I'm too busy right now for further tests.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #3 on: January 14, 2016, 11:45:25 AM »
No worries.  Thanks for the update.   :)

Boy, where are the EE's on this forum when you need them?  Seems like when basic 101 topics like this come up, they drop into perpetual lurk mode.   ::)

Anyhow, rather than directly connecting to earth ground I'm beginning to develop the impression that using a connection to earth ground that's low impedance only at high frequencies is a more conservative way to go.  However, given the already mentioned deficit of tips or guidance from any EE's, I've unfortunately got more reading to do.

Also, forget building your own low-pass filter out of discrete parts when you can buy compact, high-attenuation 3rd-order low pass filters on Digikey for 30 cents that are already nicely characterized for you.  Example:  http://www.digikey.com/product-search/en?vendor=0&keywords=m9936ct-nd  It can even handle 5 amps, so definitely no stress at the currents we'd be using.
« Last Edit: January 14, 2016, 11:51:03 AM by WhiteHare »

oric_dan

  • Jr. Member
  • **
  • Posts: 64
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #4 on: January 14, 2016, 03:43:46 PM »
Quote
Boy, where are the EE's on this forum when you need them?  Seems like when basic 101 topics like this come up, they drop into perpetual lurk mode.
FWIW, don't underestimate the difficulty of this problem, :-). RF is magic, and guys who do that tend to be rather specialized, and with deep knowledge. I doubt many guys with EE degrees [like me] have any deep experience in this area. I've done consulting with embedded systems in nasty industrial environments, and EMI/ESD problems tend to tie people in knots, and can take a long time to fix. There isn't ever just "one" magic bullet that fixes everything. It's a systems-level problem that usually takes multiple fixes in various places. So, don't think it's an especially trivial [Basic 101] problem to solve. There are too many variables.

What you've got here are 2 devices interacting with each other at close range, and neither of which is specifically designed for such operation. I imagine there are a few things you can do to help mitigate the problem, like power line filters and shielding, but you'd likely need an RF "expert" to really deal with it in a comprehensive way. In any case, I'd say try the more obvious things on the list, like you're already doing, and see what results you get.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6403
  • Country: us
    • LowPowerLab
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #5 on: January 14, 2016, 04:06:17 PM »
Boy, where are the EE's on this forum when you need them?  Seems like when basic 101 topics like this come up, they drop into perpetual lurk mode.   ::)

FWIW, don't underestimate the difficulty of this problem, :-). RF is magic, and guys who do that tend to be rather specialized, and with deep knowledge. I doubt many guys with EE degrees [like me] have any deep experience in this area.

+1 oric_dan
To say that EE/CSE guys are automatically supposed to have RF under their 101 belt is a bit of an overstatement.
Hardware is hard in general, and RF is the next order of magnitude harder.

oric_dan

  • Jr. Member
  • **
  • Posts: 64
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #6 on: January 14, 2016, 05:06:18 PM »
RF/high-speed analog/digital design is really more art than science or engineering. How's about "Black Magic". See the book, 384 pages of deep do-do. I'd say people learn this area mostly via direct experience, far beyond anything taught in schools.
http://www.amazon.com/High-Speed-Digital-Design-Handbook/dp/0133957241

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6403
  • Country: us
    • LowPowerLab
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #7 on: January 14, 2016, 07:01:44 PM »
Another excellent book on signal integrity is this: http://www.amazon.com/Signal-Power-Integrity-Simplified-2nd/dp/0132349795/

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #8 on: January 15, 2016, 11:30:18 AM »
Another excellent book on signal integrity is this: http://www.amazon.com/Signal-Power-Integrity-Simplified-2nd/dp/0132349795/

Thanks for the pointer.  I read the first sample chapter online, and it was a lot more approachable than I had expected.  It claims "Once we identify the root cause of the noise associated with each of these four families of problems, the general solution for finding and fixing the problems in each family will become obvious."

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #9 on: January 15, 2016, 11:42:06 AM »
Anyhow, as a brute force method, maybe connecting a Pi to a Moteino through a USB isolator would solve the issue.  There are a number of different models, with prices ranging from $30 to around $120.  I have no idea which might be the best, but the price itself is perhaps justifiable when you consider that the above book is $90.

On the other hand, when you add in the Pi cost, maybe instead just connecting to a PC is really the best "known solution."   ;)
« Last Edit: January 15, 2016, 11:50:23 AM by WhiteHare »

oric_dan

  • Jr. Member
  • **
  • Posts: 64
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #10 on: January 15, 2016, 02:09:09 PM »
The Bogatin book looks pretty good, and you can begin to see the complication here. The guy has PhD, 30-years experience in the specific area, and 300 publications, plus the book is 587 pages.

That being said, it's certainly possible that a few interventions will help the problem greatly. There are at least 3 means of interference:

- conductive - via direct wiring, where inline filters should help.

- inductive - short-range pickup due to wiring loops, such as connecting everything using silly Arduino jumper wires, and where the solution is to shorten the wires, use twisted pair to reduce the loop inductance, use shielded wires, use differential-signalling, etc.

- radiative - direct electromagnetic transmission at high-frequencies, and where shielding and physical separation are the first steps, followed by hi-frequency filters on I/O lines.

The problems also get compounded when you have signal wires coming to I/O pins via high-impedance pathways, eg from non-terminated open-switches, as they act like antennas for picking up noise. So, it's best to keep signal pathways low-impedance, eg always have moderately low-value terminating Rs to gnd on I/O pins.

As you'll notice, our Arduino and RPi boards essentially have none of these features designed in.

EDIT: forgot to mention, the guy has a website with probably a lot of useful information (unfortunately, the place is all about making $$$):
  http://www.bethesignal.com/bogatin/
You can see the topics he covers here:
  http://www.bethesignal.com/bogatin/product_info.php?cPath=88&products_id=833
« Last Edit: January 15, 2016, 02:20:24 PM by oric_dan »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #11 on: January 15, 2016, 03:15:55 PM »
Maybe it's more complete than what's in his 2010 book.  For instance, rather than four families of problems in the passage I quoted, now he's talking about six: "EPSI-01-40 The Six Families of SI Problems"



As you'll notice, our Arduino and RPi boards essentially have none of these features designed in.


Yes, and that could spell more opportunity for Felix if he wanted to sell solutions that were even further differentiated by being even further hardened against EMI/RFI.  Since the length and quality of the signal path matters, it may be nearly impossible for the RFM69 to remain unimpaired, to one degree or another, by EMI/RFI if just using regular arduino gear connected to an RFM69 using dupont jumper wires on a breadboard or with similarly cruddy connections.

So, it's best to keep signal pathways low-impedance, eg always have moderately low-value terminating Rs to gnd on I/O pins.

So, does that mean from an EMI/RFI standpoint that as standard procedure *all* unused pins should be connected to ground, each with its own dedicated resistor (220 Ohm)?
« Last Edit: January 15, 2016, 03:20:06 PM by WhiteHare »

oric_dan

  • Jr. Member
  • **
  • Posts: 64
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #12 on: January 15, 2016, 03:46:03 PM »
His 6 families on this page refer more to how to layout pcbs so you get good integrity for signals traveling "within" the pcb itself. I was referring mainly to control of EMI from off-board, and "between" different boards.
https://www.bethesignal.com/bogatin/epsi0140-families-problems-p-837.html?content=curriculum
- PDN apparently refers to Power Distribution network.
https://www.google.com/search?q=pdn+design
- the idea is, if you route the power and signal traces poorly, then you end up with inductive loops, like I mentioned, and present on the board itself. So, for instance, digital spike noise will be transmitted over into analog areas and produce a lot of ADC pickup noise, etc.
https://www.google.com/search?q=pcb+ground+loops&source=lnms&tbm=isch

Quote
does that mean from an EMI/RFI standpoint that as standard procedure *all* unused pins should be connected to ground, each with its own dedicated resistor (220 Ohm)?
Some people advocate that, but I was mainly referring to pins that have signals being brought to them via wires from off-board. Those wires are simply antennas.

For background info, Ruggeduino actually sells boards with a lot of protection built-in. More than I [personally] think is necessary for most Arduino applications. It's useful information in general, but also doesn't have a lot to do with the specific sort of EMI problems being discussed here.
http://www.rugged-circuits.com/ruggeduino/
http://www.rugged-circuits.com/10-ways-to-destroy-an-arduino

EDIT:
Revisiting your 220ohm R value, that wouldn't be a proper termination [ie, pulldown] as I was referring to. The pulldown basically gives a low impedance pathway to ground for external noise coming in via long signal pathway wires, better than having floating pins. You would probably want to use values here in the range of 1-2K minimum, up to 5-10K maximum. 220R would normally be too low for a pulldown.

However, it's not too uncommon for people to use 220-330R values for "series" R's in the I/O lines, to help protect against short-circuit and over-voltage protection. I have these myself on all of my own pcbs. You can see these on my Tredici-1284 board near the upper headers. I also have them in the FTDI Rx,Tx lines, and in the ADC channels. There is also a grounded bussed R-network right next to pins 31-40 on the chip, to create voltage-dividers on all of the ADC pins, so I can handle large voltages with the ADC.
https://lowpowerlab.com/forum/index.php/topic,1516.msg10573.html#msg10573
« Last Edit: January 15, 2016, 04:05:39 PM by oric_dan »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #13 on: January 15, 2016, 06:13:08 PM »
Another seemingly related thread: https://lowpowerlab.com/forum/index.php/topic,195.msg790.html#msg790
jgilbert appears to be reporting that the noise floor increases by 15-20dB when his Pi is turned on.  In contrast, JoeLucid reports that RSSI decreases by 15-20 on received packets in a similar setup.  *If* the automatic RSSI calibration uses the noise floor as the reference for RSSI (?), then would that explain what Joe observed?

Also, is it fair to say that jgilbert's dataset shows the actual link budget is reduced by 15-20dB when his Pi is online?  i.e. It's not just a perceived reduction, but an actual reduction?

[Edit: jgilbert doesn't show enough of the code that surrounds his call to readRSSI for me to know for certain, but I'm assuming he was operating the RFM69 in continuous mode, rather than packet mode.  Is that the proper way to do it?  Plainly, the packet mode isn't going to tell, because the datasheet says that measures the RSSI during the preamble.]

[Edit2: At least from my point of view, measuring whether there is a change in the noise floor seen by the RFM69 radio is the next step in deciding whether this is a significant problem or just a problem that appears worse than it is.  I'd take jgilbert's dataset as at least prima facie evidence that it's the former not the latter.  Has anyone here drawn a different conclusion?]
« Last Edit: January 15, 2016, 07:41:15 PM by WhiteHare »

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Best way to isolate/mitigate conducted EMI affecting an RFM69 Moteino?
« Reply #14 on: January 17, 2016, 12:29:49 AM »
I've tested the following, and it appears to implement Perky's clever idea for getting a stream of real-time RSSI without needing to switch to continuous mode and without needing to receive packets. 

Add the following into your main loop to print out a baseline stream of RSSI :

Code: [Select]
  radio.writeReg(REG_OPMODE, (radio.readReg(REG_OPMODE) & 0xE3) | RF_OPMODE_STANDBY);  //Put RFM69 into standby-mode
  radio.writeReg(REG_RSSITHRESH, 0xFF);  //set RSSI threshhold as low as possible
  radio.writeReg(REG_OPMODE, (radio.readReg(REG_OPMODE) & 0xE3) | RF_OPMODE_RECEIVER);  //Put RFM69 into receive-mode
  Serial.print("   [RX_RSSI:");Serial.print(radio.readRSSI());Serial.println("]");

You will need the following in order to compile:
Code: [Select]
#include <RFM69registers.h>

If you wish, you can drop the above into the gateway example code.  It assumes you already initialized your radio to how you want it (frequency, bandwidth, etc.) in setup.  In setup, you'll want to set your serial baudrate as high as you can.

If you can do better, feel free to post.
« Last Edit: January 17, 2016, 01:01:48 AM by WhiteHare »