In this tutorial, you will learn about Arduino Ethernet shield . Whenever we come to the selection of development boards Arduino pops up in our mind as they are cost effective, open source hardware and software and most important feature is extensible. We can use Arduino as a standalone project but when it comes to some specific features like connection to internet (wirelessly or wired) or to interface with motors etc. then a comparatively expensive adapter known as shield comes handy. you may also like to read these:
In this article, we are going to discuss a specific shield of Arduino known as ETHERNET shield which provides internet connectivity to Arduino board. We will discuss about its pin configuration with Arduino , requirements , informational LED’s , how to assign addresses to it and last but not least we will list some projects in which this shield is used.
Ethernet Shield allows internet connectivity to Arduino board by using its Ethernet library. We can use this Ethernet library to write sketches (Arduino program written in IDE) that will help us to configure this shield to connect to internet. This shield is compatible with almost all versions of Arduino boards. It enables our board to receive and send data worldwide by providing it internet connection. SD card option is also available in it and we can write and read this card by using SD library. Endless amount of possibilities are provided by just allowing your project to connect to internet.
This shield relies on Wiznet W5100 chip Ethernet with internal buffer space of 16 KB. It can support up to 4 simultaneous socket connections. This chip provides a network IP stack which is capable of both transport layer protocol of internet i.e. TCP (transmission control protocol) and UDP (user datagram protocol). TCP provides more reliable service of transporting messages as compared to UDP and much more features of these 2 protocols are there but that’s not our concern in this article right now. We are simply focused on providing our board internet connectivity via this shield.
The newer version of this shield relies on W5500 Ethernet chip having 32 KB buffer size, supports auto negotiation and supports I2C , UART interface. By making use of long wire warp headers for connecting Ethernet shield to Arduino board keeps the pin layout intact and other shields can be stacked on top of it.
We have to plug this shield on our Arduino board but below are some mandatory requirements:
One important thing that is to be noted here is that both SD card and W5100 share SPI bus as Arduino communicates via SPI port so we can use only one of them. If we want to use both of them then we have to check their corresponding library.
This shield comes up with numerous informational LEDs. Some of which are listed below:
Ethernet Arduino connectivity can be used in two ways:
Check this tutorial to know how to interface Arduino Ethernet shield with Arduino Uno
The general pin configuration of Arduino and Ethernet shield is given below. However, it may vary from model to model so a description is also given to avoid confusion.
There is one precautionary measure that the hardware SS pin i.e. pin D 53 is although SPI pin but it cannot be used to select either W5100 or SD card but it should be kept as an output or our SPI interface will not work.
By keeping all these points in our mind we can mount our shield on top of our Arduino board and then connect it to our computer via USB cable. Once our sketch (Arduino program made in IDE) is uploaded we can disconnect our board from the computer and then power it by using an external power supply.
Each and every device that is connected to the internet has an address known as IP / MAC address which is analogous to our home addresses. As our complete home addresses are unique globally our MAC addresses are also unique. IP addresses are may be fixed or changed depending on how we are going to configure our network. We will not go in the details of these IP / MAC addresses as our concern is only limited to how our Arduino will get an IP address once it has internet connectivity. These addresses help us to identify devices on the network so that data can be received or sent from other devices.
Addresses that are used to identify devices are of two types:
MAC address is always unique and is assigned to every device during the manufacturing process. So our device will already be having a MAC address and it will be written on the sticker attached on our board. For IP address assigning we will connect our Arduino board to our router and our router will automatically assign an IP address to our device and it will be fixed unless and until our device is not turned off. Once our device is turned off then when we will repeat the same procedure of assigning an IP address we may or may not get a different IP address. The main purpose of the router is to manage all IP addresses of that particular area and allows them to communicate.
If you want to check the IP address assigned to your device, simply use of the preloaded sketch “DHCP Address Printer” and then open the serial monitor. Your IP address will be printed on that.
Some of the projects which are done using Ethernet shield are listed below: