Make a Web Server Using Arduino

Published

Introduction: Make a Web Server Using Arduino

About: Jordan Fung is a 14-year-old entrepreneur and programmer from Hong Kong. He is also the founder and lead developer of Pedosa Innovation. He had been listed as the "Top 12 Young Makers in the world in 20...

This Instructable is also available on Jordan's Lab Notebook


Today, we will make an arduino-based web server using the Ethernet Shield.

Lets take a look what we need:

1. Arduino Ethernet Shield

2. Arduino Uno

3. A Ethernet Connection Wire

4. A Ethernet connection (from a router)

5. Arduino USB cable (for writing codes to the board)

Steps:

1. Connect the Ethernet Shield and the Arduino Uno.

2. Plug in the Arduino USB Cable to the board and the computer. The led on the board should light up.

3. On the computer, open Arduino IDE.

4. Open: File > Examples > Ethernet > WebServer

5. Change IPAddress ip(192,168,1,177); to IPAddress ip(192,168,0,177); and change EthernetServer server(80); to EthernetServer server(8081); to prevent conflicts.

6. Click the button to upload the code to the board.

7. Connect the ethernet cable to the arduino board and the router.

8. Navigate your browser to http://192.168.1.177, you should see the following:

You now have your web server in your own network!

In order to make your site visible to the public, you need port forwarding!

1. Open your router's configuration page, for example, my tp link router's link is tplinklogin.net.

2. Click on Forwarding (or Port Forwarding, Ports, etc, based on your router) from the menu.

3. Click "Add new"

4. Type in the following:

5. Click "Save".

6. Navigate to www.whatismyip.com

7. The IP Address shown on the website is the address of your website, for example, my address is 42.2.2.69, so my web server's website is 42.2.2.69:8081

You can now call your friends to test your website!

Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Casting Contest

      Casting Contest
    • Make it Move Contest

      Make it Move Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    6 Comments

    Why am I getting an error when I go to the webpage 192.169.1.177?

    3 replies

    @cherzog
    Could it be because the instructions say you have to change the IP to 192.168.0.177, but then later require you to go to 192.168.1.177 ?
    Also, I do not know about your settings or those of Jordan, but most internal IP addresses start with 192.168.xxx.xxx noy 192.169.xxx.xxx

    This is about the port you have chosen. If you are using port 80, you should navigate to 192.169.1.177. But if you are not using the default http port (80), you should type:

    192.169.1.177 + : + (the port you used)

    (without spaces and +)

    I think I've tried all of that, it might be my ethernet shield. it's not the same version, it's 2.2v

    you would also need an FTP server to upload your files for your website correct?

    1 reply

    No, FTP server is for server hosting companies to allow users to upload files. In this situation, the website can be either be saved in the sd card (plugged into the sd card slot of the arduino), or saved in the arduino atmega328 chip and programmed in the Arduino IDE as described above.