Communication Question

What is your opinion on the best way to communicate with 2 Arduino's to monitor and control each from custom software?

My thought was to communicate with at least one of them through ethernet, but how should the two communicate with each other?

Also, what is the best way to differentiate between the two in the software?

Depends how far apart they are and how fast they need to talk.
Incomplete question - too vague.

I2C ? one of the cheapest as it doesn't need additional hardware (OK cables)

Could you tell us more about the purpose of the application? To get an idea what might be needed?

I work on ships and basically the system will act as an alarm panel and controller for some alarms. For instance, if the bilge level gets too high it will either automatically start the bilge pump or sound an alarm and wait for a manual command to start the pump.

As for length, probably under 100 feet.

You mention a bilge pump. I assume it's driven by an electric motor. How close will the communication line be to the motor? How big is the motor?

What about other EMI sources? Will the communication line run near fluorescent lights? How about AC lines?

You mentioned ethernet. Is that already on the ship? Is it reliable?

The bilge pump is a 15HP 3phase 480v pump. EMI has never really been a big issue with the existing ethernet, CAN, and low voltage signals and the controllers won't be near any EMI sources.

Basically my thought is to use one Arduino as an input device and the other as an output device. I'm trying to figure out the best way to get the input device to communicate with the output device when necessary. Should I just do the routing through the software I'll be writing (python)?

For comms between the two Arduinos I'd just use simple RS-485 and software serial with a simple protocol. Then if one of them is near the computer just use the standard USB connection for that link.


Rob

@Graynomad

I'd just use simple RS-485 and software serial with a simple protocol.

What converter(s) do you use for rs485?

Obviously there's going to be more than one way to accomplish this. I'm just curious how any of you would do it.

I'd pick between RS-485 and CANBUS. But I like a challenge.

RS-485 is only the physical layer. Even though examples abound, all of the protocol has to be developed. There is almost no driver work but lots of protocol work.

CANBUS provides a data-link layer (e.g. retries and error detection are provided by the CANBUS controller). I have not searched but I suspect good examples for Arduino / AVR are probably a bit hard to find. There is lots of driver work but not much protocol work.

Obviously there's going to be more than one way to accomplish this. I'm just curious how any of you would do it.

I'd get two arduinos and 100' of four conductor cat4 telephone wire, connect the arduinos together tx/rx and gnd/gnd, and start experimenting.

What converter(s) do you use for rs485?

Sorry, been away for cupla daze.

I'd be looking at the LTC1487, MAX1482, ADM483 etc.

Ccc56: As CD says 485 is only a phyiscal layer you still need to write a protocol and AFAIK there is no simple standards. From what I can see you have a very simple application with no control, just monitoring. Not having control makes a big difference, you can get away without massive security.

I'd just have the remote Ardiuno send a few bytes indicating the status of the bilge etc. Add a checksum and maybe a frame sequence counter so the receiving Arduino knows if there's been a stuff up in the transmission. Also have a timeout so you know if the link has failed.

The worst case then is that you get too many false alarms which either isn't a big problem or then you look into hardening up the protocol.

The receiving Arduino then just talks USB ot the PC.

If you want to get some idea you can have a look at one of my current toy projects (http://busnet.robgray.com), this is overkill for what you need I think although if it was a going concern I would suggest it would do nicely.


Rob

Ccc56: As CD says 485 is only a phyiscal layer you still need to write a protocol and AFAIK there is no simple standards. From what I can see you have a very simple application with no control, just monitoring.

Modbus is a popular protocol often used in 485 networks. I think there are even a couple of Arduino Modbus libraries around. arduino modbus - Google Search

Lefty