RS485 over optical fiber cable

I'd like to replace an electrical cable with a fiber cable, mainly for electromagnetic noise immunity and long distance (I need to reach 500m). The bitrate will be very low: 9600bps is ok. I need to keep the cost low as possible.

I never used fiber cables before. In similar applications I used RS485 transceivers connected to the UART peripheral of an MCU.

I think I need a fiber optic cable transceiver, but I don't know what to search and how to interconnect with an MCU.

Any help?

Reply to
pozz
Loading thread data ...

mar?i, 30 octombrie 2018, 16:00:06 UTC+2, pozz a scris:

9600bps, 500m, RS485. It's all you need. Probably you also need galvanic isolation. Use optocouplers. Use three wires, A,B,C. C is the common ground for ONLY RS485 communication , isolated on ALL ends. I also use small 5V:5V DC/DC converters on all nodes to isolate the RS485 p art.
Reply to
raimond.dragomir

Depending on your idea of 'low cost' we've used these with great success:

But for 500m and cheap, I'd also go with a solution like Raimonds (other reply).

--
Cheers, 

Chris.
Reply to
Chris

Il 30/10/2018 15:26, snipped-for-privacy@gmail.com ha scritto:

Do you use CAT5E cable and connect A and B to a couple? What's about termination resistor? In the past I used very small RS485 links (under 100m) with low bitrate (maximum 38400bps), so I never used termination resistor.

I think I need it for 500m link. Is the usual 120R ok?

Reply to
pozz

miercuri, 31 octombrie 2018, 13:41:58 UTC+2, pozz a scris:

).

to

tion, isolated on ALL ends.

85 part.

Never used termination resistors either, even with networks up to 1km. I also use only baudrates up to 38400bps, usually 9600. I'm sure about these combinations:

1000m/9600 500m/38400 All without termination resistors.

Never used CAT cables for RS485 but I heard it's possible. If I remember co rrectly, the termination for CAT5 should be 100R. I'm using "normal" multi-wire cables, not even twisted, but shielded. Conne ct the shield in only one place, to earth. If you don't know where you have a good earth, connect to the biggest metal enclosure which has an earth sc rew :-) Don't connect the shield to any electrical ground. The ground of th e RS485 (C) is a floating ground.

With this opto-isolated RS485 system I never had headaches in very harsh en vironments.

Don't trust the saying that says the RS485 is a two wire connection. It's n ot. It's three wire. Make sure A,B,C is connected only to A,B,C. Treat the C as a signal wire, don't use the shield of the cable for it. Don't connect the C to anything else.

I hope this will help you.

Reply to
raimond.dragomir

The terminating resistor value is chosen to match the cable's impedance.

-- Grant Edwards grant.b.edwards Yow! I think my career at is ruined! gmail.com

Reply to
Grant Edwards

External converters of that sort used to be fairly common, but rather less so these days. If you have a handful of installations with problems they might make sense, but are pricey otherwise. Black Box at least still lists one in their catalog:

formatting link

Another vendor:

formatting link

If you're looking to embed this into your device, then you really ought to back up to the UART, and then put the fiber transceiver on the UART's RX and TX. Something along the lines of a Broadcom AFBR-59F2Z (just one example) would work, although that particular device has LVDS RX/TX inputs/outputs. Converting that to the single ended/common mode signaling from the typical UART is not hard, but will require some work, you might be able to find a more directly usable device.

Reply to
Robert Wessel

I second this, use optocouplers. 40 years ago we used this to drive printers like the Centronics 306. With a current loop system to carry

1200 bd over (if I remember correctly) max >4 km with dual twisted pair low-capacity cable, screened, in a very noisy environment. Using dual optocouplers in the peripherals, one wire pair carried data to the peripheral (driving a led in the optocoupler there), the other pair sensed whether the peripheral was driving its led (for offline/busy). Worked like a charm. Of course the screen was only connected at one side (computer).

Mat Nieuwenhoven

Reply to
Mat Nieuwenhoven

I have no experience with long wire RS485 applications. I find it hard to believe that an appropriately sized resistor is not on the top of the list of RS485 best practices. I have solved so many "long" wire problems by just adding termination resistors (in my case long wires are actually short but appear long due to edge speeds).

JJS

Reply to
John Speth

And don't forget the _bias_ resistors to make sure that the line idles in the proper state when no drivers are enabled.

And yes, a signal ground connection is also _required_. Even though the signaling is differential, a signal ground is required to make sure you don't violate the common-mode voltage specs on the transceivers.

I've been dealing with customer RS485/RS422 issues for almost 30 years, and they're almost due to missing bias/terminating resistors or missing signal ground.

