EMI causing garbled RS-232 data in inter-board communication

Thread Starter

mvElectron

Joined Aug 23, 2019
9
I'm having a problem that probably has a relatively simple solution...just not one that I'm aware of. Basically, I'm designing an add-on that makes use of a logic-level (5v) RS-232 communication port for data transfer. (This is for an already-existing commercial product, so changing the design of the already existing PCB is out of the option. No MAX232 or other chip as an option.) It's a 5v logic level signal direct from a Microchip PIC, with no buffer IC or anything on it.

The commercial product is a very high wattage power supply (easily capable of several kilowatts), so there is understandably a very large amount of EMI in the chassis. (My add-on board mounts in the chassis as well.) As would be expected, the higher the load, the more invalid data packets are encountered.
I've experimented with RS-232 speeds (as well as polarity), currently running @ 19,200 baud. (Can't go much slower than that.) RS-232 speed does not have as much of an effect as you might expect: the problem is the random "spikes" induced in the waveform, causing random false "1"s and "0"s, regardless of speed.

On my add-on, I have made use of a 74LVC2G17 (one each way) in an attempt to strengthen TX drive, and also ignore some of the noise on RX with the Schmitt trigger. I was hoping that would be the Holy Grail...but alas, there is practically no difference between having the buffer in place or completely absent.

For now, the cable is roughly 18" of 3-conductor unshielded untwisted regular wire (TX, RX, GND). Yes, a shorter wire would help...but if I can solve the problem with a longer wire, then I know it's doubly solved with a short wire!

I have experimented with wrapping several turns of the wire around a ferrite bead (seems to help some, but not enough).
Are any of the following viable options?
  1. 0.1uF capacitor from RX (input of the 74LVC2G17) to GND? Obviously, too big of a capacitor will attenuate the signal quite a bit. In a brief test, it doesn't seem to harm the RS-232 data too badly...though it does not completely eliminate the random spikes.
  2. Small ferrite beads / "inductors" in series with the connector on the add-on PCB? I recall disassembling a "VTech Precomputer Navigator" children's play laptop, and every single wire coming off of the main board had a miniature ferrite on the PCB in series with the connector's pin. Thoughts?
  3. Shielded cable? If this is the golden ticket, then that's what I'll go with. Or is it not so effective against EMI spikes?

Any other suggestions?
 

SamR

Joined Mar 19, 2019
2,412
Shielded cable is definitely the ticket. Even better is shielded cable with individually shielded twisted pairs. You didn't give the cable length. 19200baud is only good for ~30-50'. Just be sure to well ground the cable shield.
 

Thread Starter

mvElectron

Joined Aug 23, 2019
9
Roughly eighteen inches. FYI this is NOT running at RS-232 voltage levels (+/-5v or more), it's logic level (0-5v), without an RS-232 driver chip, so a maximum of 20mA drive current. (I know this is definitely not an ideal situation, but that's why I'm asking for help here!)
 

Analog Ground

Joined Apr 24, 2019
416
Since the signals are single ended and not differential, make sure there is a solid ground between the two boards. Driver and receiver need to be seeing the same ground potential. Any difference acts as noise on the signals. You could experiment by attaching the two local grounds together with a large gauge wire as short as possible. Sometimes it is a mistake to connect both boards independently back to a power supply which is often the case. Try making a direct ground connection. Shielding and grounding are your first things to look at.
 

Thread Starter

mvElectron

Joined Aug 23, 2019
9
Since the signals are single ended and not differential, make sure there is a solid ground between the two boards. Driver and receiver need to be seeing the same ground potential. Any difference acts as noise on the signals. You could experiment by attaching the two local grounds together with a large gauge wire as short as possible. Sometimes it is a mistake to connect both boards independently back to a power supply which is often the case. Try making a direct ground connection. Shielding and grounding are your first things to look at.
OK, I definitely will look into a shielded cable. Regardless of shielding status, the cable has a ground wire, so ground is connected to both boards at the same location (as well as at the low voltage supply).

Wasn't sure if ferrites/chokes or even a cap would be worthwhile endeavors, that's why I asked. Shielded cable is definitely first on the list to test now. Thanks for the input.
 

Papabravo

Joined Feb 24, 2006
14,248
OK, I definitely will look into a shielded cable. Regardless of shielding status, the cable has a ground wire, so ground is connected to both boards at the same location (as well as at the low voltage supply).

