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.
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.
Il 30/10/2018 15:26, email@example.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?
miercuri, 31 octombrie 2018, 13:41:58 UTC+2, pozz a scris:
tion, isolated on ALL ends.
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:
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.
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:
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.
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).
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.
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
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.
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.
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.
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.
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.
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 :-)