1
\$\begingroup\$

I want to connect Arduino UNO boards using an Ethernet LAN network. There will be one Master and others will be slaves which are connected using an Ethernet switch and a router. I want to know how I can do this with Arduino. I don't have any experience in networking so I want some suggestions from you. Do I need an Ethernet shield? If yes, will this shield do the purpose?

\$\endgroup\$

2 Answers 2

3
\$\begingroup\$

Do you really have to use Ethernet for this?
If not I'd suggest you to build your network based on an I2C Network.

You could save some money, because you wouldn't need the Ethernet hardware. Perhaps it could be a problem with the switches etc, but if you use I2C with only one Master that would be very easy.

If you plan to connect your network you could also setup your master node to have an Ethernet shield and connect it as the only one to the web, the other ones would than get the data from the master.

Of course you can use Ethernet if you want, but I would give I2C a try.

\$\endgroup\$
5
  • \$\begingroup\$ Oh, no... I didn't know about that... :( \$\endgroup\$
    – evotopid
    Jul 25, 2012 at 14:24
  • \$\begingroup\$ * I2C wouldn't work well over distances of a few meters.. \$\endgroup\$
    – m.Alin
    Jul 25, 2012 at 15:13
  • 1
    \$\begingroup\$ Something like RS485 would work over longer distances while still keeping hardware cost and code size contained. \$\endgroup\$ Jul 25, 2012 at 22:22
  • \$\begingroup\$ @m.Alin:Is it like a router? It has area range. \$\endgroup\$
    – Thong Eric
    Jul 26, 2012 at 3:01
  • 2
    \$\begingroup\$ @ThongEric Yes, it has a range. The length of the I2C bus shouldn't be greater than a few meters. For longer distances I suggest you look into RS485 or the CAN protocol. \$\endgroup\$
    – m.Alin
    Jul 26, 2012 at 10:15
4
\$\begingroup\$

The most common and easy option to have ethernet on Arduino, is indeed the ethernet-shield. Other being the Ethernet-Arduino, which is ethernet on the Arduino board itself, in stead the functionality being on a shield. There are few more, less commonly seen shield options.

The best place to start reading up regarding Ethernet on Arduino is: http://arduino.cc/it/Reference/Ethernet and http://arduino.cc/en/Main/ArduinoEthernetShield You might find some useful information here: http://www.ladyada.net/learn/arduino/ethfiles.html

Note that TCP (Server/Client), UDP and DHCP (for IP address assignment) is supported, but not much else, especially no IPsec, no SSL, no extensive routing capabilities, Bonjourno etc. Also, I believe that the entire TCP specification is not supported, but only minimal necessary (need to double check if Fast-start, Nagles algo etc. are supported).

For closed, private networking, this may be enough, however if you plan on exposing your devices directly on public internet (s.a. pushing sensor reading to Pachube, or receiving control commands from website), you would probably have to think through about security.

As for the specific board you mentioned, do note that there are several cheaper clones of the official Ethernet-shields. The easiest (but certainly not the cheapest) option is to use Sparkfun's Ethernet-shield: http://www.sparkfun.com/products/9026 ! Apparently, if you have a R3 UNO, you need the R3 version of this shield, as sold by Sparkfun. Read the note towards the bottom of the item desciption.

As for networking itself, if you use TCP, then your designated Arduino "master" needs to be programmed as a "Server" and rest of the Arduinos as "Clients". The Server listens on a published port-number and it's IP address, where-as the Clients connect from their own IP address to the Server on the published common IP+port combination. Physically, you connect them using straight ethernet-cables, in a star-topology, via an Ethernet-switch with sufficient no. of ports. Of course, if the number of nodes is very high, you may have to create a chain of stars using multiple switches.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.