Wiring UART components through CAT5/6

Hi,

If you wanted to connect an Arduino/ESP to a UART peripheral (e.g. a CH376 usb msc) through CAT5 or CAT6 cable, would the preferred way to do this be to pair each data line (RX and TX) with a stable line (e.g. GND or VCC)?

So, for example, could you pair the Arduino's TX with VCC and Arduino's RX with GND, and also have these same VCC and GND wires supplying power to the external UART device?

By “preferred” method, I mean the method that would reduce the chance of crosstalk and interference.

Also, for the 2 pairs or wires that are left over, is it a good idea to connect them to either GND or VCC at just 1 end?

If the cable is shielded, should the shield also get connected to GND at 1 end?

I have seen these above suggestions made for wiring SPI and I2C peripherals through CAT5/6. Would the same theory apply for UART signals, or would something different be preferred?

Source for SPI wiring suggestions through CAT5/6: SPI Bus Cable Length – nRF24 - Damogran Labs

Thanks

I would not have VCC around a signal - so I would not do the Orange one.

if I can't power the second device separately, for symmetry I would probably do VCC + GND in one pair, then TX+GND in one pair, Rx+GND in one pair and the last pair would be GND/GND.

I could also try Rx and Tx together and VCC/GND and have the two other pairs GNDed

(but I'm not a hardware guy but I was told twisting a signal cable with GND helps)

1 Like

I'd probably test the following, using an o'scope:
one pair VCC(for current)
one pair GND(for current)
one pair TX/GND(for signal integrity)
one pair RX/GND(for signal integrity)
And, I'd make sure I added a decent power filter (say, 10 uF and 0.1 uF), at the downstream end.
Using TX/RX terminology makes me think you're thinking serial.
RS485 might be a good candidate, though even there, I probably wouldn't attempt much more than, say, 10 meters, as there's a decent amount of current needed for good performance.
However, I would NOT attempt to put I2C on that cable. I2C is intended to be used within inches, not feet or meters. It's not intended for that purpose. I've heard lots of anecdotal stories of people going further, and it may work for you, but I wouldn't do it.
Don't know enough about SPI, but I suspect similar distances apply.

1 Like

Hi @J-M-L,
I disagree. For AC (signal) purposes ground and VCC look the same, the signal only sees the impedance to ground, not the DC offset, so Vcc is as good as ground for the purpose of providing a ground to the AC part of the signal. That said there really needs to be decoupling capacitors between ground and Vcc at both ends of the cable.

Yes, me. 30m no problem. Probably fine for hobby projects, not so wise if you want to manufacture the thing.

@GigaNerdTheReckoning,
This to me is one of those cases where the hobby of electronics is fun: try it and see if the results meet your needs. As it happens I am right now testing getting 1pulse per second and serial data from my attic, which is the ideal place for a GPS receiver as it can see the sky easily, down to a store room, which has a much more constant temperature throughout the year.

2 Likes

OK understood. makes sense actually

Thanks, everyone. Luckily, I wasn't really intending to go any serious distance anyway. Just thought that cat cable might be a neat idea to reduce a rats nest of wiring in a project enclosure.

I don't have a o'scope unfortunately, so I'll just have to try and see, as perry says.

Sometimes people come here with noise problems, even over the few centimetres of wire for a project within an enclosure noise can be a problem, depending on the application. Don't dismiss noise as something that is only a problem over long cables.

The whole purpose of twisted pairs is the signals are opposite on each wire and the magnetic field created by one wire is canceled by the other. That means you need both ends of the ground wire connected to ground at the point where the signal originates and ends. Otherwise you have created an antenna wire with one end grounded. This setup is not the same as a complete shield over a wire.

2 Likes

Thanks for clarifying that point, it's been confusing me all day! So now I know that all the wires that are paired with the signal wires need to he connected at both ends.

I have read elsewhere that you should connect any external screening to ground at just 1 end, creating an antenna.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.