Ethernet Shield for Arduino - W5200 Wiki - DFRobot

W5200 Ethernet Shield Instruction

This instruction shows you how to use DFRobot W5200 Ethernet Shield in Arduino IDE, taking UNO as an example.

Hardware Preparation

Hardware Connection

  1. Plug W5200 shield onto Arduino UNO board.
  2. Use a Ethernet cable to connect W5200 Shield's RJ45 port to a computer's Ethernet interface or router's LAN port that is in same local network.
  3. Connect UNO board with the computer via a USB cable.

Download W5200 Library

  1. Download "W5200 library" provided by Wiznet.
  2. Unzip the downloaded file"Ethernet-mater.zip" to the libraries folder in Arduino installing catalogue. As shown below:

Unzip

WebServer Sample Revising

  1. Find and open the unzipped files sample program "WebServer.ino".

Sample Program

  1. Open "WebServer.ino" in Arduino IDE, and add code in the program to define the IO connection between W5200 shield and UNO (For other mainboards, please revise according to actual IO connection), create a W5200 shield init function "DF_W5200_Init" and place it in setup for calling.
#define W5200_nSCS    10 
#define W5200_nRST    8 
#define W5200_PWDN    9
#define W5200_nINT    3 //unused
void DF_W5200_Init(void)
{
  pinMode(W5200_nSCS,OUTPUT);
  pinMode(W5200_nRST,OUTPUT);
  pinMode(W5200_PWDN,OUTPUT);
  pinMode(W5200_nINT,INPUT);    //unused
  digitalWrite(W5200_PWDN,LOW); //Normal Mode Enable
  digitalWrite(W5200_nRST,LOW); //Hardware reset
  delay(10);
  digitalWrite(W5200_nRST,HIGH);
  delay(200);
  Ethernet.init(W5200_nSCS);
}
  1. Revise IP address (please make sure that the modified IP address is in the same network segment as the computer and is not occupied by other devices.). For example, set W5200 shield IP as: 20.20.1.177, then the codes should be revised as below:

Revise IP Address

  1. Burn the program to UNO.

Test and Check

Open a browser and enter the IP address set for w5200 in Arduino code.

Test

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents