0
\$\begingroup\$

The basic problem were trying to solve is certain secondary device's cables gets left unplugged and we need a way to detect a cable that is plugged into my device,and check if that cable is actually plugged into a secondary device and not hanging around unplugged.

I have a cable with 5 pins on both ends that are plugable i have 2 pins that are not used in the connector's and 1 pin is ground,and the other 2 pins are rs485 signal pins.My device has a mcu,and ports on the pcb that one end of the cables connector will plug into,i dont have access to the other end of what the cable will plug into.what i need to be able to detect is

  1. If the cable is connected to my device
  2. Is the other end of the cable connected to a secondary device

Iam not sure if this is even possible with how iam trying to go about this, without there being a mechanical switch inside the connectors or on the connector ports. Any input is appreciated thanks

EDIT:Just to clarify the network isnt and cant use any termination resistors,and we dont have any control over secondary devices software,or hardware as they dont implement termination resistors,or a software response system on there end.

\$\endgroup\$
  • 1
    \$\begingroup\$ Does the secondary device have a termination resistor across its RS485 pins? Also, does your device have an RS485 termination? \$\endgroup\$ – Tom Carpenter May 29 at 22:11
  • \$\begingroup\$ No it would not have a termination resistor \$\endgroup\$ – blinded_ravager May 29 at 22:17
  • \$\begingroup\$ If you leave the RS485 pins floating at your device, and measure the voltage between each pin and ground with a multimeter, do you measure a voltage (the device might have a fail-safe bias). \$\endgroup\$ – Tom Carpenter May 29 at 22:19
  • \$\begingroup\$ If the number of devices is always identical (but can be unplugged at any time) and you know the load of each device, then you could send a small current to the RS485 wire, when all the RS485 transcievers are in receiving mode, then check the voltage drop. If the voltage drop is less than what it should when all devices are connected, then it means one or more of them are not connected. \$\endgroup\$ – Fredled May 29 at 22:46
  • \$\begingroup\$ @TomCarpenter I will have to give it a try and see.@Fredled the number of devices are variable it could be 1 to 30 devices depending on there setup. we do already have a way detecting current usage(load) on each port i believe its just a current sense resistor on the transceiver that the mcu reads. \$\endgroup\$ – blinded_ravager May 29 at 22:55
1
\$\begingroup\$

There is a huge benefit of the RS-485 electrical layer protocol that allows for long distance communications in the presence of multiple volts of common mode voltage differences between the two ends.

I would highly discourage the use of extra signal pins in the connectors for "cable connected" checking that do not meet the same specs as the RS485 signalling signals. So I would not run low level MCU GPIO level signals over the cable wires.

The far better situation is to realize that connected cables enable communications and disconnected cables impede communications. So take advantage of that and let your systems MCUs implement heart beat handshaking directly though the RS485 communications layer using appropriately designed small packets. If one or the other end fail to see the heartbeat packets come or get acknowledgement of them then know that your cable is either disconnected or has broken wires. This scheme covers every case that would prevent communications.

For devices where you have to consider the devices at the far end of your cables to be unable to be modified, either hardware or software wise, you have to get clever regarding how you determine if the device is connected. For these secondary devices you have to implement your periodic heart beat check in some device specific way. This can vary greatly depending upon the device. The only way this would not work is if the secondary device only takes "write only to device" transmissions with no possibility of any acknowledgement or return result. A simple method is often a status check. Sometimes you can read from some register that has a known value. Other times you may write something and read it back to verify. As the implementer you have to figure out what works within your system....but in the end it is still better than using extra signal pins.

In my book the only acceptable way on an RS-485 interface to use the extra pins for cable continuity test is if you run the signals through the same type of drivers/receivers as used by the RS-485 signalling so that you can achieve the same distance and common mode isolation that the signalling uses.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Maybe iam not understanding you correctly,in my original post i stated i dont have access to any secondary device software so i cant implement a heart beat type system these are all 3rd party devices we just plug are cables into. \$\endgroup\$ – blinded_ravager May 29 at 22:46
  • \$\begingroup\$ It depends if the secondary device he is talking about is able to respond (not receiver-only) and is addressable. Usually when they are able to respond, they are addressable but not forcibly. \$\endgroup\$ – Fredled May 29 at 22:52
  • \$\begingroup\$ @the_most_humbled These devices are not giving any response whatsoever? \$\endgroup\$ – Fredled May 29 at 22:54
  • \$\begingroup\$ depends on the if the secondary device if it implements a response system or not some secondary devices will some wont implement it. \$\endgroup\$ – blinded_ravager May 29 at 22:58
-1
\$\begingroup\$

put AC termination and biasing at your end and put DC termination at the far end, sense the bias current.

schematic

simulate this circuit – Schematic created using CircuitLab X will go high and Y will go low when the RS485 circuit is connected.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ We dont have plans on using termination resistors even if we did implement them on are device,secondary device's are designed by another manufacturer which most of the time they dont have termination resistors sometimes there is some configuration option the operator can choose to terminate the secondary device with resistor's if that option is available on that secondary device.would this circuit still apply and if it does would it set a false cable unplugged flag if the secondary device is powered off which happens regularly. \$\endgroup\$ – blinded_ravager Jun 1 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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