In compliance with high industry standards

|| Back to Support & Help Documentation ||

LoRa Family Ethernet

Ethernet  is the technology that is most commonly used in  wired local area networks  ( LANs ). A LAN is a  network  of computers and other electronic devices that covers a small area such as a room, office, or building. It is used in contrast to a  wide area network (WAN) , which spans much larger geographical areas. Ethernet is a  network protocol  that controls how data is transmitted over a LAN. Technically it is referred to as the IEEE 802.3 protocol. The protocol has evolved and improved over time to transfer data at the speed of a gigabit per second.

Our Arduino Based PLCs incorporate the integrated W5500 IC.

WX5500 is a Hardwired TCP/IP embedded Ethernet controller that provides easier Internet connection to embedded systems. This chip enables users to have Internet connectivity in their applications by using the single chip in which TCP/IP stack, 10/100 Ethernet MAC and PHY are embedded. The W5500 chip embeds the 32Kb internal memory buffer for the Ethernet packet processing. With this chip users can implement the Ethernet application by adding the simple socket program. SPI is provided for easy integration with the external microcontroller.

                                                                                                             W5500 Block Diagram

Client/Server model

Ethernet uses the Client/Server model in order to stablish communication between the different devices that are part of the network.

Client/server is a program relationship in which one program (the client) requests a service or resource from another program (the server).
Although the client/server model can be used by programs within a single computer, it is a more important concept for networking. In this case, the client establishes a connection to the server over a local area network (LAN) or wide-area network (WAN), such as the Internet. Once the server has fulfilled the client's request, the connection is terminated. Your Web browser is a client program that has requested a service  from a server; in fact, the service and resouce the server provided is the delivery of this Web page

The client sends a "request", and the server answers with a "response". In other words, the client asks a question (request), and the server answers it (responds). If the client doesn't make any requests, the server doesn't respond.

This is a simple and robust means of communication. Another way to look at is is to imagine how you use a web browser to surf the internet. When you click on a link, you send a "request" to a web server asking for a web page. The web server sends you the web page you asked for and then patiently waits for the next request.

Client/Server model using HTTP


Check the LoRa Family products now!

IMPORTANT: Make sure that your Ethernet PLC is powered (12-24Vdc).

Switch configuration

For the Ethernet communication protocol there isn’t any switch that affects it. So it does not matter the configuration of the switches to implement Ethernet communication.

Used pins

For Ethernet communication protocol, the defined Arduino Mega pin is pin 10, which is connected to the WX5500 Ethernet controller. W5500 IC communicates to the Mega board via SPI busYou can access easily to Ethernet port in our Ethernet PLCs, it is located at the top of the communications layer. 


Make sure to download the Arduino based PLC boards for Arduino IDE.

Software Configuration:

Once the hardware configuration is done, it is possible to proceed with the software configuration and also its usage. Firstable it is necessary to include the Ethernet.h library provided by Industrial Shields.

#include <Ethernet.h>

                                              Remember that for the V7 version or earlier versions you must use the <Ethernet.h> library.

                                              Ethernet Library - functions:

                                               Ethernet.h has 5 differentiated classes, which are shown below:

                                              - Ethernet class:

                                              The Ethernet class initializes the ethernet library and network settings.

                                              • functions:

                                              - Server Class:

                                              The Server class creates servers which can send data to and receive data from connected clients (programs running on other computers or devices).

                                              • functions:

                                              - Client Class:

                                              The Client Class create clients that can connect to servers and send and receive data.

                                              • functions:

                                              EthernetUDP Class:

                                              The EthernetUDP Class enables UDP message to be sent and received.

                                              • functions:

                                              Example Codes:

                                              Echo TCP Server:

                                              Once the server is running, any client can connect to the server. On this example it is used an M-Duino to generate the server. The example of TCP client showed before could be one of the clients.

                                              Next it is showed the Arduino IDE code:

                                              // use Ethernet.h if you have a M-Duino V7 version
                                              #include <Ethernet.h>
                                              // mac address for M-Duino
                                              byte mac[] = { 0xBE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
                                              // Ip address for M-Duino
                                              byte ip[] = { 192, 168, 1, 100 };
                                              int tcp_port = 5566;
                                              EthernetServer server = EthernetServer(5566);
                                              void setup()
                                                // initialize the ethernet device
                                                Ethernet.begin(mac, ip);
                                                // start server for listenign for clients
                                              void loop()
                                                // if an incoming client connects, there will be bytes available to read:
                                                EthernetClient client = server.available();
                                                if (client.available()) {
                                                  // read bytes from the incoming client and write them back
                                                  // to the same client connected to the server

                                              Echo TCP Client:

                                              Once the server is running, M-Duino can connect to the server. On this example it is used an M-Duino to connect with the Node.js server called server.js, the same as used on previous example link.

                                              To configure the M-Duino, this post just follows the TCP example from Arduino web site with a few changes. To be able to connect to the server we must know the TCP server IP and the port where this server is listening. 

                                              Next it is showed the Arduino code:

                                              #include <Ethernet.h>
                                              #include <SPI.h>
                                              byte mac[] = { 0xBE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
                                              byte ip[] = { 192, 168, 1, 100 };
                                              byte server[] = { 192, 168, 1, 105 }; // Touchberry Pi Server
                                              int tcp_port = 5566;
                                              EthernetClient client;
                                              void setup()
                                                Ethernet.begin(mac, ip);
                                                if (client.connect(server, tcp_port)) { // Connection to server.js
                                                  Serial.println("Connected to server.js");
                                                } else {
                                                  Serial.println("connection failed");
                                              void loop()
                                                if (client.available()) {
                                                    char s =;
                                                    client.write(s); // Send what is reed on serial monitor
                                                    char c =;
                                                    Serial.print(c); // Print on serial monitor the data from server 
                                                if (!client.connected()) {

                                              By following these steps carefully, you will be able to achieve the use of the Ethernet protocol using the Industrial Shields equipments.

                                              1 Star 2 Star 3 Star 4 Star 5 Star