Go Down

Topic: Communication Question (Read 1 time) previous topic - next topic

Ccc56

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?

AWOL

Depends how far apart they are and how fast they need to talk.
Incomplete question - too vague.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

robtillaart

I2C ? one of the cheapest as it doesn't need additional hardware (OK cables)
http://www.arduino.cc/en/Tutorial/MasterReader

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

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Ccc56

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.

Coding Badly


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?

Ccc56

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)?

Graynomad

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

Rob Gray aka the GRAYnomad www.robgray.com

robtillaart

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

What converter(s) do you use for rs485?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Ccc56

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

Coding Badly


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.

zoomkat

Quote
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.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Graynomad

#11
Nov 29, 2010, 05:07 am Last Edit: Nov 29, 2010, 05:12 am by graynomad Reason: 1
Quote
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

Rob Gray aka the GRAYnomad www.robgray.com

retrolefty

#12
Nov 29, 2010, 05:16 am Last Edit: Nov 29, 2010, 05:18 am by retrolefty Reason: 1
Quote
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. http://www.google.com/search?sourceid=navclient&aq=0&oq=arduino+mod&ie=UTF-8&rlz=1T4GGLL_enUS373US373&q=arduino+modbus

Lefty

Go Up