RS485 why?

Hi guys!
In my project i use 3 arduinos to communicate over RS485.
I am still at prototype, but o got an issue wich i solved, and dont undestand why.

1 master 2 slaves.
i am using those RS485 modules sold everywhere for arduinio.

The behaviour before:
Master sends message to slave 1 and receive wrong response.
Master sends message to slave 2 and receive wrong response.

After some trial and error, i discovered that if i connect the A to +, using a resitor
and B to - using other resistor, i got the system talk fine.

My question is: Why do i need to connect A and B to + and - can some one explain me?
Looking at module diagram, this connections are already made.

I used 220ohm resistors. (were the ones i had at hand)

Thanks

Try this explanation....

https://www.gammon.com.au/forum/?id=11428

Hello,

I'm not an expert about RS485 networks, but I do know that typically you will need a resistor if you network things, so certain parts of your circuit will not be floating and are pulled down to provide a 0.
Here is a video that explain RS485 networking pretty good, in my humble opinion.

I hope this helps you to be successful in your project,

with regards,

Mike

Gammon's electrical connection example (see link from post #2) shows 680 Ohms between A and +5V and another 680 Ohms between B and 0V (or GND). These will pull the lines into a defined voltage should the DE pins all be disabled. If you don't force the lines into a defined range then some of the receivers (on the transceivers) will see a HIGH while others see a LOW, and noise will cause gibberish to show up on the RO pin of the transceiver.

Those resistors become a problem as the network grows. Some newer transceivers (e.g. ISL3172) have reduced that undefined range so it is possible to use twisted pair terminations alone and retain a clean RO output but all transceivers have to have the reduced undefined range (look for "failsafe biasing" info in the datasheet).

@Mikeb1970 that video seems good to me also.

For multiple RS485 devices on the same bus I use MAX3085 which supports upto 256 devices.
However I have also successfully used the cheaper MAX485. Tested with upto 10 devices with no problems.

Pull up and Pull down resistors are needed as a fail-safe measure to make sure the bus lines are always at a defined state (voltage). Adding more devices in the network means that this resistors are effectively connected in parallel, so I use higher resistor values to compensate this. I use 47k-100k resistors.
In addition I use a termination resistor to much the transmission line impedance. In my case, I use CAT5E cabling which means I am using a 120 Ohm termination resistor .

Thanks. Good links to study.
The modules i am using are these

.
They already have the 3 resistors for fail-safe.

Could this be a problem using 3 modules?
All of them have the resistors between A and B which are normally used only on termination nodes.

I am
At this time, i have all on breadboard, bus included.

C4m4l340:
Thanks. Good links to study.
The modules i am using are these

.
They already have the 3 resistors for fail-safe.

Could this be a problem using 3 modules?
All of them have the resistors between A and B which are normally used only on termination nodes.

From what I can see in the picture (!) the fail safe resistors are 10k each .If you are using only three modules on the bus, there should be a problem.
PS: Fail safe resistors are just two, not three. The third one between A-B must be the termination resistor in the order of a few 50-200 Ohms depending on your transmission line.

RS485 assumes 120 ohms, I don't think many RS485 drivers could handle a 50 ohm load for instance, and
I don't know of any balanced transmission line that low an impedance. Use twisted pair, use 120 ohms.

I use cat5e and also use 120 ohm termination ..

Edit:it looks like an 120 ohm resistor is already present on the pcb module of the picture!

So it can only go at the end of a cable run...

You might also find this description helpful: https://arduino-info.wikispaces.com/RS485-Modules

MarkT:
So it can only go at the end of a cable run...

Yes, provided that the devices are connected in a daisy chain topology. If they are connected in a star topology, all resistor can be left in place.

I think a Star topology needs a divider network to match the characteristic impedance of each of the connected pairs. If those boards each have a 120 Ohm then the one in the center could be removed (tombstone).

Consider the chance that two transceivers have their driver enabled but one drives its A-line HIGH and the other drives its A-line LOW, that would be a crowbar. I sort of think the better transceivers have a current limit. The setup I use does not crowbar, it does seem to drive 50 Ohm's fine. I have an idea that the transceiver can drive a dead short all day and even take a crowbar condition without self-destructing (I'm not going to test that idea, it is just an idea).

I suspect they all have current limiting and probably thermal shutdown, its just that you wouldn't expect reliable
communication if you don't stick to the rules. An RS485 network with 120 ohms load at each end is of
cours a 60 ohms load to any driver, which they are designed for.

A network that was 50 ohms in each direction would be a 25 ohms load, which as I've said I'd not expect
to work. On many microcontroller boards the RS485 driver can be one of the hottest components along
with the regulators.

RS485 chips that are designed to cope with multiple transceivers on the bus can handle "crowbar" situations without giving their smoke, even though you would normally have only one device driving the bus (talking) at any given time and the others are just listening. (One master, multiple slaves). This might not be the case with MAX485 which is probably what the module in the picture has.

Having said that,
i am using an extensive RS485 bus network over cat5e cabling with about 50 transceivers in a mixed daisy-chain and star topology without any distinct master-slave relationship. Any device can talk at any moment to the bus (addressing takes care of packet destination) and the only method used to avoid congestion is that it first listens to check if the bus is busy before transmitting. If the bus is congested, transmission is delayed. There are still situations that more than one device is talking (e.g in cases of broadcast) and while the result is undefined, if the packet doesn't reach its destination, it is re-transmitted. All devices are terminated with 120 ohms resistors irrespective of their location which can change over time.

The above running at 9600bps operates very reliably for years now and its being continually extended.

As a side note, 2 pairs of the cat5e cable are also used to curry the required power supply for the devices. (24V DC)

50 transceivers all with 120 ohms? That's 2.4 ohms across the bus lines. How can that work?
Are they actively terminated perhaps?

MarkT:
50 transceivers all with 120 ohms? That's 2.4 ohms across the bus lines. How can that work?
Are they actively terminated perhaps?

You shouldnt forget the characteristic impedance of the transmission line. It is not as if they were connected all directly in parallel. The point here is to achieve impedance matching and hence max transfer of power. (Impedance matching - Wikipedia)

Activily terminated? You mean the termination is not always connected?

The signal should be above +/-400mV if I recall, and bellow +/-200mV it is undefined. The special fail safe transceivers... wait is that why it works? Yep, the MAX3085 is one of the failsafe parts, it sees everything above -50mV as a HIGH. Are there resistors between A and +5V as well as between B and 0V. I guess that would do it.

What I am doing is just as outlandish, I turn everything off to send a HIGH so on the pair, 0V is a HIGH bit and -3V is a LOW bit. The transceivers seem to be cool with the HIGH (so to speak) and so is the battery.

Thank you all for your opinions.
I was able to put them to work on breadboard.

Now i am implementing the rest of the program.
After new year, i believe its all ready to test with a 50m cable :slight_smile:

Thank you all

ron_sutherland:
The signal should be above +/-400mV if I recall, and bellow +/-200mV it is undefined. The special fail safe transceivers... wait is that why it works? Yep, the MAX3085 is one of the failsafe parts, it sees everything above -50mV as a HIGH. Are there resistors between A and +5V as well as between B and 0V. I guess that would do it.

What I am doing is just as outlandish, I turn everything off to send a HIGH so on the pair, 0V is a HIGH bit and -3V is a LOW bit. The transceivers seem to be cool with the HIGH (so to speak) and so is the battery.

This is very interesting. ...i might give it a try too!