Project tutorial
Up to Three RS485 Busses on One Arduino

Up to Three RS485 Busses on One Arduino © GPL3+

This project will show you how to connect up to three independent RS485 buses to only one Arduino.

  • 2,909 views
  • 0 comments
  • 6 respects

Components and supplies

Apps and online services

About this project

In this blog entry I will show how to connect up to three independent RS485 buses to one Arduino. This can be useful if you want to create a gateway between these buses or if you want to control devices in these buses (without to connecting the buses itself). Another application is the connection of an RS422 device (for example motor control) and an RS485 device (for example a sensor) to the same Arduino.

In any case you will need a stackable RS485 shield with isolated interface to eleminate grounding problems and to protect the Arduino. For any RS485 bus (or RS422) we will need a seperate shield.

DIP Switch & Jumper Setting for BUS 1:

Jumper:

  • UART RX to position 0
  • UART TX to position 1
  • Voltage to position 5V

DIP Switch:

  • S1 = OFF - ON - ON - OFF
  • S2 = OFF - OFF - ON - ON
  • S3 = ON - OFF - OFF - OFF

DIP Switch & Jumper Setting for BUS 2:

Jumper:

  • UART RX to position 2
  • UART TX to position 3
  • Voltage to position 5V

DIP Switch:

  • S1 = OFF - ON - ON - OFF
  • S2 = OFF - OFF - ON - ON
  • S3 = ON - OFF - OFF - OFF

DIP Switch & Jumper Setting for BUS 3:

Jumper:

  • UART RX to position 4
  • UART TX to position 5
  • Voltage to position 5V

DIP Switch:

  • S1 = OFF - ON - ON - OFF
  • S2 = OFF - OFF - ON - ON
  • S3 = ON - OFF - OFF - OFF

Software Integration

The shield for bus 1 will use the hardware UART on PIN 0 and 1 of the Arduino. The both other shields will use software UARTs.

#include <SoftwareSerial.h>
SoftwareSerial RS485_BUS2(2,3);
SoftwareSerial RS485_BUS3(4,5);
void setup()
{
....
// init serial port for bus 1
Serial.begin(9600);
// init serial port for bus 2
RS485_BUS2.begin(9600);
// init serial port for bus 3
RS485_BUS3.begin(9600);
....

The transmittion data of these software UARTs is limited by the calculation power of the Arduino. Of course, if you will use an ARM-based Arduino or STM32 board this will not be really a problem, but for the UNO it is recommend to use only two shields at the same time and for the second shield not more as 9600 Baud as data rate.

Comments

Similar projects you might like

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 454,662 views
  • 42 comments
  • 236 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,521 views
  • 95 comments
  • 671 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 229,333 views
  • 38 comments
  • 236 respects

OpenCat

Project in progress by Team Petoi

  • 196,001 views
  • 154 comments
  • 1,363 respects
Add projectSign up / Login