dckornbluh
Posts: 28
Joined: Fri Mar 03, 2017 9:31 pm
Location: Seattle, WA

Need advice re: shielded serial cable

Mon Apr 19, 2021 2:53 pm

I have a pi 3B+ running in a very noisy environment. The pi is connected to another computer via a foot long 4-wire serial cable. The serial protocol uses a checksum and does retries of corrupt messages. This works, but I'd like to reduce the number of retries by using a shielded cable.

The shielded cable needs to be grounded on both ends, right? I was thinking about grounding to an available GPIO ground pin, but I'm not sure if the noise translates to voltage > 3.3V. Although, one of the 4 wires in the serial cable is also a ground, and, without a shielded cable, I haven't smoked a pi yet. What's the right way to do this?

pylo
Posts: 5
Joined: Fri Apr 23, 2021 8:08 pm

Re: Need advice re: shielded serial cable

Fri Apr 23, 2021 8:43 pm

Judging from your question, I assume you don't have a proper metal case serving as a shield, you only have the circuit grounds.

1) Don't connect your cable shield to ground on both ends, otherwise it will simply take over the role of your ground signal, which is not what you want. Connect the shield to ground only on the host end directly.

2) On the device end, either do not connect at all, or better, connect to ground over a high-valued resistor (like 1Meg). This will prevent the cable shield from floating if the shield isn't connected on the host end for any reason.

3) You can optionally connect a filtering capacitor in parallel to this resistor. But it is probably more important that the ground side of the resistor is connected at a "quiet" place to your board's ground.

4) Shielding relies not only on your shield completely (360°) encircling your cable, but equally important, also on completely (360°) encircling your connectors. Meaning your results could be limited if you don't have the proper connectors.

5) Do you know for sure what the reason for your corrupted data is? Could it be it has to do with ground loops or -offsets? Could it be it is noise coupling not from air, but from the host or from the device? To eliminate most of these problems, try using a galvanically isolated serial connection.

6) Alternatively to all the above, you could try leading most of the cable length over USB, then using an isolated serial converter, and then going only a short distance over the serial cable. USB having differential data lines, it is much more robust to noise. I can recommend the μArt as a converter. I assume you are not using RS-232, because with its voltage levels it is unlikely you'd be having issues at this distance.
Last edited by pylo on Fri Apr 23, 2021 9:45 pm, edited 1 time in total.

jayben
Posts: 251
Joined: Mon Aug 19, 2019 9:56 pm

Re: Need advice re: shielded serial cable

Mon Apr 26, 2021 1:03 pm

If a one-foot-long serial cable is giving you problems, then the RF field strength of the interference must be extremely high, or more likely, the serial cable isn't the real problem. The interference could well be penetrating directly into the Pi or the other computer (maybe via the power supply, or other cabling) in which case it doesn't matter how much you screen the serial cable.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11054
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Need advice re: shielded serial cable

Mon Apr 26, 2021 1:39 pm

This was the subject of a thread only last week - viewtopic.php?f=63&t=310091
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
B.Goode
Posts: 11867
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Need advice re: shielded serial cable

Mon Apr 26, 2021 2:57 pm

6by9 wrote:
Mon Apr 26, 2021 1:39 pm
This was the subject of a thread only last week - viewtopic.php?f=63&t=310091


Fascinating -

Last week:
My pi 3B+ is running next to a compressor that makes a lot of RFI and EMI. It's connected to another computer via a foot long 4-wire serial cable. The serial protocol uses a checksum and retries messages that get back a NAK. This works, but I'd like to reduce the number of retries by using a shielded cable.
This post:
I have a pi 3B+ running in a very noisy environment. The pi is connected to another computer via a foot long 4-wire serial cable. The serial protocol uses a checksum and does retries of corrupt messages. This works, but I'd like to reduce the number of retries by using a shielded cable.

User avatar
DougieLawson
Posts: 41202
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Need advice re: shielded serial cable

Mon Apr 26, 2021 4:06 pm

B.Goode wrote:
Mon Apr 26, 2021 2:57 pm
6by9 wrote:
Mon Apr 26, 2021 1:39 pm
This was the subject of a thread only last week - viewtopic.php?f=63&t=310091


Fascinating -

Last week:
My pi 3B+ is running next to a compressor that makes a lot of RFI and EMI. It's connected to another computer via a foot long 4-wire serial cable. The serial protocol uses a checksum and retries messages that get back a NAK. This works, but I'd like to reduce the number of retries by using a shielded cable.
This post:
I have a pi 3B+ running in a very noisy environment. The pi is connected to another computer via a foot long 4-wire serial cable. The serial protocol uses a checksum and does retries of corrupt messages. This works, but I'd like to reduce the number of retries by using a shielded cable.
One or both are spammers.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11054
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Need advice re: shielded serial cable

Mon Apr 26, 2021 4:20 pm

DougieLawson wrote:
Mon Apr 26, 2021 4:06 pm
One or both are spammers.
Quite possibly, but seeing as nothing untoward has been done so far, it would be harsh to take action against either of them.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
DougieLawson
Posts: 41202
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Need advice re: shielded serial cable

Mon Apr 26, 2021 4:25 pm

6by9 wrote:
Mon Apr 26, 2021 4:20 pm
DougieLawson wrote:
Mon Apr 26, 2021 4:06 pm
One or both are spammers.
Quite possibly, but seeing as nothing untoward has been done so far, it would be harsh to take action against either of them.
If it were my forum I'd ban both and delete both threads. Then block their spammer IP address(es).
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Return to “Interfacing (DSI, CSI, I2C, etc.)”