Author Topic: Arduino Ethernet between 2 boards rather than I2c  (Read 6590 times)

0 Members and 3 Guests are viewing this topic.

Offline retrotubeguyTopic starter

  • Contributor
  • Posts: 33
  • Country: au
Arduino Ethernet between 2 boards rather than I2c
« on: January 11, 2016, 12:37:45 am »
Hi there, I am an arduino newbie, actually I have not used it at all yet. I am looking at a problem that I would like to use arduino to solve. I need a way to switch several relays  with LED indication and some tricky logic hence the use of the arduino. The problem is I need to be able to do this from 2 locations and have the state of the relays mimic at both locations. For example If i was to press button 1 at location A energising a relay,  I would need to have the ability to go to location B and press button 1 there and de-energise the same relay. An LED indicator would need to show the state of the relay at both locations simultaneously. Can this be done using Ethernet between 2 arduino boards. I would like to connect directly from board to board. Must be reliable, noisy environment wireless is not an option. Can the arduino be programed to use RS 485 or can bus, something similar. Maximum distance between arduino’s would be around 10 metres.

Thanks Regards Mike :-//
Plate voltage is for men, TTL is for babies.
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 4034
  • Country: 00
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #1 on: January 11, 2016, 01:18:43 am »
This can be done without ethernet, using only simple (preferably 24V) relay/contactor logic. No arduino whatsoever required. Only a pice of long enough cable with enough wires.

You have to describe what you are trying to do more in detail, otherwise you can't expect close enough suggestion.

So at least tell us the number of relays to be controlled and the distance from the two control boxes.
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #2 on: January 11, 2016, 07:16:07 am »
I agree with Yansi. If you do need/want to use microcontrollers (such as Arduinos) on both sides you could look at the way MIDI cables transmit data (serial UART via current loops).
my random ramblings mind-dump.net
 

Offline AlxDroidDev

  • Frequent Contributor
  • **
  • Posts: 471
  • Country: br
    • Arduino Web Brasil
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #3 on: January 11, 2016, 01:00:19 pm »
Although I am a fanboy of AVRs, I gotta agree with Yansi on this one: if all you want is a 3-way switch for a relay, an Arduino is not required for it, but then again, we don't have enough info to suggest feasibility of one approach or another.


"The nice thing about standards is that you have so many to choose from." (Andrew S. Tanenbaum)
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #4 on: January 11, 2016, 01:05:10 pm »
For 10 mtrs you just need RS232 or  for a more versatile system, though more complex hardware,  you could use wireless / bluetooth.

All of these methods are well covered on the Arduino site, both hardware and software
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4319
  • Country: us
  • KJ7YLK
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #5 on: January 11, 2016, 01:25:08 pm »
I agree with @Yansi and @AndreasF and @AlxDroidDev.  Your description of the system is too vague for specific recomendations.

However, regardless of the complexity, I have some general observations about inter-connectivity over 10s of meters. First. I2C wasn't really designed for such long distances. People have done it, but I would recommend against it. 

Second, it is not clear what YOU mean by "ethernet"? Do you mean actually using an existing (or new) conventional IEEE 802.3 Ethernet?  Where you must assign (or use DHCP to acquire) node IP addresses and abide by all the protocol requirements?  Certainly there are systems where that is desirable because of distance or existing infrastructure, or because you are talking to something that already uses that interface*.

Or maybe you are talking about "ethernet" as simply using very inexpensive UTP cable (Unshielded Twisted Pair with four pair).  Indeed, using a balanced signaling protocol like RS-432 (point-to-point) or RS-485 (multi-point full duplex) is a method worth considering. It is much MUCH more easiy handled using simple microcontrollers (Arduino, et.al.) than using full 802.3 Ethernet.

However my favorite solution is to use inexpensive Arduino-like products that include full-duplex wireless transceivers.  My favorite is Moteino. Recommended, IME.

Ref:
RS-422: https://en.wikipedia.org/wiki/RS-422
RS-485:  https://en.wikipedia.org/wiki/RS-485
Moteino:  http://lowpowerlab.com/moteino/

