Ethernet Shield for Arduino – a walkthrough
walkthrough
The Arduino board can be connected to the Internet using this Ethernet Shield which is based on the
WIZNET W5100 Ethernet chip . The Wiznet W5100 provides a network (IP) stack capable of both TCP and UDP.
WIZNET W5100 is the classic one , widely used by Arduino.CC .
WIZNET W5500 is used by Arduino.ORG & is referred as Ethernet shield 2.
We shall use the classic Ethernet shield W5100 in this post.
The shield has long pin headers to plug on the Arduino (UNO or MEGA). Other shields can be stacked on top of this board.There is an onboard micro-SD card slot, which can be used to store larger files.
The Ethernet Library is used to write sketches which connect to the internet using the shield. You need not download the library , as it is inbuilt in Arduino IDE.
The on-board micro SD card reader is accessible through the SD Library. Both the SD card reader & Ethernet board work on SPI bus .
The shield also includes a reset controller, to ensure that the W5100 Ethernet module is properly reset on power-up.
This board is different from the economy version using ENC28J60 device.The library for this ENC is different , ETHERSHIELD library hosted by NANODE project.Libraries are different for WIZNET board & ENC board.
Arduino communicates with both the W5100 and SD card using the SPI bus (through the ICSP header). This is on digital pins 10, 11, 12, and 13 on the Uno and pins 50, 51, and 52 on the Mega.
On both boards, pin 10 is used to select the W5100 and pin 4 for the SD card. These pins cannot be used for general I/O. On the Mega, the hardware SS pin, 53, is not used to select either the W5100 or the SD card, but it must be kept as an output or the SPI interface won’t work.
As the W5100 and SD card share the SPI bus, only one can be active at a time. If you’re not using one of the peripherals in your program, however, you’ll need to explicitly deselect it. To do this with the SD card, set pin 4 as an output and write a high to it. For the W5100, set digital pin 10 as a high output.