---
title: "Arduino Nano web server with w5500"
url: "https://maker.wiznet.io/praveen_k/projects/Arduino-Nano-web-server-with-w5500/"
markdown_url: "https://maker.wiznet.io/praveen_k/projects/Arduino-Nano-web-server-with-w5500/md"
type: "UCC: User Created Content"
author: "praveen_k"
author_url: "https://maker.wiznet.io/praveen_k/"
original_author: "praveen_k"
original_url: "https://pastebin.com/ub5h2xdg"
published: "2022-03-29"
language: "en"
hardware: ["WIZnet W5500", "Arduino nano"]
likes: 0
views: 478
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Arduino Nano web server with w5500

> Arduino Nano web server with w5500

Original author: praveen_k (source: https://pastebin.com/ub5h2xdg)

## Components

- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))
- **Arduino nano** x 1

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Article

?https://docs.arduino.cc/tutorials/ethernet-shield-rev2/WebServer ? Web Server ARDUINO NANO A5 SCL Yellow A4 SDA Green D10 CS SPI D11 MOSI SPI D12 MISO SPI D13 SCK SPI ARCELI W5500 SPI LAN Ethernet Module reseau TCP IP STM32 Interface 3.3V 5V https://www.amazon.fr/gp/product/B09DYFLMJG/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1 GND ? ? ? ? ? ? ? ? ? ? ? ? ? GND GND ? ? ? ? ? ? ? ? ? ? ? ? ? VCC --> +3V3 arduino nano MOSI --> D11 arduino nano ? ? VCC --> +3V3 arduino nano SCK --> ?D13 arduino nano ? ? NC CS ?--> ?D10 arduino nano ? ? RST INT ? ? ? ? ? ? ? ? ? ? ? ? ? MISO --> D12 arduino nano ?*/ #include &lt;SPI.h> #include &lt;Ethernet.h> byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEE}; //MAC Address IPAddress ip(192, 168, 6,69);//IP address EthernetServer server(80);//PORT 80 http // Initialize the Ethernet server library void setup() { ? Ethernet.init(10); ?// CS D10(Arduino Nano) -->CS W5500 ? Serial.begin(9600); //Serial Debug ? while (!Serial) { } //Wait USB Serial ttyUSB ? Serial.println("Ethernet WebServer"); ? Ethernet.begin(mac, ip); //Start Server web ? // Check for Ethernet hardware present ? if (Ethernet.hardwareStatus() == EthernetNoHardware) { ? ? Serial.println("Ethernet ARCELI W5500 ?not found."); ? ? while (true) { ? ? ? delay(1); // Bucle No hardware Error ? ? } ? }else { Serial.println("Ethernet Hardware W5500 OK ");}; ? if (Ethernet.linkStatus() == LinkOFF) { ? ? Serial.println("Ethernet cable is not connected."); ? } ? // start the server ? server.begin(); ? Serial.print("server IP "); ? Serial.println(Ethernet.localIP()); } void loop() { ? // listen for incoming clients ? EthernetClient client = server.available(); ? if (client) { ? ? Serial.println("new client"); ? ? // an http request ends with a blank line ? ? boolean currentLineIsBlank = true; ? ? while (client.connected()) { ? ? ? if (client.available()) { ? ? ? ? char c = client.read(); ? ? ? ? Serial.write(c); ? ? ? ? // if you've gotten to the end of the line (received a newline ? ? ? ? // character) and the line is blank, the http request has ended, ? ? ? ? // so you can send a reply ? ? ? ? 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("Connection: close"); ?// the connection will be closed after completion of the response ? ? ? ? ? client.println("Refresh: 5"); ?// refresh the page ?every 5 sec ? ? ? ? ? client.println(); ? ? ? ? ? client.println("&lt;!DOCTYPE HTML>"); ? ? ? ? ? client.println("&lt;html>"); ? ? ? ? ?client.print("ICARO SERVER on ARDUINO NANO WITH w5500 "); ? ? ? ? ?client.println("&lt;br />"); ? ? ? ? ?client.println("&lt;/html>"); ? ? ? ? ?break; ? ? ? ? } ? ? ? ? if (c == 'n') { ? ? ? ? ? // you're starting a new line ? ? ? ? ? currentLineIsBlank = true; ? ? ? ? } else if (c != 'r') { ? ? ? ? ? // you've gotten a character on the current line ? ? ? ? ? currentLineIsBlank = false; ? ? ? ? } ? ? ? } ? ? } ? ? // give the web browser time to receive the data ? ? delay(1); ? ? // close the connection: ? ? client.stop(); ? ? Serial.println("client disconnected"); ? } } RAW Paste Data

---

Source: https://maker.wiznet.io/praveen_k/projects/Arduino-Nano-web-server-with-w5500/
