0
\$\begingroup\$

I want to send data between different Arduinos distributed in different places: Something like this: https://forum.arduino.cc/t/arduino-master-slave-communication-using-rs485-and-modbus-protocol/644168

enter image description here

I created my own Arduino shield based on this RS485 board:

enter image description here

When I connect two Arduinos using two of these boards, I can send data from one to the other. But when I use at least one of mine, nothing happens.

I checked:

  • cables.
  • power in the RS485 with multimeter.
  • pins matching Arduino to Shield.
  • Disconnecting the GND between the boards as my circuit has R28 and C22 that are not in the original board.
  • Connecting the GND of the Arduinos togheter.

I don't know what else I can do. I saw R25 and R27 can be smaller. Any suggestions? Should I remove R28 and C22? Should I reduce R25 and R27?

This is how my schematic:

enter image description here


SOLUTION

When designing the schematic, I crossed by mistake A and B and it is mentioned in @MF3 answer. With this error, R25 and R27 are pulling up and down the lines in the wrong way and it is not working. After removing them, I can connect my shield and one of the boards mentioned without any problem.

The current configuration is:

enter image description here

\$\endgroup\$
12
  • 1
    \$\begingroup\$ Hello and welcome. Could you say a) how long are the cables, and b) what is the grounding between the various units? Those modules aren't very good because they ahve no connection for ground,s and RS-485 requires ground. \$\endgroup\$
    – jonathanjo
    Commented Apr 17, 2023 at 14:31
  • \$\begingroup\$ I want to connect them with a 10 m cable. But I am using a short one now. What do you mean by grounding? \$\endgroup\$
    – user337746
    Commented Apr 17, 2023 at 14:33
  • \$\begingroup\$ Jonathan means the grounds on all the boards need to be connected together \$\endgroup\$ Commented Apr 17, 2023 at 14:38
  • 2
    \$\begingroup\$ @jonathanjo thanks ! I followed the what is mentioned in the answer you cited and it works after removing the pull up and pull down in the boards. \$\endgroup\$
    – user337746
    Commented Apr 17, 2023 at 15:14
  • 2
    \$\begingroup\$ All of the things mentioned were causing the problem; not the last thing. You appear to think that you when swapped the A and B lines and, it began working that all the previous things you tried were not to blame but, they are. \$\endgroup\$
    – Andy aka
    Commented Apr 17, 2023 at 15:24

2 Answers 2

1
\$\begingroup\$

I see two problems in your schematic:

  • A and B are crossed: The terminal A is connected to the pin B (pin 7 or the MAX485E) and the terminal B is connected to pin A (pin 6 or the MAX485E).
  • The fail-safe biasing circuit is wrong: The resistor connected to the pin B (R25) should be a pull-down and it is pull-up. Something similar happens to the pin A, as the R27 shoul be pull-up and it pull-down. This capture may help: enter image description here

Reference: https://www.analog.com/media/en/technical-documentation/application-notes/an-960.pdf

Regarding the values of R25 and R27, the same link shows you how to obtain them.

I think you should remove the two resistors mentioned (R25 and R27) from the boards, and then wired the boards considering that all the pin B are connected togheter and the same with pin A. One last thing, you should have only two terminator resistors (R26) and in your circuit, it looks like they are always there, so if you connect more than 2 boards, you should remove one.

\$\endgroup\$
3
  • \$\begingroup\$ The answer is incorrect. That is not true. Maxim and some other chip manufacturers use A for non-inverting pin and RS-485 standard uses A for inverting pin. \$\endgroup\$
    – Justme
    Commented Apr 17, 2023 at 14:55
  • \$\begingroup\$ So I should remove R25 and R27 from all my shields and then connect to the same letter as @jonathanjo mentioned before. As I am testing with two boards, I should keep R26. Correct me if I am wrong, please! \$\endgroup\$
    – user337746
    Commented Apr 17, 2023 at 14:55
  • 2
    \$\begingroup\$ It works! So the problem is R25 and R27. \$\endgroup\$
    – user337746
    Commented Apr 17, 2023 at 15:12
0
\$\begingroup\$

If all nodes have biasing and termination resistors, it will not work.

Only the two devices at the ends of the bus should have the terminations present. Not all. And the biasing resistors should be present only once on the bus.

Also RS-485 is not a two-wire bus, as the devices must share a common ground reference. Your design does not connect grounds between RS-485 boards. So if the are powered from different, unrelated power sources, there may be too much voltage between grounds and RS-485 will not work.

\$\endgroup\$
1
  • \$\begingroup\$ "and RS-485 will not work" ... indeed, I often find transceivers are destroyed on site by exactly this, and hence I normally recommend through-hole DIL chips with sockets. \$\endgroup\$
    – jonathanjo
    Commented Apr 17, 2023 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.