About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

RS485 PI Question

1355 Views - Created 13/10/2017

13/10/2017

Posted by:
JimT

Users Avatar

I would like to communicate using RS485 between a PI Zero W board (master) and several 5V Arduino type boards.  Using the RS485 PI module with the PI Zero W and a MAX485 chip with each arduino board is this possible?  The maximum communication distance is around 10-15 meters.  Your input is appreciated.

13/10/2017

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

There shouldn't be any problems with using the RS485 Pi in the way you described.  You will need to use terminating resistors at each end of the cable to stop reflections.  A 120R resistor is included with the RS485 Pi so you will just need to add an additional 120R resistor to the other end of the wire.

AB Electronics UK Tech Support

13/10/2017

Posted by:
JimT

Users Avatar

I was concerned since the MAx485 and Arduino are at 5V and the PI at 3.3V.  Also since the PI pins are not 5V tolerant. 

13/10/2017

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

The RS485 protocol uses a voltage between -7V and 12V so the tranciever in the RS485 Pi will convert the 3.3V UART signals to -7V and 12V and then transmit it to the MAX485 on the Arduino which will convert it down to 5V.  As long as all of the devices have their ground wires connected together the different voltages for the Pi and Arduinos shouldn't be an issue.

AB Electronics UK Tech Support

13/10/2017

Posted by:
JimT

Users Avatar

Do you have any sample python code to test a PI board with the RS485 module?

 

13/10/2017

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

There is a good tutorial on serial port programming which you can use with the RS485 Pi on elinux.org. 

https://elinux.org/Serial_port_programming

AB Electronics UK Tech Support

14/10/2017

Posted by:
JimT

Users Avatar

Has the board been tested with the new Raspbian Stretch release?

14/10/2017

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

The RS485 Pi works with Raspbian Stretch.  The Raspberry Pi Zero W uses the mini UART port like on the Raspberry Pi 3 so you will need to configure Raspbian to use that port.

There is a good article on how to configure the mini UART port on RaspberryPi.org at https://www.raspberrypi.org/documentation/configuration/uart.md

We also have a tutorial on our knowledge base at https://www.abelectronics.co.uk/kb/article/1035/raspberry-pi-3-and-zero-w-serial-port-usage

As the RS485 Pi is basically just a level converter for the UART port any of the tutorials and software libraries on the internet for the Raspberry Pi UART and serial ports should work fine with the RS485 Pi.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.