. Arduino UNO R4 - Ethernet Module | Arduino UNO R4 Tutorial
Arduino UNO R4 - Ethernet Module | Arduino UNO R4 Tutorial
Arduino UNO R4 - Ethernet Module | Arduino UNO R4 Tutorial

Arduino UNO R4 - Ethernet Module

This guide shows you how to connect the Arduino UNO R4 to the internet or your local network using the W5500 Ethernet module. We will discuss the following details:

How to connect Arduino UNO R4 with W5500 Ethernet Module How to program Arduino UNO R4 to Make HTTP Requests via Ethernet How to create a Basic Web Server on Arduino UNO R4 via Ethernet

Hardware Preparation

1×Arduino UNO R4 WiFi or Arduino UNO R4 Minima 1× Alternatively, DIYables STEM V4 IoT, Compatible with Arduino Uno R4 WiFi 1×USB Cable Type-A to Type-C (for USB-A PC) 1×USB Cable Type-C to Type-C (for USB-C PC) 1×W5500 Ethernet Module 1×Ethernet Cable 1×Jumper Wires 1×Breadboard 1× Recommended: Screw Terminal Block Shield for Arduino UNO R4 1× Recommended: Breadboard Shield for Arduino UNO R4 1× Recommended: Enclosure for Arduino UNO R4 1× Recommended: Power Splitter for Arduino UNO R4 1× Recommended: Prototyping Base Plate & Breadboard Kit for Arduino UNO

Or you can buy the following kits:

Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you. Additionally, some of these links are for products from our own brand, DIYables .

Overview of W5500 Ethernet module

The W5500 Ethernet module offers two interfaces:

RJ45 Ethernet interface: Connect to a router or switch using an Ethernet cable. SPI interface: Connect to an Arduino UNO R4 board using this interface. It includes 10 pins: NC pin: Leave this pin unconnected. INT pin: Leave this pin unconnected. RST pin: This is the reset pin. Connect it to the EN pin on the Arduino UNO R4. GND pin: Connect this pin to the GND pin on the Arduino UNO R4. 5V pin: Connect this pin to the 5V pin on the Arduino UNO R4. 3.3V pin: Leave this pin unconnected. MISO pin: Connect this pin to the SPI MISO pin on the Arduino UNO R4. MOSI pin: Connect this pin to the SPI MOSI pin on the Arduino UNO R4. SCS pin: Connect this pin to the SPI CS pin on the Arduino UNO R4. SCLK pin: Connect this pin to the SPI SCK pin on the Arduino UNO R4. image source: diyables.io

Wiring Diagram between Arduino UNO R4 and W5500 Ethernet module

This image is created using Fritzing. Click to enlarge image

Arduino UNO R4 code for Ethernet Module - Making HTTP request via Ethernet

This code functions as a web client. It sends HTTP requests to the web server at http://example.com/.

Detailed Instructions

Follow these instructions step by step:

If this is your first time using the Arduino Uno R4 WiFi/Minima, refer to the tutorial on setting up the environment for Arduino Uno R4 WiFi/Minima in the Arduino IDE.

Connect the Ethernet module to your Arduino UNO R4 according to the provided diagram Connect the Ethernet module to your your router or switch by using an Ethernet cable. Connect the Arduino Uno R4 board to your computer using a USB cable. Open the Arduino IDE on your computer. Select the appropriate Arduino Uno R4 board (e.g., Arduino Uno R4 Minima ) and COM port. Click on the Libraries icon on the left side of the Arduino IDE. In the search box, type “Ethernet” and locate the Ethernet library by Various. Press the Install button to add the Ethernet library. Open the Serial Monitor in the Arduino IDE. Copy the given code and paste it into the Arduino IDE. Click the Upload button in the Arduino IDE to send the code to the Arduino Uno R4. To view the output, look at the Serial Monitor where the results will be displayed as indicated. Arduino UNO R4 - Ethernet Tutorial Connected to server HTTP/1.1 200 OK Accept-Ranges: bytes Age: 208425 Cache-Control: max-age=604800 Content-Type: text/html; charset=UTF-8 Date: Fri, 12 Jul 2024 07:08:42 GMT Etag: "3147526947" Expires: Fri, 19 Jul 2024 07:08:42 GMT Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT Server: ECAcc (lac/55B8) Vary: Accept-Encoding X-Cache: HIT Content-Length: 1256 Connection: close Example Domain

Example Domain

This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.

More information.

disconnected Autoscroll Show timestamp Clear output

※ NOTE THAT:

If another device on the same network shares your MAC address, there may be issues.

Arduino UNO R4 code for Ethernet Module - Web Server

The code below turns the Arduino UNO R4 into a web server. This server sends a simple webpage to internet browsers.

/* * This Arduino UNO R4 code was developed by newbiely.com * * This Arduino UNO R4 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-uno-r4/arduino-uno-r4-ethernet-module */ # include < SPI .h># include < Ethernet .h>// replace the MAC address below by the MAC address printed on a sticker on the Arduino Shield 2 byte mac[] = < 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED >; EthernetServer server(80); void setup () < Serial . begin (9600); delay (1000); Serial . println ( "Arduino Uno R4 - Ethernet Tutorial" ); // initialize the Ethernet shield using DHCP: if ( Ethernet . begin (mac) == 0) < Serial . println ( "Failed to obtaining an IP address" ); // check for Ethernet hardware present if ( Ethernet .hardwareStatus() == EthernetNoHardware) Serial . println ( "Ethernet shield was not found" ); // check for Ethernet cable if ( Ethernet .linkStatus() == LinkOFF) Serial . println ( "Ethernet cable is not connected." ); while ( true ) ; >server. begin (); Serial . print ( "Arduino Uno R4 - Web Server IP Address: " ); 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 bool 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 (); client. println ( "" ); client. println ( "" ); client. println ( "" ); client. println ( "

Arduino Uno R4 - Web Server with Ethernet

" ); client. println ( "" ); client. println ( "" ); 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" ); > > Detailed Instructions Copy the above code and paste it into Arduino IDE. Click the Upload button in Arduino IDE to upload the code to Arduino Uno R4. Check the result on Serial Monitor, it will display as follows: Arduino UNO R4 - Ethernet Tutorial Arduino UNO R4 - Web Server IP Address: 192.168.0.2 Autoscroll Show timestamp Clear output

Copy the IP address given above and enter it into your web browser's address bar. You will see a simple webpage displayed by the Arduino UNO R4.

Learn More

※ OUR MESSAGES

As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us

Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!

DISCLOSURE

Newbiely.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com, Amazon.it, Amazon.fr, Amazon.co.uk, Amazon.ca, Amazon.de, Amazon.es, Amazon.nl, Amazon.pl and Amazon.se

Copyright © 2026 Newbiely.com. All rights reserved. Terms and Conditions | Privacy Policy Email: newbiely.com@gmail.com

TABLE OF CONTENTS

  • Hardware Preparation
  • Overview of W5500 Ethernet module
  • Wiring Diagram between Arduino UNO R4 and W5500 Ethernet module
  • Arduino UNO R4 code for Ethernet Module - Making HTTP request via Ethernet
  • Arduino UNO R4 code for Ethernet Module - Web Server
  • Learn More
📎📎📎📎📎📎📎📎📎📎