In this project using only an Arduino with an Ethernet shield.
I’ll be controlling one LED and a servo, but you can apply this method to control a DC motors, buzzers, relays, stepper motors, etc..


When you upload the the code provided in this tutorials. it creates a webserver in your LAN and you simply use the IP to access that webserver through your browser. After that it shows a webpage similar to that one below. When you press the button “Turn On LED” your url will change to: “” the arduino will read that information and It turns the LED On.

By default the IP is “″. That also can be found on the Arduino code provided.
The Webpage will look like the image on the attachments.

Check this Video tutorial below ! (Includes demonstration)

Step 1: Parts Required

  • 1x Arduino Uno
  • 1x Ethernet Shield (with Wiznet W5100 chip)
  • 1x 220 Ohm Resistor
  • 1x LED
  • 1x Micro Servo Motor
  • 1x Breadboard
  • Jumper Cables
<p>Hi,</p><p> i did upload the sketch and went to given ip address, but it didn't load at all. when i open the serial monitor, it say &quot;server is at; </p><p>only difference is i used a Ethernet module instead of shield.</p><p>i tried examples from EtherCard library, and they seems working. but when it comes to Ethernet library, something is wrong. HELP me!!</p>
<p>Hi<br>I start arduino as webserver and i found this project .<br>when i look at the code i can see :</p><p> client.println(&quot;&lt;HTML&gt;&quot;);</p><p> client.println(&quot;&lt;HEAD&gt;&quot;);</p><p>is it an obligation to put line by line string to output or can i do <br><br>client.println(&quot;&lt;HTML&gt;\n&lt;HEAD&gt;&quot;); <br><br>or <br><br>client.print(&quot;&lt;HTML&gt;&lt;HEAD&gt;&quot;);</p><p><br>within string length limitation of arduino memory <br><br>(with no &quot;ln&quot; or \n because blank space are normalized in html viewer ) </p><p>thank for the answer </p>
<p>Hello, i was wondering how you would go about changing the colours of the buttons (Turn on LED, etc.) on the website? I have been trying to learn how to use html and was wondering how how to do it.Any assistance would be greatly appreciated! Thanks</p>
<p>Hello, RuiSantos</p><p>I am an engineer in WIZnet which designed Ethernet chip you used as Ethernet shield.</p><p>Could I introduce your great project to WIZnet blog to share the idea for other makers??</p><p>It will be so hlepful!!</p><p>Thank you!</p><p>Lawrence.</p>
<p>i love it!, it is so simple y great</p>
<p>Was able to make one working. But there is a problem when i connect load to relay than my arduino webserver stops responding </p>
<p>ive been searching for days for something like this the only differance is i would like to use a wifi shield any help on what i would need to change?</p>
<p>whats ports on arduino ? thanks great tutorial</p>
<p>server is at</p><p>Please help..</p>
<p>Not able to connect via the server address(es) in the sketch or from the serial monitor. Ideas?</p>
<p>thanks for the code!</p><p>i modified it so i can control my 433mhz remote wall sockets with the newremoteswitch library. i used a clone uno r3 with unofficial ethernet shield. </p>
<p>Good day Sir! <br>I was wondering if ever i could make the servo rotate continuously? Because I'm planning to make a wheel for a simple robotic car. Is there any changes that i will make on the program or i will have to use continuous servos. I'm trying to make one but it only rotates on 180. I'm using Tower Pro SG-5010 servos.<br>Hope you could reply.</p>
<p>Hello:</p><p>Please.... how can I stop rotate after turn 360&deg;? </p>
<p>Hello,some question </p><p>what would happen if the connection to the webserves is a Shield 3g ? Can do it? </p><p>A greeting and thanks</p>
<p>Hi RUI,</p><p>Nice project there..:D </p><p>I have a yun so I wuold like to make it wireless..:D I replaced all the Ethernet with the wifi webserver.. and got connected ... </p><p>I can enter the local page with the bottuns (pc and mac) but when I try the buttons it goes to the setup page instead on turning the led on... </p><p>My code: <a href="http://goodworkmyboy.dk/test_wifi_led.txt" rel="nofollow">http://goodworkmyboy.dk/test_wifi_led.txt</a></p><p>Hope you can help... </p>
<p>I have a Yun with a Seeed Relay Shield. I'm trying to get a garage door opener sketch. I discovered the webserver piece can run inside Linux on the Yun but need help with everything else. </p>
<p>hı <br>your project is very good that I admire .<br>I used to arduino leonardo . I want to make this project. but I dont know arduino leonardo with ethernet shield can use. it is possible ? <br>best regards</p>
<p>Hey RUI.....i m a noob wrt comps and it engg.....i jst wanna knw &quot; can we include more buttons on server so that we can control more no of loads on arduino &quot;</p>
<p>I believe that any HTML editor can do it, since the code just passes an intruction trhu the web. For instance, if you want to turn on other led, just create an HTML button for this other led that passes on a &quot;turn on&quot; instruction for this same led, got it?</p><p>See some HTML tutorials here http://www.w3schools.com/</p>
<p>Thankzz Raphango... i got it....</p>
<p>You are welcome! ^^</p>
<p>Definetely gotta do it! =D</p><p>Thanks a lot!!!! =DDD</p>
can this be made using some wifi shield instead of ethernet?
Yes! Definitely, you just need to make a few changes...<br>I would start by taking a look at the Arduino Examples from the WiFi library.<br>And see how WiFiWebserver example works...<br>I hope this helps.<br><br>(Those examples I'm talking about can be found on the Arduino IDE)
<p>Hi Rui, great project. To access the Web UI from everywhere you might want to try our YalerEthernetServer library (see http://yaler.net/arduino). Just downloaded and adapted your code, seems to work fine. Kind regards, Thomas</p>
<p>Hello, My Ethernet shield is a Arduino R3 version, is it suppose to work with the code with this instructable?</p><p>Thanks,</p><p>TG</p>
yeah it should work just fine.<br>As your shield uses the exact same chip as mine...<br>Wiznet W5100
Hi <br>I did everything as in the tutorial, but I cant see the webpage, when I connect the serial monitor, it only says: server is at <br>What am I doing wrong? the software compiled without errors, tried with a set of IP addresses vlaid for my network, the router litght blinks so I think the board is alive and there is connection. <br>Thanks a lot <br>Leo
Sorry. The configuration is Arduino UNO and Ethernet Shield V1.1. <br> <br>Thanks
I'm glad you found the solution! <br>Have a nice day, <br>Rui
Hi Rui <br>Well, it still does not work, I was just telling about the hardware configuration. <br>Btw, I noticed that the ethenet shield you got there looks different than mine (V1.1). Managed to download a driver and put some sample code in, and it worked. But as far as I could analyze the code, it does not use the 'Ethernet.h' include, but 'etherShield.h', the rest of the code looks very 'hardware-oriented', with buffers and pointers and stuff, not at all as simple as your code looks. <br> I guess, it is a ethershield hardware version problem. Can you suggest a ethershield model, or you think it is possible to make your sketch to work with this one? <br> <br>Thanks again <br>Leo
<p>Hello Rui, I am back with my research, it might be useful for others.</p><p>What happened here, is that there are two types of ethernet shield, one based with the ENC28J60 chip, and another with the Wiznet W5100, which is the one supported by the default ethernet arduino library (the one you used).</p><p>Unfortunately, mine is the ENC28J60 based, and uses a different library, so a different way to program. So far I found two libs (actually three):</p><p>EtherShield:<a href="http://blog.thiseldo.co.uk/?p=329" rel="nofollow">http://blog.thiseldo.co.uk/?p=329</a> , this one is outdated and it looks out of support. I am sure it still works, but I discarded it. This is the one I had, with very hardware oriented looking code (byte oriented buffers, hex args, pointers, etc, even the simple webserver code looks pretty much unreadable compared to the one written with other libs).</p><p>EtherCard: <a href="https://github.com/jcw/ethercard" rel="nofollow"> https://github.com/jcw/ethercard </a> , still supported, managed to run some example sketches succesfully. Waaay simpler to read than the previous one.</p><p>UIPEthernet: <a href="https://github.com/ntruchsess/arduino_uip" rel="nofollow">https://github.com/ntruchsess/arduino_uip</a> , this one works as a wrapper to make 'Ethernet.h' code work like this project, replacing it with 'UIPEthernet.h&quot;. Cool!</p><p>Unfortunately, though I managed your sketch code to work on the ENC28J60 using the UIPEthernet, the arduino hardware hanged pretty often, I mean, the led could be turned ON, or the servo moved, but then it stopped responding to web requests. Sad.</p><p>What I will try now is try to adapt your code, but using the EtherCard, so people using this ethernet shield can run your project.</p><p>Thanks for listening</p><p>Leo</p><p><a href="https://github.com/jcw/ethercard" rel="nofollow"><br></a></p>
<p>Hi Leo,</p><p>Unfortunately I don't own a shield with ENC28J60 chip. So I can't make it compatible with that board, as I don't have a way to test it.<br><br>I'll update the parts list from my instructable so people don't have that problem too! Thanks for poiting that out.</p><p>I hope you can make it work with your board properly.</p><p>Have a nice day,</p><p>Rui</p>
I would like to buy it, without leds. It is possible ? <br>I was looking for something like this ! <br> <br>Dany
what you mean by buy it without leds? <br>You can find everything on amazon for example... <br>you don't need to buy the LED's this is just an example :)
for the price of the shields and such a raspberry pi is better and then use then pi to control the arduino through nodejs and Johnny give
Hi, <br>yes the Raspberry Pi can be also a good option... the BeagleBone is even better than the Rpi though. <br>It all depends where you buy your products from... the Raspberry Pi is way more expensive to setup than an Arduino and Ethernet shield (you can get a clone for $12)

About This Instructable


786 favorites


Bio: Author, Blogger, Electronics Enthusiast and Entrepreneur. For complete Electronics Projects and Tutorials go to: http://randomnerdtutorials.com/start-here
More by RuiSantos: ESP8266 Web Server (Without Arduino) Arduino Simple Memory Game Arduino – Datalogger with Temperature Sensor and Photoresistor
Add instructable to: