---
title: "Connect Arduino Nano to the Internet with W5500 Ethernet Module | Step-by-Step Guide"
url: "https://maker.wiznet.io/Lihan__/projects/connect-arduino-nano-to-the-internet-with-w5500-ethernet-module-step-by-step-guide/"
markdown_url: "https://maker.wiznet.io/Lihan__/projects/connect-arduino-nano-to-the-internet-with-w5500-ethernet-module-step-by-step-guide/md"
type: "UCC: User Created Content"
author: "Lihan__"
author_url: "https://maker.wiznet.io/Lihan__/"
original_author: "Lihan"
original_url: "https://www.youtube.com/watch?v=QIqd44lD8w8"
published: "2025-06-25"
language: "en"
hardware: ["M5Stack LAN Module with W5500"]
likes: 0
views: 3747
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Connect Arduino Nano to the Internet with W5500 Ethernet Module | Step-by-Step Guide

> Arduino Nano + W5500 hosts a live webpage showing LDR sensor data. Real-time brightness is displayed via HTML—Arduino acts as a full web server.

Original author: Lihan (source: https://www.youtube.com/watch?v=QIqd44lD8w8)

## Components

- **M5Stack LAN Module with W5500** x 1 ([docs](https://docs.m5stack.com/en/base/lan_base))

## Article

## 🌐 Project Overview

**Goal**:
This project uses an Arduino Nano, W5500 Ethernet module, and LDR sensor to **build a standalone web server** that displays real-time brightness data via a simple **embedded HTML webpage**.

**Highlight**:
Instead of just collecting sensor data, the project takes a step further by **hosting an actual webpage from the Arduino**, turning it into a true embedded web server.

---

## 🛠️ Hardware Configuration

| Component | Description |
| --- | --- |
| **Arduino Nano** | Main MCU controlling the entire system |
| **W5500 Ethernet Module** | Hardware-based TCP/IP stack; provides reliable wired Ethernet |
| **LDR Sensor** | Light-dependent resistor for sensing ambient brightness |
| **10kΩ Resistor** | Used in a voltage divider circuit with the LDR |
| **Ethernet Cable** | Connects W5500 to router or switch |
| **Jumper Wires** | For all physical interconnections |

---

## 🔌 Wiring

**W5500 to Arduino Nano via SPI**:

MOSI: D11

MISO: D12

SCK: D13

CS: D10

**LDR Sensor**:

One side to 5V

Other side to A0 (analog input) and also through a resistor to GND

---

## 💻 Software Stack

| Layer | Details |
| --- | --- |
| **IDE** | Arduino IDE |
| **Language** | C++ (Arduino Sketch) |
| **Libraries** | `<SPI.h>`, `<Ethernet2.h>` |
| **Network Setup** | Static IP, MAC address manually set |
| **Web Server Port** | Port 80 (standard HTTP) |

---

## 🌍 Webpage Implementation (Core Feature)

What makes this project stand out is the **implementation of an embedded HTTP web server** that serves **real-time sensor data** as a webpage:

When a client (browser) connects to the Arduino’s IP address, the device dynamically **generates an HTML response** containing the current LDR value.

This HTML is sent back to the browser, allowing users to **view live sensor data via a clean, text-based webpage**.

> ✅ No external server or cloud service is needed — the Arduino itself **hosts and renders the webpage**.

---

## ⚙️ Operation Flow

**Initialize Ethernet and start serverRead LDR sensor every 2 secondsWhen client connects, serve HTML with current brightness valueDisplay LDR value in browser dynamically (on refresh)**

---

## 🧾 Key Code Concepts

`Ethernet.begin()` sets up the network.

`server.available()` waits for incoming connections.

`client.println()` streams raw HTML to the client browser.

HTML is structured with elements like `<h1>LDR Value: 520</h1>` to show sensor data.

---

## 📈 Application Potential

**Smart Lighting DashboardsEmbedded Environment MonitoringEducational Example for IoT + Web IntegrationStandalone Kiosk Interfaces with Web UI**

---

Source: https://maker.wiznet.io/Lihan__/projects/connect-arduino-nano-to-the-internet-with-w5500-ethernet-module-step-by-step-guide/
