Communicating with an Arduino that is relatively far away

I will try and draw a schematic, but knowing my drawing skills I'm afraid it might not make things a whole lot clearer :wink:

So A goes to A and B goes to B. The datasheet did have an example but it was a bit unclear to me how they were supposed to be connected because the schematic showed the wires as being twisted and I couldn't figure out what went to what.

Here we go... This is the first time I've ever used Eagle or drawn a schematic and I can't say that I really know what I'm doing :wink: So I'm guessing it's not going to be all that great. I found the drawing process a bit frustrating so I only did one side for now.

Does that look like it would work? Or do I need to connect the unconnected pins to something too?

C1 and C2 look suspicious.

I thought so too.. But the example schematic was a bit unclear again to a schematic noob like myself.

This is what's in the datasheet:

If they didn't mean what I had in the previous schematic, how is this one?

That looks better (the capacitors; someone else will have to comment on the rest).

RE is active low, on the right-hand chip it's pulled high.


Rob

Graynomad:
RE is active low, on the right-hand chip it's pulled high.


Rob

Aha, thanks for that hint! I thought something might be up with it, with the slash after the name or the "overscore". Learning by doing, I guess :wink:
So I need to connect it to ground on the right side one then.

I found this table in the datasheet:

So on the left side, RE can be disconnected, DE to VCC.
On the right side, RE to GND, DE can be disconnected.

Like this?

On the remote end you really should ground pin 3, DE, to make sure it's transmit driver is forced off into tri-state mode.

Lefty

retrolefty:
On the remote end you really should ground pin 3, DE, to make sure it's transmit driver is forced off into tri-state mode.

Lefty

According to the table it shouldn't care but I guess better safe than sorry :wink:

Version 4 then:

the slash after the name or the "overscore"

Also the small circle on the graphic, on chips that means an active low or inverted signal.

Just some notes about schematic layout.

If you mirror image the remote chip the drawing will be a lot clearer.

When things are tied to power rails it's almost always better (clearer) to have VCC going up and GND going down. Your caps go up.

Most beginners make a real dog's breakfast by running the GND wire to every possible place. You haven't done that which is good, in this case however I would argue that because these chips are physically remote from each other you should draw the GND line between the two to reinforce that they have to have a common GND and that that is formed by a GND wire in the cable.


Rob

Thanks for the helpful hints Rob, I appreciate it!

How do you like this? It does look a lot clearer :slight_smile:

Graynomad:

the slash after the name or the "overscore"

Also the small circle on the graphic, on chips that means an active low or inverted signal.

Just some notes about schematic layout.

If you mirror image the remote chip the drawing will be a lot clearer.

When things are tied to power rails it's almost always better (clearer) to have VCC going up and GND going down. Your caps go up.

Most beginners make a real dog's breakfast by running the GND wire to every possible place. You haven't done that which is good, in this case however I would argue that because these chips are physically remote from each other you should draw the GND line between the two to reinforce that they have to have a common GND and that that is formed by a GND wire in the cable.


Rob

Actually these don't require a common ground between the local and remote chips, that is one of the advantages of the A/B signals being a true differential signal pair. I'm sure some will disagree with this, but I would say hold off until you actually test such a link using independent power sources at each end, it will continue to work without a common ground wire between the pair.

Lefty

Your probably right, but I'm kind of a belt and suspenders kind of guy and like to hardware the control signals when I know they are never going to be switched.
Lefty

Welcome to the world of conflicting opinions Nico. This is one of the common dichotomies like Canon/Nikon, Ford/GM etc.

I have experience with RS-485 but Lefty has made a career of using it in very bad environments, so I'll bow to him on this while retaining the right to differ :slight_smile:

IMO the schematic is much clearer now.


Rob

Thanks guys, really appreciate your input! :slight_smile:

One more question then. Over here, Icc is specified as 0.375 mA typical, the PDF datasheet I have says max 1.000 mA. So I assume it will be safe to power the chips from the Arduinos 5V if the local Arduino is USB powered?

Certainly.

I have experience with RS-485 but Lefty has made a career of using it in very bad environments

Why use RS485 though rather than RS422 if there is no need to multidrop?

I don't think it matters here. 485 has better common-mode voltage specs, and I think the chips are easier to find and there's a larger range, but either is good I think.


Rob

Yes either can be made to work as long as the driver chip on one end is the same 'flavor' as the receiver chip at the other end.

By the way Wikipedia shows a good three resistor termination method one can use on the receiver end of each path (if using two pair full duplex) which will ensure no false data hits due to noise in case the far end of a link is powered off, it's shown in the first picture showing a series 680 ohm, 120 ohm, 680 ohm resistors wired to the recievers Vcc and ground and A and B signal pins. Good idea.

Lefty

I finally got around to finishing this up.. And wanted to update the thread with some findings.
The first is that the remote/RX end pin 3/DE must in fact be grounded. I just got garbage if I didn't ground it.
The other is that B on one end must be connected to B on the other end, and A to A. Connecting B to A and vice versa also gave garbage.
It seems to work fine without the resistors too, but I assume that may change with longer distances so I put them there anyway.
Figured this stuff might be good to know.

The chips I'm using are MAX3082E. Amazingly everything worked as expected the first time I connected it, I had to actually disconnect some stuff to make sure it wasn't just the software fooling me :wink: This weekend we'll test with a longer cable in between.

Thanks again for all the help!