RS485 Arduino Communications

There are various ways for two Arduinos to communicate information. A common way is serially via RS232. However, RS232 has distance limitations. If there is a need to serially communication over a longer distance consider using RS485 instead.  A couple of MAX485 ICs can facilitate RS485 Arduino communications over that longer distance.

Two MAX485 ICs connected together will take RS232 signals and perform the voltage level conversions required to turn them into RS485 signals and back again to RS232 signals. That will allow two Arduinos to communicate serially over a longer distance.

This chart shows the specific pin functions on the MAX485:

Here is how to connect the two Arduinos using two MAX485 ICs:

Max485 Arduino Communications

Get the Fritzing source HERE.  5V is used in this simple demonstration. For longer distances a higher voltage will be needed to power the MAX485. Also the BAUD rate will need to be adjusted (the longer the distance, the slower the speed).

This is the source code for the Transmitter:

This is the source code for the Receiver:

Here is what it looks like (messy wiring and all):

MAX485 ArduinoMAX485 Arduino

4 comments

Skip to comment form

    • hirata on February 13, 2019 at 11:36 pm
    • Reply

    I am writing from japan.
    I have a question.
    I don’t understand the orientation of the MAX485.
    The picture don’t connect to pin A and B of the other 485 IC by blue line.

    I’m not good at English.
    I’m happy to answer.

      • earl on February 14, 2019 at 5:36 am
        Author
      • Reply

      Notice: The MAX485 ICs are not oriented the same on the breadboard. The MAX485 on the left has pin 1 on the bottom left. The MAX485 on the right has pin 1 on the top right.

    • Leon on January 13, 2020 at 5:54 pm
    • Reply

    On your Fritzing diagram it appears that;
    – Left hand UNO, missing RX wire (Pin 10) to the MAX485 chip
    – Right hand UNO, missing TX wire (Pin 11) to the MAX485 chip

      • earl on January 16, 2020 at 10:56 am
        Author
      • Reply

      Yes.. they are missing. The one is labeled sender and the other is labeled receiver. I only wanted to send one way.. However, you can add more code and the other wires to easily accomplish two way communications…

      Note that the MAX485 does not do full duplex. See my other (post https://microcontrollerelectronics.com/sn75176-rs485-communications-between-two-arduinos/) which details the SN75176 IC which works better than the MAX485. It has all the wiring ..

Leave a Reply

Your email address will not be published.