Arduino Ethernet between 2 boards rather than I2c - Page 1
Forum section: electronics / general

author: retrotubeguy
author_rank: Contributor
timestamp: January 11, 2016, 12:37:45 am
content: 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

author: Yansi
author_rank: Super Contributor
timestamp: January 11, 2016, 01:18:43 am
content: 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.

author: AndreasF
author_rank: Frequent Contributor
timestamp: January 11, 2016, 07:16:07 am
content: 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).

author: AlxDroidDev
author_rank: Frequent Contributor
timestamp: January 11, 2016, 01:00:19 pm
content: 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.

author: picandmix
author_rank: Frequent Contributor
timestamp: January 11, 2016, 01:05:10 pm
content: 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

author: Richard Crowley
author_rank: Super Contributor
timestamp: January 11, 2016, 01:25:08 pm
content: 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-422RS-485:https://en.wikipedia.org/wiki/RS-485Moteino: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.

author: wblock
author_rank: Regular Contributor
timestamp: January 11, 2016, 05:17:00 pm
content: TheNodeMCUESP8266 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.

author: retrotubeguy
author_rank: Contributor
timestamp: February 01, 2016, 03:13:17 pm
content: 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.

author: retrotubeguy
author_rank: Contributor
timestamp: February 01, 2016, 03:24:55 pm
content: 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.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: February 01, 2016, 06:29:48 pm
content: Quote from: retrotubeguy on February 01, 2016, 03:13:17 pmThose 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.

author: Pack34
author_rank: Frequent Contributor
timestamp: February 01, 2016, 09:24:35 pm
content: 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.

author: Richard Crowley
author_rank: Super Contributor
timestamp: February 01, 2016, 09:52:19 pm
content: 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.

author: Pack34
author_rank: Frequent Contributor
timestamp: February 01, 2016, 10:00:44 pm
content: Quote from: Richard Crowley on February 01, 2016, 09:52:19 pmSpeaking 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.

author: Morgoroth
author_rank: Regular Contributor
timestamp: February 02, 2016, 06:42:44 am
content: 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.

author: Kilrah
author_rank: Unknown
timestamp: February 02, 2016, 02:38:06 pm
content: Quote from: Richard Crowley on February 01, 2016, 09:52:19 pmI think he actually wants to mean independent/flexible...

author: Pack34
author_rank: Frequent Contributor
timestamp: February 15, 2016, 09:38:42 pm
content: What path did you end up going with this?