Arduino Ethernet Shield Tutorial

Picture of Arduino Ethernet Shield Tutorial
The Arduino Ethernet Shield allows you to easily connect your Arduino to the internet. This shield enables your Arduino to send and receive data from anywhere in the world with an internet connection. You can use it to do fun stuff like control robots remotely from a website, or ring a bell every time you get a new twitter message. This shield opens up endless amounts of possibility by allowing you to connect your project to the internet in no-time flat.
Remove these adsRemove these ads by Signing Up

Step 1: Setup

Picture of Setup
Setting it up is as simple as plugging the header pins from the shield into your Arduino.

Note that the Ethernet Shield sold at Radioshack is online compatible with Arduino Uno Rev. 3 boards (or later). It has too many pins to plug into earlier version Arduino boards.

Step 2: Shield Features

Picture of Shield Features
The Ethernet Shield is based upon the W51000 chip, which has an internal 16K buffer. It has a connection speed of up to 10/100Mb. This is not the fastest connection around, but is also nothing to turn your nose up at.

It relies on the Arduino Ethernet library, which comes bundled with the development environment.

There is also an on-board micro SD slot which enables you to store a heck-of-a-lot of data, and serve up entire websites using just your Arduino. This requires the use of an external SD library, which does not come bundled with the software. Using the SD card is not covered in this Instructable. However, it is covered in the Step 8 of the Wireless SD card instructable.

The board also has space for the addition of a Power over Ethernet (PoE) module, which allows you to power your Arduino over an Ethernet connection.

For a full technical overview, see the official Ethernet Shield page.
Simsso2 months ago
Hi all!
Does anyone know, how to give people, who are not in the local network, access to the Arduino Server?
tamberg Simsso10 days ago

Another option is using a relay service like (disclosure: I'm a founder).

jelimoore Simsso2 months ago

Port forward. Depending on what router you have, you SHOULD, I mean SHOULD be able to.

wasimxxl5 months ago
can any one help me please ??

i wont to use arduino in my project ..
i wont ardino send alarm to my androin phone 'by internet ' whin the Bell home is ring
What are the pieces that will I need ??
remember by internet no IRir no blotooth
thank you
kgwolf wasimxxl2 months ago

it's been a few months since you posted this; were you able to get answers to your questions?

ckrmustafa4 months ago
Hi everyone. I am new at Arduino. When I have tried to use the skettch in "File --> Examples --> Ethernet --> DhcpAddressPrinter" I am getting "Failed to configure Ethernet using DHCP" message on Serial Monitor. Could anyone explain what the reason is this message?
Note: I changed the MAC address as 0x22, 0x7A, 0xFE, 0xFC, 0xFE, 0xF2 in code file.
Dylon1245 months ago
I know this sounds dumb but where how did you find your ip?
randofo (author)  Dylon1245 months ago
See the previous step (Step 3)
parth_bhat11 months ago
my ethernet shields ic gets hot will u plsplspls help me for that
am using arduino leonardo board
pls help me

That happens with my wiznet W5100 too. It just happens I think.
I have one of the Non-POE (power Over Ethernet) 5100's, and it does the same to me.. I think it's the 3.3V regulator trying to run the single chip, which is chewing-up massive wattage.. (even if it is being powered from the +5V regulator from the Arduino.) I've often wondered, if I could repower this off the 3.3V off an external power supply, but someone said that's a bad idea, as the back-feed could burn-out the regulator, and other chips switching between the 9 down to 5, and 5 down to 3.3, or even the USB to serial chip.
randofo (author)  parth_bhat11 months ago
Did you do anything to change it, and/or did you plug it in correctly? It sounds like you are shorting something.
Reddyco5 months ago
When I try to upload thw sketch, it throws an error and it doesn't work. I'm using a UNO Board and Arduino 1.0.4.
The error says:

"DhcpAddressPrinter:26: error: 'EthernetClient' does not name a type"

Then, I tried to reimport the Ethernet library. It includes a lot more of header files (Dhcp, Dns, Ethernet, EthernetClient, EthernetServer, EthernetUdp and util), and then the error changes.

Ethernet_ENC28J60\Ethernet.cpp.o:C:\Program Files\Arduino 1.0\libraries\Ethernet_ENC28J60/Ethernet.cpp:27: multiple definition of `EthernetClass::_state'
Ethernet\Ethernet.cpp.o:C:\Program Files\Arduino 1.0\libraries\Ethernet/Ethernet.cpp:90: first defined here
Ethernet_ENC28J60\Ethernet.cpp.o:C:\Program Files\Arduino 1.0\libraries\Ethernet_ENC28J60/Ethernet.cpp:27: multiple definition of `EthernetClass::_server_port'
Ethernet\Ethernet.cpp.o:C:\Program Files\Arduino 1.0\libraries\Ethernet/Ethernet.cpp:90: first defined here
Ethernet_ENC28J60\Ethernet.cpp.o:C:\Program Files\Arduino 1.0\libraries\Ethernet_ENC28J60/Ethernet.cpp:27: multiple definition of `Ethernet'
Ethernet\Ethernet.cpp.o:C:\Program Files\Arduino 1.0\libraries\Ethernet/Ethernet.cpp:90: first defined here
c:/program files/arduino 1.0/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Warning: size of symbol `Ethernet' changed from 6 in Ethernet\Ethernet.cpp.o to 1 in Ethernet_ENC28J60\Ethernet.cpp.o

DO you have any ideia of what should I do?
araje5 months ago
Hi, I am using a Duemilanove on Arduino 1.0.5. I purchased an ethernet shield from ebay. When i try to run the DHCP address printer code, i get "Failed to configure Ethernet using DHCP" on the serial monitor. Plus, it takes about 3 minutes to get this message.
I observed that in the My Computer device manager, the drivers arent correctly installed. It just shows Ethernet Controller with a ? on the side.
Are these problems related?
Please help.
OmerS5 months ago
About the Client with the Twitter feed:
note that it stopped working because twitter switched from "http" to "https"(security reasons) and the arduino doesn't support it.

just trying to save you guys the exhausting time i spent trying to figure out why it doesn't work......:(
sshapiro21 year ago

Any advice: i have confirmed ip address with addressprinter.

byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x56, 0xC6 };
IPAddress ip(10,0,0,10); //<<< ENTER YOUR IP ADDRESS HERE!!!