* For example, I am working on some projects that interface with Blackmagic Designs video switching gear. It uses full-on 802.3 Ethernet   I am using ENC28J60 as an Ethernet controller/interface chip. It is probably the most popular Ethernet interface for Arduino-like microcontroller systems.
« Last Edit: January 11, 2016, 01:33:07 pm by Richard Crowley »
 

Offline wblock

  • Regular Contributor
  • *
  • Posts: 239
  • Country: us
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #6 on: January 11, 2016, 05:17:00 pm »
The NodeMCU ESP8266 board can also be programmed as an Arduino.  This is a small, cheap (under $10) board that supports standard 802.11b/g/n, so it can be used directly with normal networks.
 

Offline retrotubeguyTopic starter

  • Contributor
  • Posts: 33
  • Country: au
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #7 on: February 01, 2016, 03:13:17 pm »
Ok. Sorry Guys I was a bit vague. This is just a prototype at this point. What I am trying to do is switch at least 8 relays and leds from a remote location. The system will have a main control panel that will carry out all kinds of functions, including indicators some analogue stuff, temp and voltage sensing all at the master panel. It also need to take care of illegal conditions etc., Problem is, I would like to be able to initiate functions from the remote location and it must indicate the condition of the master. The remote panel can be disconnected at any time and the master control panel needs to remain functional. Trying to keep the conductor count down on the cable. and also trying to avoid RS232 etc. In some applications the remote panel would only be 5 to 10 m away. In this case a custom cable solution would do, power & data. I was hoping this could be done over Ethernet so that the distance would only be limited by the Lan limitations. It would also mean that the panel could be located  wherever lan is available. Possibly even POE.  I am aware that there are products out there that can do this kind of thing like Modbus,Rs485 over Ethernet for example but, I am trying to make this as proprietary as possible and with a micro I should be able to make changes easily as the system evolves. I would like to power the remote from the master for some applications and for distant Lan setups local power to the remote is fine. I am just not sure what the Arduino Ethernet shield allows you to do. Some have told me that I can run the I2C bus over a twisted shielded pair 5 metres away without a problem. As far as I am aware it is only intended for short runs like between modules & shields. Never tested this myself. I have some Uno’s and Mega’s on the way.

Its probably still a little vague as this is still just a conceptual thing. Maybe I should mess around with the Arduino first and learn a little more about it before I go asking you guys wired questions.

Thanks again.
 :palm:
Plate voltage is for men, TTL is for babies.
 

Offline retrotubeguyTopic starter

  • Contributor
  • Posts: 33
  • Country: au
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #8 on: February 01, 2016, 03:24:55 pm »
Sorry Richard C, I did not read your post carefully. I am a bit tired at the moment. I will consider you recommendations. Existing lan would be great. Point to point was the plan to begin with. Not so concerned about using UTP. I was more interested in actually using the LAN its self so It would slot into an existing network. using Ethernet for the point to point would also be an option. Don’t like wireless for this application. The are times where there could be many wifi devices in close proximity and lots of electrical noise, metal structures and so on. I have allot to think about now. So I will do some thinking before I come back to you all. Thanks for the advice. :=\
Plate voltage is for men, TTL is for babies.
 

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #9 on: February 01, 2016, 06:29:48 pm »
In some applications the remote panel would only be 5 to 10 m away. In this case a custom cable solution would do, power & data. I was hoping this could be done over Ethernet so that the distance would only be limited by the Lan limitations. It would also mean that the panel could be located  wherever lan is available. Possibly even POE.  I am aware that there are products out there that can do this kind of thing like Modbus,Rs485 over Ethernet for example but, I am trying to make this as proprietary as possible and with a micro I should be able to make changes easily as the system evolves. I would like to power the remote from the master for some applications and for distant Lan setups local power to the remote is fine.

Those are really two quite different use cases. If you are using Ethernet, you can make use of ethernet infrastructure such as routers, DHCP, DNS, NTP etc. If you are point to point, you might not even need a hub but would not have access to all those other services.

Arduino used to do an Ethernet shield with POE module, I think it got canned, but there are some cheap alternatives available.

