I'm designing a sensor system where each sensor communicates via RS485 MODBUS in a high-density environment. Each line consists of 18 sensors which then goes to a gateway (Elfin EE11) that converts RS485 into ethernet which then goes into a server. Each line has a maximum distance of 30m from the last sensor to the gateway. Each slave uses a RS485 to TTL module to communicate with a MCU. Each slave operates at 5V and consumes up to 1A.

Cable Selection

I intent to use the same cable to provide power to each sensor. This cable will also be running parallel to some power cables that are carrying 240VAC 30A. My current selection is to go with CAT5e cables that will carry 48V similar to a PoE system. Due to the power cables running in parallel, should I use STP cables instead of UTP? If I were to use STP, how do I ground the cable properly?

Cable Wiring

The standard CAT5e cable has 4 twisted pairs in it. I intend to use 2 twisted pairs for power. Another twisted pair to RS485 A and B respectively and the other as a spare. Is there anything wrong with this wiring? Do I need to put a termination resistor on each sensor device?

enter image description here enter image description here

Any help will be much appreciated. Thank you in advance.

  • \$\begingroup\$ Just a heads up: You keep saying this is similar to PoE, but it's really not that similar: in PoE there is no dedicated power line, and power and data are superimposed on the same pairs. \$\endgroup\$
    – mmmm
    Commented May 23, 2021 at 7:17
  • \$\begingroup\$ Sounds like you should read the MODBUS specification. Have you read that? It has most likely all the info about cabling, AWG, shielding and terminations that you ask. Otherwise the answers would be quoting you the relevant parts of the specs. \$\endgroup\$
    – Justme
    Commented May 23, 2021 at 10:41

3 Answers 3


Question 1) Cable selection; UTP vs STP; Grounding:

Modbus standard requires shielded cable, so you must use STP.

Modbus standard also requires shield to be connected to protective ground, on one end only, so that there can not be any current flowing between devices via the cable shield. If there is a connector, cable shield must be connected to connector shell, so it gets grounded via connector.

Modbus standard says data wires must be 24 AWG, or thicker, but not thinner.

Modbus standard says CAT5 cabling is rated up to 600 meters only, so it is not so good as cable that is actually rated for Modbus or RS-485, and the 100 ohm differential impedance of CAT5 cables may not be so good as cable with higher impedance.

So just as a warning, CAT5 may not be a good choice, so bear that in mind when you choose to use CAT5 instead of cable actually meant for RS-485 or Modbus. So if it does not work, change the cable.

Question 2) Cable Wiring; Termination:

Yes, there is a definite problem to what you suggest. RS-485 or Modbus does not simply work with two data wires. There must be a common ground for data signals as well between devices. The Modbus standard requires a third wire for connecting common ground for data between devices. The common ground for data bus is meant to keep the voltage potential of the transceivers at the same common ground potential, so it is not meant to have power supply currents flowing in it. Especially since you intend to use switch-mode power supplies, you need a separate power supply wire and power supply return wire, and to keep these separated, it basically means isolated power supplies, or isolated RS-485 interfaces on the sensors, so that no sensor connects the common ground for data to common ground for power supply.

The termination definitely does not belong to at each sensor device. The Modbus standard mandates that the buses are terminated, that there must be only two terminators in the bus, at both ends of the bus.

  • \$\begingroup\$ "RS-485 or Modbus does not simply work with two data wires" . It does, but you need an isolated converter with floating supply to the transceivers. Usually high resistance bleeding resistors from A.B lines are used to define GND potential. Without galvanic isolation, you do need 3rd wire - GND. But this devices are not used in industry, they are not suitable for multi-drop, rather for PtP communication on short distance. \$\endgroup\$ Commented May 23, 2021 at 15:55
  • \$\begingroup\$ Yes, it might work, and I have no doubt it has worked for you, but is it guaranteed to work for everyone in all cases, with two prong power supplies, that give out common mode voltage in reference to earth? It can also work if it is earthed on all devices so they get the common reference via mains earth. Besides, Modbus standard requires it. \$\endgroup\$
    – Justme
    Commented May 23, 2021 at 16:41
  • \$\begingroup\$ As long you use isolated type it works as described. Modbus is a protocol layer, while RS485 is physical layer, so the wiring is not a part of Modbus standard, IMO. But you can link the document where it says about that, but I doubt that it should be different than any other RS485. \$\endgroup\$ Commented May 23, 2021 at 19:08
  • \$\begingroup\$ @MarkoBuršič I did quote the freely available Modbus standard from modbus.org how to connect RS485-Modbus nodes together. Chapter "3.6 Cables". \$\endgroup\$
    – Justme
    Commented May 23, 2021 at 19:16

