Arduino to RS485 - interference.

Hello! I'm new to this so please tell me if there is any other information that needs to be added.

I'm having some problems when receiving data from an RS485(115200 baud) unit to my Arduino UNO.

A command is sent from the arduino to the RS485 module and the requested data is sent back to the arduino. I am able to transmit and receive data to and from the RS485 module but the data received has some interference and i just cant seem to figure out where the problem lies...!

I'm using a MAXRS485 unit as translator of the signals between the Uno and RS485 module.

The data received looks like this on seriall monitor:

@000719,1524659400,TBR Senso⸮,111,8,11,69,18

or:

@000719,1M&⸮S⸮&&⸮y⸮(-⸮U⸮ͽɱ~L⸮⸮,9,13,69,8

When it should have been:

@000719,1524659400,TBR Sensor,111,8,11,69,18

As you can see the result is varying from almost correct to unreadable.

The MaxRS485 unit has termination resistors of 120ohm to prevent reflections in the cable. I'v tried both shielded and twisted cables with short length to rule out interference from the cable.

The code is attached.

Any help is appreciated!

code.ino (11.1 KB)

SoftwareSerial is a hack that wastes resources, and does not support high baud rates reliably, as you've found out.
If you want to do serious stuff with multiple UARTs, consider getting a board that has multiple hardware UARTs.

Pieter

Hi,
Consider that RS485 assumes a common ground between the two ends, not just the two wires...

I'm only using the SoftwareSerial interface for testing purposes and should not be used in the finished design. Do you beleive that the data signal is received from the RS485 module is "correct"? But the interference occur when i write the data to the computer seral montor?

An Arduino Mega has a couple of Serial ports in hardware.