Not sure what "proprietary as possible" means, Ethernet is all open standards. I don't think you want to develop your own ethernet protocols?

For point to point, Ethernet is overkill, and RS232 or RS485 would do fine. You don't have high speed data requirements. Not sure what you have against RS232, it is cheap and simple. If you prefer use RS485, it's also cheap and only slightly less simple.

If you are new to Arduino I would recommend going for the simple option first. You should be able to get the application working with 232/485, and then if you want to have the LAN option then get hold of the Ethernet shields, but bear in mind it will be a little more complex and you will also need ethernet hubs that support PoE. It should be possible to also use those for a point to point link with a crossover cable, and maybe some custom connection to provide power from the master device.
Bob
"All you said is just a bunch of opinions."
 

Offline Pack34

  • Frequent Contributor
  • **
  • Posts: 754
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #10 on: February 01, 2016, 09:24:35 pm »
I'd go with RS485. Much longer distances than Ethernet and RS-232. Really easy to implement, supports multiple masters and slaves, robust, etc. I think you're making the system a bit unnecessarily complicated by adding Ethernet onto it.

If you really want to add a web-page or something for an external control, I would have one unit setup as being connected to an external router and have it send down control data over a shared 485 bus.

EDIT:// If you want to make it as proprietary as possible, you could look at throwing some light encryption on the output data or play around with some basic compression.
« Last Edit: February 01, 2016, 09:47:55 pm by Pack34 »
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4319
  • Country: us
  • KJ7YLK
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #11 on: February 01, 2016, 09:52:19 pm »
Yes, you will need to explain what you mean by "proprietary as possible".

Using full-on 802.3 Ethernet protocol is enormously complex to the point where you will need a SECOND microcontrotroller just to do the Ethernet communication. That is why I am using ENC28J60 which is essentially a second "Arduino" specially programmed to handle Ethernet.  It also makes connection configuration for the user orders of magnitude more "fiddly".  Of course if this is just a one-off for your own amusement that is one thing. But if this is something you expect others to use (and especially install, configure, re-configure, etc.) then using Ethernet is a major escalation of complexity.

The kind of wireless products I was suggesting do NOT share the same bandwidth as WiFi or BlueTooth, etc.
« Last Edit: February 01, 2016, 09:54:14 pm by Richard Crowley »
 

Offline Pack34

  • Frequent Contributor
  • **
  • Posts: 754
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #12 on: February 01, 2016, 10:00:44 pm »
Yes, you will need to explain what you mean by "proprietary as possible".

Using full-on 802.3 Ethernet protocol is enormously complex to the point where you will need a SECOND microcontrotroller just to do the Ethernet communication. That is why I am using ENC28J60 which is essentially a second "Arduino" specially programmed to handle Ethernet.  It also makes connection configuration for the user orders of magnitude more "fiddly".  Of course if this is just a one-off for your own amusement that is one thing. But if this is something you expect others to use (and especially install, configure, re-configure, etc.) then using Ethernet is a major escalation of complexity.

The kind of wireless products I was suggesting do NOT share the same bandwidth as WiFi or BlueTooth, etc.

Speaking of wireless. With the little amount of data that's going to be needed with these, a simple nRF24 module would work well. They get fair range and you can always use an actual antenna to get more range.
 

Offline Morgoroth

  • Regular Contributor
  • *
  • Posts: 123
  • Country: cl
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #13 on: February 02, 2016, 06:42:44 am »
What about ZigBee ?, not my favorite option, but is very easy to make transparent communications and there is a bunch of projects related using arduino. Maybe just to start and make a prototype very quickly.
----------------------------------------------------------
If works, doesn't means it is right.
 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 2008
  • Country: ch
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #14 on: February 02, 2016, 02:38:06 pm »
Yes, you will need to explain what you mean by "proprietary as possible".
I think he actually wants to mean independent/flexible...
 

Offline Pack34

  • Frequent Contributor
  • **
  • Posts: 754
Re: Arduino Ethernet between 2 boards rather than I2c
« Reply #15 on: February 15, 2016, 09:38:42 pm »
What path did you end up going with this?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->