Wasn't sure if ferrites/chokes or even a cap would be worthwhile endeavors, that's why I asked. Shielded cable is definitely first on the list to test now. Thanks for the input.
If each board establishes a ground independent of you cable, then you should ONLY connect the shield to ground in one place not both. If you connect both ends you will have a ground loop witch will enhance the interference pickup. Do you understand the concept?
 

DickCappels

Joined Aug 21, 2008
6,535
Switching to differential signaling on shielded twisted pair would be high on my list of things to try for some of the reasons noted above.

Is there any chance of floating the receiver on the ground wire that comes with the signal? If the signal needs to be moved to another ground system there are ways to do that without coupling much noise between the two grounds.

If the spectrum of the spikes is way above that of the data, a two pole low pass filter somewhere above the data spectrum but well below the spectrum of the spikes might be of great help.
1596437492421.png

A common mode choke in series with the data lines and ground return is a good way of assuring that the time varying current on one conductor is equal that of the other conductor.

1596438992133.png

There is no reason to limit the common mode choke to only two windings.
1596439148057.png
 

Thread Starter

mvElectron

Joined Aug 23, 2019
9
Switching to differential signaling on shielded twisted pair would be high on my list of things to try for some of the reasons noted above.
Unfortunately, differential signaling is not an option, as a Microchip PIC only supports single-ended RS-232 on the EUSART module. Otherwise, that would be a slam-dunk solution.

Is there any chance of floating the receiver on the ground wire that comes with the signal? If the signal needs to be moved to another ground system there are ways to do that without coupling much noise between the two grounds.
Again, unfortunately not. The "receiver" board also handles several amps of lower power control, though this does not appear to be part of the issue.

If the spectrum of the spikes is way above that of the data, a two pole low pass filter somewhere above the data spectrum but well below the spectrum of the spikes might be of great help.
That might very well be what that "Precomputer Navigator" box did. Because yes, the spikes are very, very tiny--yet they are very strong in amplitude, equal to (if not greater) than the signal.
1596458079092.png
This measurement was taken directly at the connector on the receiver board. Perhaps unsurprisingly, the spikes are at the power supply's switching frequency--in this case, 24KHz. Which is very close to the 19KHz of the serial stream. With this in mind, would a low-pass filter still work?

Here's the same view with the "cursor" off. You can see the negative spike is almost as high as the positive spike later.
1596458513622.png
At 2v/div, the biggest spike is almost at -4v. The big splash is 7v peak to peak.
A small L-C low-pass filter would be very simple to implement on the receiver PCB. But with the oscilloscope views in mind, would an L-C circuit be of an advantage? And if so, could someone point me to a calculation to determine the necessary L and C values?
 

MrSoftware

Joined Oct 29, 2013
1,865
Do you have the option of adding a pair of differential-to-single ended converters, one on each end of the cable. So the devices on either end don't know the difference, but you've got a differential signal in-between. I would guess your relatively long un-shielded non-twisted cable is acting like a big antenna.
 

LesJones

Joined Jan 8, 2017
2,687
Try using an opto coupler on your receiving board. The emitter side of the coupler would ONLY be connected to the commercial unit. (You would not make a ground connection between the two units other than that made by the safety grounds.) The output side of the coupler would be referenced to the ground on your receiving unit.

Les.
 

Thread Starter

mvElectron

Joined Aug 23, 2019
9
Do you have the option of adding a pair of differential-to-single ended converters, one on each end of the cable. So the devices on either end don't know the difference, but you've got a differential signal in-between. I would guess your relatively long un-shielded non-twisted cable is acting like a big antenna.
Unfortunately no, as I am connecting to a pre-existing design (that wasn't designed for my use-case). A differential signal would be a great help, but that's off the table.

I will try a shielded cable, but if an L-C filter will also help, I'll use both ;-).
 

DickCappels

Joined Aug 21, 2008
6,535
Just in case you are not aware of this part, if you are lucky you can use one or two SN75176B differential transceivers, they are small (8 pin package) and cheap (33¢ each at my distributor).
1596466273741.png
Yes, from appearances of the spikes in your waveform the spikes are very short duration compared to a bit time. The LC filter should be able to reduce the amplitude of the noise greatly without affecting data transisions much.
 
Top