Can I use RS485 communication using no external shield?

Hi everyone, I need to talk to a linux PC using RS485. I wondered: can I use only an Arduino board (UNO) to communicate using RS485, without connecting extra shields or converters? Usually the answer is no (since it is advised to shift the voltages to the usual levels), but I looked up the specification, and iiuc, RS485 needs only a differential voltage: if I use a pair of pins and switch between 0-5v, where the second pin is the negation of the first, isn't that a differential 5v signal? Is this sufficient to make a RS485? I tried with something like this:

void setup() {
  // put your setup code here, to run once:
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
}

void low() {
  digitalWrite(10, LOW);
  digitalWrite(11, HIGH);
  delayMicroseconds(45);
}

void high() {
  digitalWrite(10, HIGH);
  digitalWrite(11, LOW);
  delayMicroseconds(45);
}

void loop() {
  // put your main code here, to run repeatedly:
  high();
  low();
  high();
  low();
  low();
  high();
  low();
  delay(50);
}

and I can see some data in input, but with no printable characters �, and I wanted to know if I connected something wrong. Thanks!

The RS485 standard is more articulated than a simple "differential" signal. By the way it is half-duplex so on the same channel the data is transmitted and received at different times, this is achieved enabling the transmitter driver when necessary.

From you Arduino you have a UART signals within 0-5V for both TX and RX.
If you want to communicate to a PC you have several options, but almost none without any additional hardware.

Can't you use a cheap USB/TTL UART converter? Why do you actually need RS485 computed side?

Not really... there is a matter of drive strength, resistance to noise etc. If your electrical connection is perfect, it might work for either low baud rate or a short cable, and two nodes.

In your code you still need to generate at a baud rate compatible with the receiver, and also use the correct framing which is the same as RS232. I.e. a start bit, 8 data bits (or 7), odd/even/no parity, and 1 or 2 stop bits.

Why go to the work they make these: USB to RS485 485 Converter Adapter Support Win7 XP Vista Linux Mac OS WinCE5.0 | eBay? They are just a few dollars.

No, because you NEVER reverse the polarity of the two wires!

Yes, it is. But, as others have suggested, you have many more hills to climb, most of which aren't worth it to save yourself the inconvenience of a TTL-RS485 converter, such as a MAX485.

  1. turning around the bus (making it an input)
  2. impedance mismatches in both input and output modes
  3. transient suppression/immunity

The separate issues, of signal inversion, bit timing, etc. could be resolved by using, or cloning with changes, the standard software serial library.

But again I say, it's not worth it.

1 Like

With a pair of pins, one state is ALWAYS ground. RS-485 voltage does not relate to a ground, but to each pair of pins! The TWO lines switch polarity.

So why would everybody use RS485-TTL converters?
Anyway, Max485 module costs pennies.

Thanks for the answers! I reply with some context: using a converter is surely the best thing, but we are developing for a control unit with a small space available so we prefer to use as few board as possible. The PC we are using has a native 485, that's why we would like to use that. I get from your answers that using additional chipsets is probably inevitable, so I think we'll resort to the USB communication.

Can you please elaborate? My understanding is that it is not required for the "low" wire to be below ground

Ground is NOT involved with RS-485 or similar bi-polar communications standards. It is just as if you took a 1.5 volt battery and connected it to the two wires. Then removed and connected the battery the opposite way around. The communications occurs when the battery is rapidly switch one way and then the other. NO GROUND is involved.

Thanks! But then i think that's what i was saying: if i continuously switch between the two states

pin A 0v pin B 5v
     ^
     |
     v
pin A 5v pin B 0v

that is a differential signal?

Do you have a plan how to read it with arduino?

no, but reading what the others have said, i think i'll go with an external adapter

Of course you do. Arduino can't read any "differential signals".

Suppose i have the arduino sharing the ground with another device, that has a native 485 interface. If this second interface operates outside the range 0-5v, then i should be able to read the positive level saturating at 5v, and the negative at 0v, i think. then i should be able to detect the differential signal, because, assuming the clock is fast enough, i see the two pins one the opposite of the other

There's no common ground on RS485 differential signal. The signal is between A-A and B-B.

I think people are getting confused between differential signals and isolated signals. RS485 are not isolated; they are referenced to ground. You can connect a ground between two RS485 nodes. If no ground is connected, the ground effectively is local to the node. Both A and B are positive 0-5V referenced to ground.

i know, but if i know from the datasheet that the other device 485 signals are in a certain range, and the arduino is grounded to it, i can assume that on the pins i will read voltages in that same range

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.