3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

ServDuino - Build Your Own Arduino Web server

ServDuino - Build Your Own Arduino Web server
«
  • 100_0590.JPG
  • ServDuino.jpg
  • Arduino Ethernet logo.jpg
  • 100_0693.JPG
The Arduino Ethernet Shield is a sweet toy!!!  Everybody, from the beginner who got their Arduino yesterday and hasn't slept since, to the hard core pro who learned c as a second language, can learn how to use the Ethernet Shield and have lots of fun with it.  Its that awesome! As soon as I earned enough to get one, it was mine, but it took a while for me to figure out how to get my site running and on the web, and I had some trouble with the software, but once I got started, I designed a whole web server, which included a traffic meter, LCD screen, and SD card storage!

This instructable is going to show you how you can make your own "ServDuino" web server, and get it on the web without some of the roadblocks that I, and many others have faced.


Some of this instructable is a work in progress - specifically the code on the programming step.  Not all of the code was released as of the publishing of this instructable because I am always improving or writing new code for my projects.  I am also seeking help from the instructables community in writing code, not because I am lazy, but because I know that I don't have the most efficient code, as I have been programming in c for only a few years, most of which is spent in the world of Arduino.

Don't forget to rate!
I entered this into the Microcontroller contest, so if you think its awesome, or it helps you off the ground with the ethernet shield, vote for it! :)
 
Remove these adsRemove these ads by Signing Up
 

Step 1What You Will Need

What You Will Need
«
  • 100_0581.JPG
  • 100_0586.JPG
  • 100_0591.JPG
  • 100_0594.JPG
  • 100_0608.JPG
For this project, you need only 2 things minimum to make it work.  Everything else is extras that you can include if you want to.

The Required Parts are:
An Arduino
An Arduino Ethernet Shield - Note:  If you have an older shield, you will not be able to use an SD card with it.  If you don't have a shield, get the newest version!!!

Optional Parts:
A box to put it in - Recommended
A Servo
An LCD Screen
Some LEDs
An SD Card

Even More Optional Parts - These are for external controls and/or sensors:
A Second Arduino
Whatever sonsers and controllers you want
Either a Long Cable or a wireless Transciever (like an Xbee)
« Previous StepDownload PDFView All StepsNext Step »
29 comments
Mar 30, 2012. 2:07 AMnmg196 says:
I think step 2 is very misleading for the reader. The examples use internal IP addresses and yet the article implies that if its not working then your ISP might be blocking ports. These are internal IP addresses which your ISP cannot touch or affect in any way (in fact you do not need internet access or an ISP for this to work). It also fails to mention the vastly more likely reason for it to not work which is that the default IP address used in the example might not be an IP address routable on your LAN (ie if the example uses 192.168.1.x addresses, but your own LAN uses 10.0.0.x addresses). The article should advise the user to change the IP address in the example to an IP address on their own subnet (which you can find by running ipconfig). In that paragraph it also mentions portforward.com which is irrelevant for testing this project on your internal network.

I think all the right text is there but the stuff about blocking ports and port forwarding should be moved to the relevant paragraph instead of sending people on a wild goose chase when trying to sort out a problem in their LAN :)

The line which says " Somebody could get into your router through your firewall and access personal information" when all they have is your IP address just makes me angry. IP addresses are public information - you reveal it to everyone every time you send them an email or give out the domain name. This statement is totally wrong and just confusing for the user and the author clearly doesn't understand the basics of the Internet. You cannot get through a firewall and access personal information (that's the entire point of a firewall). Similarly, if you give them a domain name, then that obviously reveals the IP address too as you can see if you "ping" the domain name and see the IP - it doesn't hide anything.
May 11, 2012. 3:20 PMnmg196 says:
Thanks, but although I can see you've made a few corrections, the article still seems to treat internal IP addresses as though they were external and still places the blame on the ISP. This is still very misleading. It seems you didn't understand anything I was saying so there is little point in me commenting further if you do not understand my explanations. I will simply caution the reader that the majority of the text on this page is incorrect and actively misleading.
Mar 30, 2012. 10:28 AMiApple guy says:
What is your site address, I want to visit it!!!
Apr 1, 2012. 5:07 PMcrackHacker says:
dyndns no longer offers free dns service.
May 11, 2012. 2:28 PMPiobel says:
Hi,

Sdwebserver fast don't work With arduino UNO.

Client.write(buf,maxbyte) don't send data.

Tanks for attention!!!
Apr 26, 2012. 2:07 PMdiy_bloke says:
You could actually store a (small) picture in your atmega eeprom, but it would not be a very efficient way of using memory. Also retrieving it from that eprom to display on a webpage might be less than straightforward and no doubt a bit slow
Apr 26, 2012. 2:02 PMdiy_bloke says:
Tend to agree with nmg 196. The 192 series of ip numbers are internal numbers and have nothing to do with your provider blocking your port 80.