You can use a dedicated TP cable, example: UNITRONIC Li2YCY (TP) You may not do a star topology, rather you "stitch" devices together with a single cable.

enter image description here

should I use STP cables instead of UTP?

A TP cable has a rather thick screen, so no UTP should be used.

how do I ground the cable properly?

The shield has to be grounded at one point, only. Since you will cut the cable into sections, you can ground just one cable for example: outgoing, so the incoming is grounded at previous device or master.

Do I need to put a termination resistor on each sensor device?

Only at both ends of the transmission line, as depicted.

  • \$\begingroup\$ Thanks, so if I just ground my wire at the gateway (Master), that should do the trick right? And when you say ground, you do mean earth ground, right? \$\endgroup\$
    – Max
    Commented May 23, 2021 at 8:24
  • \$\begingroup\$ The whole line will be approx. 1km long, so intermediate grounding is preferred. Yes, I mean earth potential. \$\endgroup\$ Commented May 23, 2021 at 8:27
  • \$\begingroup\$ My line will not be longer than 30m. So I think grounding it at the source should be sufficient. Are there special connectors for this? \$\endgroup\$
    – Max
    Commented May 23, 2021 at 9:02
  • \$\begingroup\$ @Max It's not cleat about the lines, sensors, distances. Can you draw a picture? No special connectors are needed. You do wrap a shield into a conductor, then bolt on the PE. A hint: youtube.com/watch?v=agJJkhXStHY \$\endgroup\$ Commented May 23, 2021 at 9:34
  • \$\begingroup\$ I have added a diagram to hopefully clear things up. Okay thanks, does this apply to STP and FTP cables? \$\endgroup\$
    – Max
    Commented May 23, 2021 at 12:16

its bad juju to run comms in parallel to mains. You don't want to make a transformer.... shield or no shield. It's also called an electrostatic shield - not electromagnetic. How to ground the cable - you really have only one ground point as the supply is via the cable.

Make sure you have protection for the cable on the 48V supply - you don't want a fault to cause a fire.

You only need to terminate the ends of the cable, not each sensor. Depending on the data rate, drivers, cable etc, you may not need termination. Nevertheless, it is wise to anticipate the requirement.

Apart from A & B, you need 0V. Do not use the shield for this. You also need to consider voltage drop with the 48V supply - using isolated dc/dc converters on each sensor is suggested.

48V and RS485 comms is an unhappy marriage - most 485 transceivers wont appreciate 48 volt applied to the bus. The LTC1785 will tolerate it. There may be other chips as well, but the average 75176 or MAX485 will die. How does ethernet tolerate it? They use transformers and smart protection on the psu end.

  • \$\begingroup\$ Unfortunately, with the current setup, I have no choice but to run them in parallel to mains. The best I can do is keep them as far as possible, about 2" apart. When you say ground the cable, you mean earth ground right? What kind of protection would you recommend on the 48V line? Can I use the 0V of the 48V supply as a reference? The 48V is just for power transmission, it will be stepped down to 5V with a buck converter for each slave device to use. \$\endgroup\$
    – Max
    Commented May 23, 2021 at 7:45
  • \$\begingroup\$ Calculate the voltage drop across your cable. The 0V at the source won’t be 0V at the end. There will be very little voltage drop across A and B, so you might have an issue with common mode voltage. That’s why i suggested isolated dc/dc converters. The devil is in the details. Also consider lightning protection as well. \$\endgroup\$
    – Kartman
    Commented May 23, 2021 at 9:36
  • \$\begingroup\$ Sorry, I'm a little confused. How would the isolated dc/dc converters help and work? Plus this system is entirely indoor, would I still need lightning protection? \$\endgroup\$
    – Max
    Commented May 23, 2021 at 12:17
  • \$\begingroup\$ You need to draw yourself a circuit. Substitute the 0V and 48 wires with the equivalent resistance of the cable (~10Ohms/100m) scaled to the actual length of the wire and use Ohms law to calculate the voltage drop. By using isolated converters, the high current 0V for the power is isolated from the 0V for the RS485. Most of the damage of an indirect lightning strike is induction. You’ve got lots of wire for that to happen. How frequent is lightning in your area? \$\endgroup\$
    – Kartman
    Commented May 23, 2021 at 12:45
  • \$\begingroup\$ It's quite tough to actually measure the voltage drop on the wire as the current will vary and split into multiple branches. I have added a diagram of my intended wiring. If I were to add an additional ground cable, do I just extend the GND wire from the 5V power supply? I'm looking into isolated converters but they seem a little too expensive for my budget. Lightning is not very frequent in my area, and the entire setup is completely indoors. \$\endgroup\$
    – Max
    Commented May 23, 2021 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.