You can connect signal ground to Earth ground if you want, but _only_at_one_point_. Breaking that rule can start fires (yes, I've seen the melted, charred results of connecting signal ground or cable shield to Earth at to different points).

--
Grant Edwards               grant.b.edwards        Yow! Sometime in 1993 
                                  at               NANCY SINATRA will lead a 
                              gmail.com            BLOODLESS COUP on GUAM!!
Reply to
Grant Edwards

If the stations are in different buildings with different mains feeds and/or separate (lightning) grounding electrode, IMHO the only option is using fibers in order to survive lightning hits of one building (not hitting data cables, only mains overvoltages).

Simple galvanic isolation (500-2500 V) is definitely not enough !

Optoisolate 500 m within the same building is usually OK, with different buildings, only fibers should be used.

"Fail safe" terminations (quotes are in the standard text :-) i.e. pull up/down resistors on each node and 100-120 ohm termination resistors at both end of the bus should be used. The resistors are very important, since a 2 wire system goes three-state between message exchanges.

If two pairs are available, use properly terminated RS-422 for point-to-point or 4 wire RS-485 in which case the master Tx pair the Tx is always on (improving noise immunity) or in multidrop slaves the other pair is actively driven only when the addressed slave wants to transmit.

For 500 m, forget about using Rx/Tx transceiver common mode (+12/-7 V) range only without isolation.

Reply to
upsidedown

Since standard Ethernet components are cheap these days, one option to consider is running the 500 m with suitable ethernet fiber components and at the remote end install Ethernet/RS-485 converter. If there is only one station at the remote site, an even cheaper Ethernet/RS-232 converter could be used.

Reply to
upsidedown

The model of the link can be a simple resistor or a transmission line.

The termination resistor is needed if the link can't be modelized as a simple resistor, but as a transmission line. So the main question is: when the link can't be modeled as a simple resistor?

For what I understood [1], it depends on two factors: the length of the link *and* the speed of signal (baudrate). Assuming 60% speed of light, 1km propagation delay is only 5us. At

9600bps, one bit time is 104us, 20 times higher. I don't think termination resistor, even useful, can increase performance.

In my experience with many "small" RS485 networks, I never used termination resistors. When I tried to solve some problems with termination resistor, I never had good results.

[1]
formatting link
Reply to
pozz

Yes, bias resistors are needed, even if modern transceivers seem to work well even without them (they are fail-safe even when all the drivers on the bus are disabled).

I will have two battery-powered devices, connected by a RS485 link. In this case, both devices are isolated from mains and Earth. Do you think it's safe to avoid signal ground connection between the two devices in this situation?

It's difficult to me to understand what happens to the common-mode voltage at the receiver, if its power supply (battery) is isolated from the rest of the world.

Reply to
pozz

You should have the signal ground. Without it, you can not control the common mode voltage of the differential pairs. The receivers likely have a small common mode bias current, and without some form of ground return, the common mode bias currents will just charge up they parasitic capacitance until you get a bias voltage high enough to change that bias current, at which point the receiver is likely impaired in functionality if not make the system inoperable.

There are some tricks you can do to fake the ground signal, (the fail-safe termination can help a lot here), but you need to be REAL careful about leakages to the outside world.

Reply to
Richard Damon

vineri, 2 noiembrie 2018, 15:44:56 UTC+2, pozz a scris:

Don't avoid the signal ground. As I said before, the connection is NOT two wire. The problems start when you connect non-isolated grounds. If your devices are battery powered, they are already isolated, you should be happy. Mains powered devices have this problem. Between sites/buildings the ground difference may be thousands of volts really at least in industrial fields. You risk to start fire as someone said it here previously.

Reply to
raimond.dragomir

I might consider using two resistors in series as the 'terminating resistor' and to use the mid point as the receiver's ground.

--
Mike Perkins 
Video Solutions Ltd 
www.videosolutions.ltd.uk
Reply to
Mike Perkins

Yes, it's "safe" (nothing's going to melt or burst into flames and kill people). No, I wouldn't depend on it working reliably (though it probably will).

There will be some sort of current leakage that will cause the the signal ground to "float" to some voltage relative to the two signal wires, but it's pretty difficult to predict exactly what happens.

It's far easier to understand what happens when you _do_ have a signal ground connection.

--
Grant Edwards               grant.b.edwards        Yow! I'm using my X-RAY 
                                  at               VISION to obtain a rare 
                              gmail.com            glimpse of the INNER 
                                                   WORKINGS of this POTATO!!
Reply to
Grant Edwards

As long as

1,) There are floating power supplies (such as batteries) on each transceiver 2.) There are "fail-safe" resistors from local Vcc and local Gnd 3.) There are at least one termination resistance between A/B at the end of the bus.

The link works fine without the signal ground. Each node is nicely biased with local Vcc 1-3 V above common bus voltage and local Gnd 1-3 V below.

This is OK as long as _all_ three_conditions are met.

The other question is what this common average voltage is, especially if there is some external charge source. Grounding the termination resistance midpoint to a real physical ground through a big resistor _at_one_end_only_ will discharge any static buildup.

Alternatively, if the cable has a common shield, connect it to real ground through a resistor at one end only to keep any static buildup from A/B.

This works well in practice, some RS-422/485 converters (e.g. some Westermo) do not even provide a signal ground (C) connector :-)

Reply to
upsidedown

The receiver supposes that the midpoint is in the middle between the supplies to it (typically at 2.5 V). The differential signal is one line at 5 V and the other at 0 V.

The bias resistors are still necessary to handle an idle line.

--

-TV
Reply to
Tauno Voipio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.