indeed, better to change tje ip address in the program to one that is available on yr network and that depends on the router you may be using. Some go in the 192.168.1.xxx range, others in the 192.168.0.xxx range, or even the 10.0.0.xxx adress range as mentioned earlier.

If someone had my -external- ip address and I have a webserver running, then indeed by typing in that ip address, they could have a look at the main page of that websever, provided I had forwarded port 80. But that is still a far cry from being able to access my personal information, unless I would put that on that particular webserver.

As most arduino / ethernet adepts will probably use it to read out temperatures and put that on a web page, All the culprit wld be able to see is how warm your house or garden is.

It would be different ofcourse if you set up a webserver ro control functions, then any passer by (provided you have an open webserver) could alter functions in your house, like switch the lights on or off :-)
Mar 8, 2012. 8:55 AMTimoteo_Mendes says:
Very good tutorial.
Is what i have been looking for.
Thanks for sharing.

Timóteo
Jun 23, 2011. 2:50 PMdoby162 says:
This looks really cool! I can't download your code files though, when I try I just get .tmp files. I can read them by converting them into text documents but they are still a little jumbled. How much control does one have with a server like this? You mentioned using exbee to control devices over the web, but would those devices be able to simultaneously upload significant sensor information? (live video for instance) Thanks for sharing! I might have to make one of these. :oD
Feb 29, 2012. 8:38 PMRainbowjeremy says:
Great instructable! Can you post the code for the web controlled RGB LED? I'm not to familiar with programing and I am getting a message that says "sd2Card does not name a type" when trying to compile the "SDWebServer normal.txt." file. any ideas?
Feb 3, 2012. 10:51 AMDaniel Deacon says:
Can you help me please, i need this code made so it works with arduino website

Thanks

code:

// variables for input pin and control LED
int analogInput = 1;
int LEDpin = 13;
int prev = LOW;
int refresh = 1000;
float vout = 0.0;
float vin = 0.0;
float R1 = 45000.0; // !! resistance of R1 !!
float R2 = 4500.0; // !! resistance of R2 !!

// variable to store the value
int value = 0;


void setup(){

// declaration of pin modes
pinMode(analogInput, INPUT);
pinMode(LEDpin, OUTPUT);

// begin sending over serial port
Serial.begin(9600);
}

void loop(){
// read the value on analog input
value = analogRead(analogInput);
//Serial.print("value=");
//Serial.println(value);

if (value >= 1023) {
Serial.println("MAX!!");
delay(refresh);
return;
}
else if (value <= 0) {
Serial.println("MIN!!");
delay(refresh);
return;
}

// blink the LED
if (prev == LOW) {
prev = HIGH;
} else {
prev = LOW;
}
digitalWrite(LEDpin, prev);

// print result over the serial port
vout = (value * 5.0) / 1024.0;
vin = vout / (R2/(R1+R2));

//Serial.print("vout=");
//Serial.println(vout);

Serial.print(vin);
Serial.println(" volt");

// sleep...
delay(refresh);
}
Feb 5, 2012. 3:05 AMDaniel Deacon says:
hello,

I would like to make a web server with a voltmeter it doesn't have to be anything fancy just something like 'Solar Panel Battery Voltage' '12.24 Volts'. The code I posted was an example of how the volt meter works. I don't know how to add a code along side the main bit that runs the server.

Thanks for your help! :)
Feb 5, 2012. 7:00 AMDaniel Deacon says:
I meant to add I wish to have it displayed in the web page all the serial communications :D thanks
Jan 19, 2012. 4:32 PMGelfling6 says:
Making a page-dump of the entire project. It may be exactly the thing I need for a WiFi Controlled robot I've been working on, based on the Arduino, and using a mini WiFi router.. Thanks!
Nov 22, 2011. 3:44 PMcinezaster says:
Have you tried multi html pages, with images stored on the sd card and js or css files loaded from the arduino.
Because I'm going to make my office controlled by a ethernet arduino.
Controlling lights and powersources and showing some enviromental data on a webpage.
I was thinking to pull and push the data and controls by ajax.
Arduino by itself is no problem but I never tried the ethernet shield and/or the SD libraries.
And I'm going to use the ENC28J60 ethernet module.
I hope there is enough space on the arduino chip.
Jul 26, 2011. 1:06 PMtatazm says:
Nice works. I am trying to build a small robot controlled wireless via xbee and ethernet shield.


Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
48
Followers
10
Author:Teslaling(Teslaling)
I like to make things that move, sense, calculate, compute, blink, and make noise. I like making things that create high voltages, electrical arcs, and can light fluorescent bulbs at a distance. I li...
more »