The light goes on when i uplaod the script but wont respond to the ip $1 or $2, the page just sits and doesnt load. i even tried the script below to return a black screen and nothing loads on that ip.

i have a similar problem with the Switch activated code. It loads a white page with the words DARk but nothing happens when the switch is pressed, tried refreshing etc
meindi sshapiro26 months ago
Me too i had the same problem and i noticed that it is displayed "white!" WHILE you press the button so hold you finger on the button and refresh
comprehensive tutorial how the Arduino Ethernet shield can be interfaced with Arduino board and used in applications. Very good.
kiran prince8 months ago
Can you tell me what drivers(code) are being used for the SPI Interface

Thank You
ursul9 months ago
You have to set your router to make a port forwarding from your "public" IP address to the arduino IP address, as you would do for whatever device.
Go to your router setting panel, find your arduino in the connected devices list, assign a http service (port 80) to it. You can find an example of how to do it here (find on the website the router you use) :

Then, if your ISP provide you a static IP you can now "talk" to the arduino using an URL like: http://[yourStaticIp]:80/$1 http://[yourStaticIp]:80/$2
If your IP is dynamic, you can obtain a static IP on Good luck!
sandeep20087011 months ago
hi, i have successfully sent commands from a browser to ethernet shield in same network. but, can u please tell me how to do same if i have to do it from a separate network? actually i want to make an android app to operate ethernet shield, so i need it necessarily.
mwezel11 months ago
your ethernet shields is dead you plug something wrong
sshapiro21 year ago

sorry i had the wrong resistors in the circuit, was using those baby blue ones, I find them hard to read. make sure its the right resistor!
lazer eyes1 year ago
hai I have ethernet w5100 shield v3 and I have UNO and I'm using 1.0 and I tried all latest version of ide but i can't able to configure my ip address it is showing error "failed to configure mac address, I have mac address on the sticker , but it doesn't work
1) i hooked the SHIELD with uno
2) I changed the mac address in chcp address printer
3) program uploaded,
4) rj45 hooked with shield

after that my system showed local area network connected ,

when i click the serial monitor its showing only failed to confogure mac address"

what shall i do
clsorens1 year ago
I know it's kinda old-ish post, but just in case anyone else is still having this problem like I was too here's a solution.

It should still turn the light on, but the reason it's not displaying a web page is because the code doesn't return a web page.

change the "
if(c == '\n')
currentLineIsBlank = true;
} " to "

if (c == '\n' && currentLineIsBlank)
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connnection: close");
currentLineIsBlank = true;


This code will return a web page with the background set to black (#000000) after light turns on.
Zarainia1 year ago
Is the "serverName" line supposed to be changed?
Never mind, it worked. Thanks for the tutorial!
crusso1 year ago
Great instructable, Thank you very much!
grandleo751 year ago
Awesome tutorial. Thanks for posting it.

I seem to have a problem. pin2 seems to default to on. How can I get ti to default to off?

Never mind. I went to arduino 1.0.1 and it worked!
When I upload my code to my arduino it says "IPAddress does not name a type" Can you guys help. I tried fixing it but it always fails
What if you don't have access to a router? (e.g apartment building, hotel rooms...) Can I use the ethernet port on my win7 computer?
Port should handle the cross over internally if its a newer computer if it doesn't you will need a cross over cable.
What is a crossover cable, and do I need one? (If so, why) I have an Atheros AR8132 PCI-E Fast Ethernet Controller and and Atheros AR5B95 Wireless Network Controller.
Well communicating from pc to pc via the rj45 port in the past you would need a cross over cable. Alot of ports on newer computers usually handle this internally. You may need to check the specs for your computer. Please read up on cross over cables. Just look up pc to pc networking via rj45 port. Basically pc to pc networking. The arduino and ethernet shield is basically a computer.
OK, my memory just gave me the memory of hooking up mine with another (it worked) so a Windows 7 computer seems to be compatible. ;P Is it like the serial cables when you have to "cross over" the TX and RX wires? Anyhows, its working. Thanks for the help.
red_green1 year ago
I have an Ethernet shield, and I lost the sticker. All the sketches I upload, however, won't compile. First, is there a way to find the MAC address, and second, do you have any idea why the sample code won't compile?
Can I see the code? Also, try making up a random MAC address. How 'bout AB-CA-BA-12-34-AF?
mcktimo1 year ago
Everything worked but when I stressed the server a little by accessing it from multiple browsers (phone, laptop, etc) it would stop responding an need a reset. I wonder why?

Get More Out of Instructables

Already have an Account?


PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!