Pages: [1]   Go Down
Author Topic: Communication Question  (Read 1081 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24353
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

"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.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12451
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob Tillaart

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8451
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12451
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Graynomad
Quote
I'd just use simple RS-485 and software serial with a simple protocol.
What converter(s) do you use for rs485?
Logged

Rob Tillaart

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

0
Offline Offline
Tesla Member
***
Karma: 115
Posts: 8932
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8451
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

« Last Edit: November 28, 2010, 11:12:08 pm by graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16518
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: November 28, 2010, 11:18:36 pm by retrolefty » Logged

Pages: [1]   Go Up
Jump to: