On Tue, 30 Oct 2018 07:26:31 -0700 (PDT), raimond.dragomir@gmail.com wrote:>mar?i, 30 octombrie 2018, 16:00:06 UTC+2, pozz a scris: >> 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.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 !>> >> 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? > >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 part.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.
RS485 over optical fiber cable
Started by ●October 30, 2018
Reply by ●October 31, 20182018-10-31
Reply by ●November 2, 20182018-11-02
On Wed, 31 Oct 2018 12:16:50 +1100, Chris <c@b.a> wrote:>On 31/10/2018 1:00 am, pozz wrote: >> 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? > >Depending on your idea of 'low cost' we've used these with great >success: <https://www.moxa.com/product/TCF-142.htm>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.> >But for 500m and cheap, I'd also go with a solution like Raimonds (other >reply).
Reply by ●November 2, 20182018-11-02
Il 31/10/2018 17:35, John Speth ha scritto:> On 10/31/2018 7:03 AM, Grant Edwards wrote: >> On 2018-10-31, pozz <pozzugno@gmail.com> wrote: >> >>> I think I need it for 500m link. Is the usual 120R ok? >> >> The terminating resistor value is chosen to match the cable's >> impedance. > > 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).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] http://www.diit.unict.it/users/scava/dispense/II/RS485.pdf
Reply by ●November 2, 20182018-11-02
Il 31/10/2018 17:48, Grant Edwards ha scritto:> On 2018-10-31, John Speth <johnspeth@yahoo.com> wrote: >> On 10/31/2018 7:03 AM, Grant Edwards wrote: >>> On 2018-10-31, pozz <pozzugno@gmail.com> wrote: >>> >>>> I think I need it for 500m link. Is the usual 120R ok? >>> >>> The terminating resistor value is chosen to match the cable's >>> impedance. >> >> 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). > > And don't forget the _bias_ resistors to make sure that the line idles > in the proper state when no drivers are enabled.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).> 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 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.> > 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). >
Reply by ●November 2, 20182018-11-02
On 11/2/18 9:44 AM, pozz wrote:> > 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. >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 by ●November 2, 20182018-11-02
vineri, 2 noiembrie 2018, 15:44:56 UTC+2, pozz a scris:> Il 31/10/2018 17:48, Grant Edwards ha scritto: > > On 2018-10-31, John Speth <johnspeth@yahoo.com> wrote: > >> On 10/31/2018 7:03 AM, Grant Edwards wrote: > >>> On 2018-10-31, pozz <pozzugno@gmail.com> wrote: > >>> > >>>> I think I need it for 500m link. Is the usual 120R ok? > >>> > >>> The terminating resistor value is chosen to match the cable's > >>> impedance. > >> > >> 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). > > > > And don't forget the _bias_ resistors to make sure that the line idles > > in the proper state when no drivers are enabled. > > 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). > > > > 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 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? >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 by ●November 2, 20182018-11-02
On 02/11/2018 13:44, pozz wrote:> Il 31/10/2018 17:48, Grant Edwards ha scritto: >> On 2018-10-31, John Speth <johnspeth@yahoo.com> wrote: >>> On 10/31/2018 7:03 AM, Grant Edwards wrote: >>>> On 2018-10-31, pozz <pozzugno@gmail.com> wrote: >>>> >>>>> I think I need it for 500m link.� Is the usual 120R ok? >>>> >>>> The terminating resistor value is chosen to match the cable's >>>> impedance. >>> >>> 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). >> >> And don't forget the _bias_ resistors to make sure that the line idles >> in the proper state when no drivers are enabled. > > 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). > > >> 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 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.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 by ●November 2, 20182018-11-02
On 2018-11-02, pozz <pozzugno@gmail.com> wrote:> 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?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).> 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.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 by ●November 2, 20182018-11-02
On Fri, 2 Nov 2018 11:00:29 -0400, Richard Damon <Richard@Damon-Family.org> wrote:>On 11/2/18 9:44 AM, pozz wrote: >> >> 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. >> > >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.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 :-)> >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 by ●November 2, 20182018-11-02
On 2.11.18 17:22, Mike Perkins wrote:> On 02/11/2018 13:44, pozz wrote: >> Il 31/10/2018 17:48, Grant Edwards ha scritto: >>> On 2018-10-31, John Speth <johnspeth@yahoo.com> wrote: >>>> On 10/31/2018 7:03 AM, Grant Edwards wrote: >>>>> On 2018-10-31, pozz <pozzugno@gmail.com> wrote: >>>>> >>>>>> I think I need it for 500m link.� Is the usual 120R ok? >>>>> >>>>> The terminating resistor value is chosen to match the cable's >>>>> impedance. >>>> >>>> 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). >>> >>> And don't forget the _bias_ resistors to make sure that the line idles >>> in the proper state when no drivers are enabled. >> >> 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). >> >> >>> 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 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. > > I might consider using two resistors in series as the 'terminating > resistor' and to use the mid point as the receiver's ground.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